diff --git a/.changelog/48176d8b5be84a7b9ed2a9f2028ce6ce.json b/.changelog/48176d8b5be84a7b9ed2a9f2028ce6ce.json new file mode 100644 index 00000000000..f35813e3fde --- /dev/null +++ b/.changelog/48176d8b5be84a7b9ed2a9f2028ce6ce.json @@ -0,0 +1,8 @@ +{ + "id": "48176d8b-5be8-4a7b-9ed2-a9f2028ce6ce", + "type": "feature", + "description": "This release adds information about the resources DevOps Guru is analyzing.", + "modules": [ + "service/devopsguru" + ] +} \ No newline at end of file diff --git a/.changelog/9c02b8abaeea420fb30a95e35366ec2b.json b/.changelog/9c02b8abaeea420fb30a95e35366ec2b.json new file mode 100644 index 00000000000..d75e5608164 --- /dev/null +++ b/.changelog/9c02b8abaeea420fb30a95e35366ec2b.json @@ -0,0 +1,8 @@ +{ + "id": "9c02b8ab-aeea-420f-b30a-95e35366ec2b", + "type": "feature", + "description": "CloudWatch RUM now supports Extended CloudWatch Metrics with Additional Dimensions", + "modules": [ + "service/rum" + ] +} \ No newline at end of file diff --git a/.changelog/9f73a5439c2a47728de6199151f4575b.json b/.changelog/9f73a5439c2a47728de6199151f4575b.json new file mode 100644 index 00000000000..57ca0a4a9be --- /dev/null +++ b/.changelog/9f73a5439c2a47728de6199151f4575b.json @@ -0,0 +1,8 @@ +{ + "id": "9f73a543-9c2a-4772-8de6-199151f4575b", + "type": "feature", + "description": "In this release, we are introducing support for regional optimization for AWS Resilience Hub applications. It also includes a few documentation updates to improve clarity.", + "modules": [ + "service/resiliencehub" + ] +} \ No newline at end of file diff --git a/.changelog/c5583412baa64f97aaecc0506ba2c8c5.json b/.changelog/c5583412baa64f97aaecc0506ba2c8c5.json new file mode 100644 index 00000000000..a541194d741 --- /dev/null +++ b/.changelog/c5583412baa64f97aaecc0506ba2c8c5.json @@ -0,0 +1,8 @@ +{ + "id": "c5583412-baa6-4f97-aaec-c0506ba2c8c5", + "type": "feature", + "description": "Global Accelerator now supports AddEndpoints and RemoveEndpoints operations for standard endpoint groups.", + "modules": [ + "service/globalaccelerator" + ] +} \ No newline at end of file diff --git a/service/devopsguru/api_op_DescribeAccountHealth.go b/service/devopsguru/api_op_DescribeAccountHealth.go index de13c68c8f2..a44371a018b 100644 --- a/service/devopsguru/api_op_DescribeAccountHealth.go +++ b/service/devopsguru/api_op_DescribeAccountHealth.go @@ -59,6 +59,10 @@ type DescribeAccountHealthOutput struct { // This member is required. ResourceHours *int64 + // Number of resources that DevOps Guru is monitoring in your Amazon Web Services + // account. + AnalyzedResourceCount *int64 + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/devopsguru/api_op_ListMonitoredResources.go b/service/devopsguru/api_op_ListMonitoredResources.go index e64ab54d870..42d69461ca2 100644 --- a/service/devopsguru/api_op_ListMonitoredResources.go +++ b/service/devopsguru/api_op_ListMonitoredResources.go @@ -33,8 +33,6 @@ type ListMonitoredResourcesInput struct { // Filters to determine which monitored resources you want to retrieve. You can // filter by resource type or resource permission status. - // - // This member is required. Filters *types.ListMonitoredResourcesFilters // The maximum number of results to return with a single call. To retrieve the diff --git a/service/devopsguru/api_op_SearchInsights.go b/service/devopsguru/api_op_SearchInsights.go index bcc1739b4c6..a047fc39e32 100644 --- a/service/devopsguru/api_op_SearchInsights.go +++ b/service/devopsguru/api_op_SearchInsights.go @@ -13,11 +13,11 @@ import ( ) // Returns a list of insights in your Amazon Web Services account. You can specify -// which insights are returned by their start time, one or more statuses (ONGOING, -// CLOSED, and CLOSED), one or more severities (LOW, MEDIUM, and HIGH), and type -// (REACTIVE or PROACTIVE). Use the Filters parameter to specify status and -// severity search parameters. Use the Type parameter to specify REACTIVE or -// PROACTIVE in your search. +// which insights are returned by their start time, one or more statuses (ONGOING +// or CLOSED), one or more severities (LOW, MEDIUM, and HIGH), and type (REACTIVE +// or PROACTIVE). Use the Filters parameter to specify status and severity search +// parameters. Use the Type parameter to specify REACTIVE or PROACTIVE in your +// search. func (c *Client) SearchInsights(ctx context.Context, params *SearchInsightsInput, optFns ...func(*Options)) (*SearchInsightsOutput, error) { if params == nil { params = &SearchInsightsInput{} diff --git a/service/devopsguru/deserializers.go b/service/devopsguru/deserializers.go index 058ff5740d6..7202057a9b6 100644 --- a/service/devopsguru/deserializers.go +++ b/service/devopsguru/deserializers.go @@ -430,6 +430,19 @@ func awsRestjson1_deserializeOpDocumentDescribeAccountHealthOutput(v **DescribeA for key, value := range shape { switch key { + case "AnalyzedResourceCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AnalyzedResourceCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AnalyzedResourceCount = ptr.Int64(i64) + } + case "MetricsAnalyzed": if value != nil { jtv, ok := value.(json.Number) @@ -6019,6 +6032,19 @@ func awsRestjson1_deserializeDocumentCloudFormationHealth(v **types.CloudFormati for key, value := range shape { switch key { + case "AnalyzedResourceCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AnalyzedResourceCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AnalyzedResourceCount = ptr.Int64(i64) + } + case "Insight": if err := awsRestjson1_deserializeDocumentInsightHealth(&sv.Insight, value); err != nil { return err @@ -7368,6 +7394,22 @@ func awsRestjson1_deserializeDocumentMonitoredResourceIdentifier(v **types.Monit for key, value := range shape { switch key { + case "LastUpdated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "MonitoredResourceName": if value != nil { jtv, ok := value.(string) @@ -7377,6 +7419,11 @@ func awsRestjson1_deserializeDocumentMonitoredResourceIdentifier(v **types.Monit sv.MonitoredResourceName = ptr.String(jtv) } + case "ResourceCollection": + if err := awsRestjson1_deserializeDocumentResourceCollection(&sv.ResourceCollection, value); err != nil { + return err + } + case "ResourcePermission": if value != nil { jtv, ok := value.(string) @@ -10459,6 +10506,19 @@ func awsRestjson1_deserializeDocumentServiceHealth(v **types.ServiceHealth, valu for key, value := range shape { switch key { + case "AnalyzedResourceCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AnalyzedResourceCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AnalyzedResourceCount = ptr.Int64(i64) + } + case "Insight": if err := awsRestjson1_deserializeDocumentServiceInsightHealth(&sv.Insight, value); err != nil { return err @@ -11189,6 +11249,19 @@ func awsRestjson1_deserializeDocumentTagHealth(v **types.TagHealth, value interf for key, value := range shape { switch key { + case "AnalyzedResourceCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AnalyzedResourceCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AnalyzedResourceCount = ptr.Int64(i64) + } + case "AppBoundaryKey": if value != nil { jtv, ok := value.(string) diff --git a/service/devopsguru/types/enums.go b/service/devopsguru/types/enums.go index f3556647540..60c84329fca 100644 --- a/service/devopsguru/types/enums.go +++ b/service/devopsguru/types/enums.go @@ -459,7 +459,33 @@ type ResourceTypeFilter string // Enum values for ResourceTypeFilter const ( - ResourceTypeFilterLogGroups ResourceTypeFilter = "LOG_GROUPS" + ResourceTypeFilterLogGroups ResourceTypeFilter = "LOG_GROUPS" + ResourceTypeFilterCloudfrontDistribution ResourceTypeFilter = "CLOUDFRONT_DISTRIBUTION" + ResourceTypeFilterDynamodbTable ResourceTypeFilter = "DYNAMODB_TABLE" + ResourceTypeFilterEc2NatGateway ResourceTypeFilter = "EC2_NAT_GATEWAY" + ResourceTypeFilterEcsCluster ResourceTypeFilter = "ECS_CLUSTER" + ResourceTypeFilterEcsService ResourceTypeFilter = "ECS_SERVICE" + ResourceTypeFilterEksCluster ResourceTypeFilter = "EKS_CLUSTER" + ResourceTypeFilterElasticBeanstalkEnvironment ResourceTypeFilter = "ELASTIC_BEANSTALK_ENVIRONMENT" + ResourceTypeFilterElasticLoadBalancerLoadBalancer ResourceTypeFilter = "ELASTIC_LOAD_BALANCER_LOAD_BALANCER" + ResourceTypeFilterElasticLoadBalancingV2LoadBalancer ResourceTypeFilter = "ELASTIC_LOAD_BALANCING_V2_LOAD_BALANCER" + ResourceTypeFilterElasticLoadBalancingV2TargetGroup ResourceTypeFilter = "ELASTIC_LOAD_BALANCING_V2_TARGET_GROUP" + ResourceTypeFilterElasticacheCacheCluster ResourceTypeFilter = "ELASTICACHE_CACHE_CLUSTER" + ResourceTypeFilterElasticsearchDomain ResourceTypeFilter = "ELASTICSEARCH_DOMAIN" + ResourceTypeFilterKinesisStream ResourceTypeFilter = "KINESIS_STREAM" + ResourceTypeFilterLambdaFunction ResourceTypeFilter = "LAMBDA_FUNCTION" + ResourceTypeFilterOpenSearchServiceDomain ResourceTypeFilter = "OPEN_SEARCH_SERVICE_DOMAIN" + ResourceTypeFilterRdsDbInstance ResourceTypeFilter = "RDS_DB_INSTANCE" + ResourceTypeFilterRdsDbCluster ResourceTypeFilter = "RDS_DB_CLUSTER" + ResourceTypeFilterRedshiftCluster ResourceTypeFilter = "REDSHIFT_CLUSTER" + ResourceTypeFilterRoute53HostedZone ResourceTypeFilter = "ROUTE53_HOSTED_ZONE" + ResourceTypeFilterRoute53HealthCheck ResourceTypeFilter = "ROUTE53_HEALTH_CHECK" + ResourceTypeFilterS3Bucket ResourceTypeFilter = "S3_BUCKET" + ResourceTypeFilterSagemakerEndpoint ResourceTypeFilter = "SAGEMAKER_ENDPOINT" + ResourceTypeFilterSnsTopic ResourceTypeFilter = "SNS_TOPIC" + ResourceTypeFilterSqsQueue ResourceTypeFilter = "SQS_QUEUE" + ResourceTypeFilterStepFunctionsActivity ResourceTypeFilter = "STEP_FUNCTIONS_ACTIVITY" + ResourceTypeFilterStepFunctionsStateMachine ResourceTypeFilter = "STEP_FUNCTIONS_STATE_MACHINE" ) // Values returns all known values for ResourceTypeFilter. Note that this can be @@ -468,6 +494,32 @@ const ( func (ResourceTypeFilter) Values() []ResourceTypeFilter { return []ResourceTypeFilter{ "LOG_GROUPS", + "CLOUDFRONT_DISTRIBUTION", + "DYNAMODB_TABLE", + "EC2_NAT_GATEWAY", + "ECS_CLUSTER", + "ECS_SERVICE", + "EKS_CLUSTER", + "ELASTIC_BEANSTALK_ENVIRONMENT", + "ELASTIC_LOAD_BALANCER_LOAD_BALANCER", + "ELASTIC_LOAD_BALANCING_V2_LOAD_BALANCER", + "ELASTIC_LOAD_BALANCING_V2_TARGET_GROUP", + "ELASTICACHE_CACHE_CLUSTER", + "ELASTICSEARCH_DOMAIN", + "KINESIS_STREAM", + "LAMBDA_FUNCTION", + "OPEN_SEARCH_SERVICE_DOMAIN", + "RDS_DB_INSTANCE", + "RDS_DB_CLUSTER", + "REDSHIFT_CLUSTER", + "ROUTE53_HOSTED_ZONE", + "ROUTE53_HEALTH_CHECK", + "S3_BUCKET", + "SAGEMAKER_ENDPOINT", + "SNS_TOPIC", + "SQS_QUEUE", + "STEP_FUNCTIONS_ACTIVITY", + "STEP_FUNCTIONS_STATE_MACHINE", } } diff --git a/service/devopsguru/types/types.go b/service/devopsguru/types/types.go index e24272d4f12..7363a2a3060 100644 --- a/service/devopsguru/types/types.go +++ b/service/devopsguru/types/types.go @@ -199,6 +199,10 @@ type CloudFormationCostEstimationResourceCollectionFilter struct { // that are specified by an Amazon Web Services CloudFormation stack. type CloudFormationHealth struct { + // Number of resources that DevOps Guru is monitoring in your account that are + // specified by an Amazon Web Services CloudFormation stack. + AnalyzedResourceCount *int64 + // Information about the health of the Amazon Web Services resources in your // account that are specified by an Amazon Web Services CloudFormation stack, // including the number of open proactive, open reactive insights, and the Mean @@ -651,9 +655,21 @@ type LogsAnomalyDetectionIntegrationConfig struct { // DevOps Guru to access that resource. type MonitoredResourceIdentifier struct { + // The time at which DevOps Guru last updated this resource. + LastUpdated *time.Time + // The name of the resource being monitored. MonitoredResourceName *string + // A collection of Amazon Web Services resources supported by DevOps Guru. The two + // types of Amazon Web Services resource collections supported are Amazon Web + // Services CloudFormation stacks and Amazon Web Services resources that contain + // the same Amazon Web Services tag. DevOps Guru can be configured to analyze the + // Amazon Web Services resources that are defined in the stacks or that are tagged + // using the same tag key. You can specify up to 500 Amazon Web Services + // CloudFormation stacks. + ResourceCollection *ResourceCollection + // The permission status of a resource. ResourcePermission ResourcePermission @@ -1880,6 +1896,10 @@ type ServiceCollection struct { // Represents the health of an Amazon Web Services service. type ServiceHealth struct { + // Number of resources that DevOps Guru is monitoring in an analyzed Amazon Web + // Services service. + AnalyzedResourceCount *int64 + // Represents the health of an Amazon Web Services service. This is a // ServiceInsightHealth that contains the number of open proactive and reactive // insights for this service. @@ -2124,6 +2144,10 @@ type TagCostEstimationResourceCollectionFilter struct { // that are specified by an Amazon Web Services tag key. type TagHealth struct { + // Number of resources that DevOps Guru is monitoring in your account that are + // specified by an Amazon Web Services tag. + AnalyzedResourceCount *int64 + // An Amazon Web Services tag key that is used to identify the Amazon Web Services // resources that DevOps Guru analyzes. All Amazon Web Services resources in your // account and Region tagged with this key make up your DevOps Guru application and diff --git a/service/devopsguru/validators.go b/service/devopsguru/validators.go index b2e2cef32a1..a3b6041b80d 100644 --- a/service/devopsguru/validators.go +++ b/service/devopsguru/validators.go @@ -1091,9 +1091,7 @@ func validateOpListMonitoredResourcesInput(v *ListMonitoredResourcesInput) error return nil } invalidParams := smithy.InvalidParamsError{Context: "ListMonitoredResourcesInput"} - if v.Filters == nil { - invalidParams.Add(smithy.NewErrParamRequired("Filters")) - } else if v.Filters != nil { + if v.Filters != nil { if err := validateListMonitoredResourcesFilters(v.Filters); err != nil { invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) } diff --git a/service/globalaccelerator/api_op_AddEndpoints.go b/service/globalaccelerator/api_op_AddEndpoints.go new file mode 100644 index 00000000000..9ed5c653219 --- /dev/null +++ b/service/globalaccelerator/api_op_AddEndpoints.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Add endpoints to an endpoint group. The AddEndpoints API operation is the +// recommended option for adding endpoints. The alternative options are to add +// endpoints when you create an endpoint group (with the CreateEndpointGroup +// (https://docs.aws.amazon.com/global-accelerator/latest/api/API_CreateEndpointGroup.html) +// API) or when you update an endpoint group (with the UpdateEndpointGroup +// (https://docs.aws.amazon.com/global-accelerator/latest/api/API_UpdateEndpointGroup.html) +// API). There are two advantages to using AddEndpoints to add endpoints: +// +// * It's +// faster, because Global Accelerator only has to resolve the new endpoints that +// you're adding. +// +// * It's more convenient, because you don't need to specify all of +// the current endpoints that are already in the endpoint group in addition to the +// new endpoints that you want to add. +func (c *Client) AddEndpoints(ctx context.Context, params *AddEndpointsInput, optFns ...func(*Options)) (*AddEndpointsOutput, error) { + if params == nil { + params = &AddEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddEndpoints", params, optFns, c.addOperationAddEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AddEndpointsInput struct { + + // The list of endpoint objects. + // + // This member is required. + EndpointConfigurations []types.EndpointConfiguration + + // The Amazon Resource Name (ARN) of the endpoint group. + // + // This member is required. + EndpointGroupArn *string + + noSmithyDocumentSerde +} + +type AddEndpointsOutput struct { + + // The list of endpoint objects. + EndpointDescriptions []types.EndpointDescription + + // The Amazon Resource Name (ARN) of the endpoint group. + EndpointGroupArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAddEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddEndpoints{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAddEndpointsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddEndpoints(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAddEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "AddEndpoints", + } +} diff --git a/service/globalaccelerator/api_op_RemoveEndpoints.go b/service/globalaccelerator/api_op_RemoveEndpoints.go new file mode 100644 index 00000000000..6490a5244f2 --- /dev/null +++ b/service/globalaccelerator/api_op_RemoveEndpoints.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Remove endpoints from an endpoint group. The RemoveEndpoints API operation is +// the recommended option for removing endpoints. The alternative is to remove +// endpoints by updating an endpoint group by using the UpdateEndpointGroup +// (https://docs.aws.amazon.com/global-accelerator/latest/api/API_UpdateEndpointGroup.html) +// API operation. There are two advantages to using AddEndpoints to remove +// endpoints instead: +// +// * It's more convenient, because you only need to specify the +// endpoints that you want to remove. With the UpdateEndpointGroup API operation, +// you must specify all of the endpoints in the endpoint group except the ones that +// you want to remove from the group. +// +// * It's faster, because Global Accelerator +// doesn't need to resolve any endpoints. With the UpdateEndpointGroup API +// operation, Global Accelerator must resolve all of the endpoints that remain in +// the group. +func (c *Client) RemoveEndpoints(ctx context.Context, params *RemoveEndpointsInput, optFns ...func(*Options)) (*RemoveEndpointsOutput, error) { + if params == nil { + params = &RemoveEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveEndpoints", params, optFns, c.addOperationRemoveEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveEndpointsInput struct { + + // The Amazon Resource Name (ARN) of the endpoint group. + // + // This member is required. + EndpointGroupArn *string + + // The identifiers of the endpoints that you want to remove. + // + // This member is required. + EndpointIdentifiers []types.EndpointIdentifier + + noSmithyDocumentSerde +} + +type RemoveEndpointsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveEndpoints{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRemoveEndpointsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveEndpoints(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "RemoveEndpoints", + } +} diff --git a/service/globalaccelerator/deserializers.go b/service/globalaccelerator/deserializers.go index 13a35b1a5e6..9d44481c15e 100644 --- a/service/globalaccelerator/deserializers.go +++ b/service/globalaccelerator/deserializers.go @@ -150,6 +150,132 @@ func awsAwsjson11_deserializeOpErrorAddCustomRoutingEndpoints(response *smithyht } } +type awsAwsjson11_deserializeOpAddEndpoints struct { +} + +func (*awsAwsjson11_deserializeOpAddEndpoints) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpAddEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorAddEndpoints(response, &metadata) + } + output := &AddEndpointsOutput{} + 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_deserializeOpDocumentAddEndpointsOutput(&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_deserializeOpErrorAddEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("EndpointGroupNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("TransactionInProgressException", errorCode): + return awsAwsjson11_deserializeErrorTransactionInProgressException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpAdvertiseByoipCidr struct { } @@ -4275,6 +4401,107 @@ func awsAwsjson11_deserializeOpErrorRemoveCustomRoutingEndpoints(response *smith } } +type awsAwsjson11_deserializeOpRemoveEndpoints struct { +} + +func (*awsAwsjson11_deserializeOpRemoveEndpoints) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRemoveEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorRemoveEndpoints(response, &metadata) + } + output := &RemoveEndpointsOutput{} + 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_deserializeOpErrorRemoveEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("EndpointGroupNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + case strings.EqualFold("TransactionInProgressException", errorCode): + return awsAwsjson11_deserializeErrorTransactionInProgressException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpTagResource struct { } @@ -6108,6 +6335,41 @@ func awsAwsjson11_deserializeErrorListenerNotFoundException(response *smithyhttp return output } +func awsAwsjson11_deserializeErrorTransactionInProgressException(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.TransactionInProgressException{} + err := awsAwsjson11_deserializeDocumentTransactionInProgressException(&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_deserializeDocumentAccelerator(v **types.Accelerator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9067,6 +9329,46 @@ func awsAwsjson11_deserializeDocumentTags(v *[]types.Tag, value interface{}) err return nil } +func awsAwsjson11_deserializeDocumentTransactionInProgressException(v **types.TransactionInProgressException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TransactionInProgressException + if *v == nil { + sv = &types.TransactionInProgressException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentAddCustomRoutingEndpointsOutput(v **AddCustomRoutingEndpointsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9112,6 +9414,51 @@ func awsAwsjson11_deserializeOpDocumentAddCustomRoutingEndpointsOutput(v **AddCu return nil } +func awsAwsjson11_deserializeOpDocumentAddEndpointsOutput(v **AddEndpointsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AddEndpointsOutput + if *v == nil { + sv = &AddEndpointsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EndpointDescriptions": + if err := awsAwsjson11_deserializeDocumentEndpointDescriptions(&sv.EndpointDescriptions, value); err != nil { + return err + } + + case "EndpointGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EndpointGroupArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentAdvertiseByoipCidrOutput(v **AdvertiseByoipCidrOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/globalaccelerator/generated.json b/service/globalaccelerator/generated.json index f3cc4b75f2d..f7a4f35a0b6 100644 --- a/service/globalaccelerator/generated.json +++ b/service/globalaccelerator/generated.json @@ -9,6 +9,7 @@ "api_client.go", "api_client_test.go", "api_op_AddCustomRoutingEndpoints.go", + "api_op_AddEndpoints.go", "api_op_AdvertiseByoipCidr.go", "api_op_AllowCustomRoutingTraffic.go", "api_op_CreateAccelerator.go", @@ -45,6 +46,7 @@ "api_op_ListTagsForResource.go", "api_op_ProvisionByoipCidr.go", "api_op_RemoveCustomRoutingEndpoints.go", + "api_op_RemoveEndpoints.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateAccelerator.go", diff --git a/service/globalaccelerator/serializers.go b/service/globalaccelerator/serializers.go index b0a1c3a22f4..863dfbc3515 100644 --- a/service/globalaccelerator/serializers.go +++ b/service/globalaccelerator/serializers.go @@ -71,6 +71,61 @@ func (m *awsAwsjson11_serializeOpAddCustomRoutingEndpoints) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpAddEndpoints struct { +} + +func (*awsAwsjson11_serializeOpAddEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpAddEndpoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("GlobalAccelerator_V20180706.AddEndpoints") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentAddEndpointsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpAdvertiseByoipCidr struct { } @@ -2051,6 +2106,61 @@ func (m *awsAwsjson11_serializeOpRemoveCustomRoutingEndpoints) HandleSerialize(c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpRemoveEndpoints struct { +} + +func (*awsAwsjson11_serializeOpRemoveEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRemoveEndpoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("GlobalAccelerator_V20180706.RemoveEndpoints") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRemoveEndpointsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpTagResource struct { } @@ -2747,6 +2857,36 @@ func awsAwsjson11_serializeDocumentEndpointConfigurations(v []types.EndpointConf return nil } +func awsAwsjson11_serializeDocumentEndpointIdentifier(v *types.EndpointIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientIPPreservationEnabled != nil { + ok := object.Key("ClientIPPreservationEnabled") + ok.Boolean(*v.ClientIPPreservationEnabled) + } + + if v.EndpointId != nil { + ok := object.Key("EndpointId") + ok.String(*v.EndpointId) + } + + return nil +} + +func awsAwsjson11_serializeDocumentEndpointIdentifiers(v []types.EndpointIdentifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentEndpointIdentifier(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentEndpointIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2889,6 +3029,25 @@ func awsAwsjson11_serializeOpDocumentAddCustomRoutingEndpointsInput(v *AddCustom return nil } +func awsAwsjson11_serializeOpDocumentAddEndpointsInput(v *AddEndpointsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndpointConfigurations != nil { + ok := object.Key("EndpointConfigurations") + if err := awsAwsjson11_serializeDocumentEndpointConfigurations(v.EndpointConfigurations, ok); err != nil { + return err + } + } + + if v.EndpointGroupArn != nil { + ok := object.Key("EndpointGroupArn") + ok.String(*v.EndpointGroupArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentAdvertiseByoipCidrInput(v *AdvertiseByoipCidrInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3644,6 +3803,25 @@ func awsAwsjson11_serializeOpDocumentRemoveCustomRoutingEndpointsInput(v *Remove return nil } +func awsAwsjson11_serializeOpDocumentRemoveEndpointsInput(v *RemoveEndpointsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndpointGroupArn != nil { + ok := object.Key("EndpointGroupArn") + ok.String(*v.EndpointGroupArn) + } + + if v.EndpointIdentifiers != nil { + ok := object.Key("EndpointIdentifiers") + if err := awsAwsjson11_serializeDocumentEndpointIdentifiers(v.EndpointIdentifiers, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/globalaccelerator/types/errors.go b/service/globalaccelerator/types/errors.go index 71689d05a16..d9d0371ff30 100644 --- a/service/globalaccelerator/types/errors.go +++ b/service/globalaccelerator/types/errors.go @@ -364,3 +364,23 @@ func (e *ListenerNotFoundException) ErrorMessage() string { } func (e *ListenerNotFoundException) ErrorCode() string { return "ListenerNotFoundException" } func (e *ListenerNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// There's already a transaction in progress. Another transaction can't be +// processed. +type TransactionInProgressException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *TransactionInProgressException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TransactionInProgressException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TransactionInProgressException) ErrorCode() string { return "TransactionInProgressException" } +func (e *TransactionInProgressException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/globalaccelerator/types/types.go b/service/globalaccelerator/types/types.go index 74bc4a785b9..0e49fb404bd 100644 --- a/service/globalaccelerator/types/types.go +++ b/service/globalaccelerator/types/types.go @@ -25,8 +25,8 @@ type Accelerator struct { // a1234567890abcdef.awsglobalaccelerator.com. If you have a dual-stack // accelerator, you also have a second DNS name, DualStackDnsName, that points to // both the A record and the AAAA record for all four static addresses for the - // accelerator (two IPv4 addresses and two IPv6 addresses). For more information - // about the default DNS name, see Support for DNS Addressing in Global + // accelerator: two IPv4 addresses and two IPv6 addresses. For more information + // about the default DNS name, see Support for DNS addressing in Global // Accelerator // (https://docs.aws.amazon.com/global-accelerator/latest/dg/dns-addressing-custom-domains.dns-addressing.html) // in the Global Accelerator Developer Guide. @@ -40,7 +40,7 @@ type Accelerator struct { // a1234567890abcdef.dualstack.awsglobalaccelerator.com. Note: Global Accelerator // also assigns a default DNS name, DnsName, to your accelerator that points just // to the static IPv4 addresses. For more information, see Support for DNS - // Addressing in Global Accelerator + // addressing in Global Accelerator // (https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html#about-accelerators.dns-addressing) // in the Global Accelerator Developer Guide. DualStackDnsName *string @@ -234,8 +234,8 @@ type CustomRoutingAccelerator struct { // a1234567890abcdef.awsglobalaccelerator.com. If you have a dual-stack // accelerator, you also have a second DNS name, DualStackDnsName, that points to // both the A record and the AAAA record for all four static addresses for the - // accelerator (two IPv4 addresses and two IPv6 addresses). For more information - // about the default DNS name, see Support for DNS Addressing in Global + // accelerator: two IPv4 addresses and two IPv6 addresses. For more information + // about the default DNS name, see Support for DNS addressing in Global // Accelerator // (https://docs.aws.amazon.com/global-accelerator/latest/dg/dns-addressing-custom-domains.dns-addressing.html) // in the Global Accelerator Developer Guide. @@ -566,6 +566,28 @@ type EndpointGroup struct { noSmithyDocumentSerde } +// A complex type for an endpoint. Specifies information about the endpoint to +// remove from the endpoint group. +type EndpointIdentifier struct { + + // An ID for the endpoint. If the endpoint is a Network Load Balancer or + // Application Load Balancer, this is the Amazon Resource Name (ARN) of the + // resource. If the endpoint is an Elastic IP address, this is the Elastic IP + // address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID. An + // Application Load Balancer can be either internal or internet-facing. + // + // This member is required. + EndpointId *string + + // Indicates whether client IP address preservation is enabled for an endpoint. The + // value is true or false. If the value is set to true, the client's IP address is + // preserved in the X-Forwarded-For request header as traffic travels to + // applications on the endpoint fronted by the accelerator. + ClientIPPreservationEnabled *bool + + noSmithyDocumentSerde +} + // A complex type for the set of IP addresses for an accelerator. type IpSet struct { diff --git a/service/globalaccelerator/validators.go b/service/globalaccelerator/validators.go index 4675d403e56..a52d0b87dbe 100644 --- a/service/globalaccelerator/validators.go +++ b/service/globalaccelerator/validators.go @@ -30,6 +30,26 @@ func (m *validateOpAddCustomRoutingEndpoints) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpAddEndpoints struct { +} + +func (*validateOpAddEndpoints) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddEndpointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddEndpointsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpAdvertiseByoipCidr struct { } @@ -690,6 +710,26 @@ func (m *validateOpRemoveCustomRoutingEndpoints) HandleInitialize(ctx context.Co return next.HandleInitialize(ctx, in) } +type validateOpRemoveEndpoints struct { +} + +func (*validateOpRemoveEndpoints) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveEndpointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveEndpointsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -894,6 +934,10 @@ func addOpAddCustomRoutingEndpointsValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpAddCustomRoutingEndpoints{}, middleware.After) } +func addOpAddEndpointsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddEndpoints{}, middleware.After) +} + func addOpAdvertiseByoipCidrValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAdvertiseByoipCidr{}, middleware.After) } @@ -1026,6 +1070,10 @@ func addOpRemoveCustomRoutingEndpointsValidationMiddleware(stack *middleware.Sta return stack.Initialize.Add(&validateOpRemoveCustomRoutingEndpoints{}, middleware.After) } +func addOpRemoveEndpointsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveEndpoints{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -1122,6 +1170,38 @@ func validateCustomRoutingDestinationConfigurations(v []types.CustomRoutingDesti } } +func validateEndpointIdentifier(v *types.EndpointIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EndpointIdentifier"} + if v.EndpointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEndpointIdentifiers(v []types.EndpointIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EndpointIdentifiers"} + for i := range v { + if err := validateEndpointIdentifier(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -1175,6 +1255,24 @@ func validateOpAddCustomRoutingEndpointsInput(v *AddCustomRoutingEndpointsInput) } } +func validateOpAddEndpointsInput(v *AddEndpointsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddEndpointsInput"} + if v.EndpointConfigurations == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointConfigurations")) + } + if v.EndpointGroupArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointGroupArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAdvertiseByoipCidrInput(v *AdvertiseByoipCidrInput) error { if v == nil { return nil @@ -1739,6 +1837,28 @@ func validateOpRemoveCustomRoutingEndpointsInput(v *RemoveCustomRoutingEndpoints } } +func validateOpRemoveEndpointsInput(v *RemoveEndpointsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveEndpointsInput"} + if v.EndpointIdentifiers == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointIdentifiers")) + } else if v.EndpointIdentifiers != nil { + if err := validateEndpointIdentifiers(v.EndpointIdentifiers); err != nil { + invalidParams.AddNested("EndpointIdentifiers", err.(smithy.InvalidParamsError)) + } + } + if v.EndpointGroupArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointGroupArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/kms/internal/endpoints/endpoints.go b/service/kms/internal/endpoints/endpoints.go index 148d306fa0c..438c3e13fc9 100644 --- a/service/kms/internal/endpoints/endpoints.go +++ b/service/kms/internal/endpoints/endpoints.go @@ -135,6 +135,15 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ProdFips", + }: endpoints.Endpoint{ + Hostname: "kms-fips.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, @@ -333,6 +342,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "eu-central-2-fips", + }: endpoints.Endpoint{ + Hostname: "kms-fips.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/resiliencehub/api_op_ListAlarmRecommendations.go b/service/resiliencehub/api_op_ListAlarmRecommendations.go index 74199183f12..c06d675b4af 100644 --- a/service/resiliencehub/api_op_ListAlarmRecommendations.go +++ b/service/resiliencehub/api_op_ListAlarmRecommendations.go @@ -143,6 +143,11 @@ var _ ListAlarmRecommendationsAPIClient = (*Client)(nil) // ListAlarmRecommendationsPaginatorOptions is the paginator options for // ListAlarmRecommendations type ListAlarmRecommendationsPaginatorOptions 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 @@ -165,6 +170,9 @@ func NewListAlarmRecommendationsPaginator(client ListAlarmRecommendationsAPIClie } options := ListAlarmRecommendationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -193,6 +201,12 @@ func (p *ListAlarmRecommendationsPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListAlarmRecommendations(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListAppAssessments.go b/service/resiliencehub/api_op_ListAppAssessments.go index 626d43e00bc..e35df9753b9 100644 --- a/service/resiliencehub/api_op_ListAppAssessments.go +++ b/service/resiliencehub/api_op_ListAppAssessments.go @@ -155,6 +155,11 @@ var _ ListAppAssessmentsAPIClient = (*Client)(nil) // ListAppAssessmentsPaginatorOptions is the paginator options for // ListAppAssessments type ListAppAssessmentsPaginatorOptions 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 @@ -176,6 +181,9 @@ func NewListAppAssessmentsPaginator(client ListAppAssessmentsAPIClient, params * } options := ListAppAssessmentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -204,6 +212,12 @@ func (p *ListAppAssessmentsPaginator) NextPage(ctx context.Context, optFns ...fu params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListAppAssessments(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListAppComponentCompliances.go b/service/resiliencehub/api_op_ListAppComponentCompliances.go index d9ebd14fbd1..913d021fb3b 100644 --- a/service/resiliencehub/api_op_ListAppComponentCompliances.go +++ b/service/resiliencehub/api_op_ListAppComponentCompliances.go @@ -142,6 +142,11 @@ var _ ListAppComponentCompliancesAPIClient = (*Client)(nil) // ListAppComponentCompliancesPaginatorOptions is the paginator options for // ListAppComponentCompliances type ListAppComponentCompliancesPaginatorOptions 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 @@ -165,6 +170,9 @@ func NewListAppComponentCompliancesPaginator(client ListAppComponentCompliancesA } options := ListAppComponentCompliancesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -193,6 +201,12 @@ func (p *ListAppComponentCompliancesPaginator) NextPage(ctx context.Context, opt params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListAppComponentCompliances(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListAppComponentRecommendations.go b/service/resiliencehub/api_op_ListAppComponentRecommendations.go index 43b27c4ecc9..3e3f3030daa 100644 --- a/service/resiliencehub/api_op_ListAppComponentRecommendations.go +++ b/service/resiliencehub/api_op_ListAppComponentRecommendations.go @@ -142,6 +142,11 @@ var _ ListAppComponentRecommendationsAPIClient = (*Client)(nil) // ListAppComponentRecommendationsPaginatorOptions is the paginator options for // ListAppComponentRecommendations type ListAppComponentRecommendationsPaginatorOptions 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 @@ -165,6 +170,9 @@ func NewListAppComponentRecommendationsPaginator(client ListAppComponentRecommen } options := ListAppComponentRecommendationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -193,6 +201,12 @@ func (p *ListAppComponentRecommendationsPaginator) NextPage(ctx context.Context, params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListAppComponentRecommendations(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListAppVersionResourceMappings.go b/service/resiliencehub/api_op_ListAppVersionResourceMappings.go index 9cb6726ad28..489d662f0b2 100644 --- a/service/resiliencehub/api_op_ListAppVersionResourceMappings.go +++ b/service/resiliencehub/api_op_ListAppVersionResourceMappings.go @@ -151,6 +151,11 @@ var _ ListAppVersionResourceMappingsAPIClient = (*Client)(nil) // ListAppVersionResourceMappingsPaginatorOptions is the paginator options for // ListAppVersionResourceMappings type ListAppVersionResourceMappingsPaginatorOptions 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 @@ -174,6 +179,9 @@ func NewListAppVersionResourceMappingsPaginator(client ListAppVersionResourceMap } options := ListAppVersionResourceMappingsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -202,6 +210,12 @@ func (p *ListAppVersionResourceMappingsPaginator) NextPage(ctx context.Context, params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListAppVersionResourceMappings(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListAppVersionResources.go b/service/resiliencehub/api_op_ListAppVersionResources.go index 2c34f127ff5..8a7099ce2af 100644 --- a/service/resiliencehub/api_op_ListAppVersionResources.go +++ b/service/resiliencehub/api_op_ListAppVersionResources.go @@ -153,6 +153,11 @@ var _ ListAppVersionResourcesAPIClient = (*Client)(nil) // ListAppVersionResourcesPaginatorOptions is the paginator options for // ListAppVersionResources type ListAppVersionResourcesPaginatorOptions 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 @@ -175,6 +180,9 @@ func NewListAppVersionResourcesPaginator(client ListAppVersionResourcesAPIClient } options := ListAppVersionResourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -203,6 +211,12 @@ func (p *ListAppVersionResourcesPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListAppVersionResources(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListAppVersions.go b/service/resiliencehub/api_op_ListAppVersions.go index 616f708570e..b7e1f808872 100644 --- a/service/resiliencehub/api_op_ListAppVersions.go +++ b/service/resiliencehub/api_op_ListAppVersions.go @@ -139,6 +139,11 @@ var _ ListAppVersionsAPIClient = (*Client)(nil) // ListAppVersionsPaginatorOptions is the paginator options for ListAppVersions type ListAppVersionsPaginatorOptions 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 @@ -160,6 +165,9 @@ func NewListAppVersionsPaginator(client ListAppVersionsAPIClient, params *ListAp } options := ListAppVersionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -188,6 +196,12 @@ func (p *ListAppVersionsPaginator) NextPage(ctx context.Context, optFns ...func( params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListAppVersions(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListApps.go b/service/resiliencehub/api_op_ListApps.go index ccd6b0e0509..c8d453aa167 100644 --- a/service/resiliencehub/api_op_ListApps.go +++ b/service/resiliencehub/api_op_ListApps.go @@ -136,6 +136,11 @@ var _ ListAppsAPIClient = (*Client)(nil) // ListAppsPaginatorOptions is the paginator options for ListApps type ListAppsPaginatorOptions 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 @@ -157,6 +162,9 @@ func NewListAppsPaginator(client ListAppsAPIClient, params *ListAppsInput, optFn } options := ListAppsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -185,6 +193,12 @@ func (p *ListAppsPaginator) NextPage(ctx context.Context, optFns ...func(*Option params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListApps(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListRecommendationTemplates.go b/service/resiliencehub/api_op_ListRecommendationTemplates.go index 3b3497f8c76..93676bbb9f1 100644 --- a/service/resiliencehub/api_op_ListRecommendationTemplates.go +++ b/service/resiliencehub/api_op_ListRecommendationTemplates.go @@ -151,6 +151,11 @@ var _ ListRecommendationTemplatesAPIClient = (*Client)(nil) // ListRecommendationTemplatesPaginatorOptions is the paginator options for // ListRecommendationTemplates type ListRecommendationTemplatesPaginatorOptions 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 @@ -174,6 +179,9 @@ func NewListRecommendationTemplatesPaginator(client ListRecommendationTemplatesA } options := ListRecommendationTemplatesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -202,6 +210,12 @@ func (p *ListRecommendationTemplatesPaginator) NextPage(ctx context.Context, opt params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListRecommendationTemplates(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListResiliencyPolicies.go b/service/resiliencehub/api_op_ListResiliencyPolicies.go index 7353eb7bb76..a55be8d7c07 100644 --- a/service/resiliencehub/api_op_ListResiliencyPolicies.go +++ b/service/resiliencehub/api_op_ListResiliencyPolicies.go @@ -131,6 +131,11 @@ var _ ListResiliencyPoliciesAPIClient = (*Client)(nil) // ListResiliencyPoliciesPaginatorOptions is the paginator options for // ListResiliencyPolicies type ListResiliencyPoliciesPaginatorOptions 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 @@ -152,6 +157,9 @@ func NewListResiliencyPoliciesPaginator(client ListResiliencyPoliciesAPIClient, } options := ListResiliencyPoliciesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -180,6 +188,12 @@ func (p *ListResiliencyPoliciesPaginator) NextPage(ctx context.Context, optFns . params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListResiliencyPolicies(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListSopRecommendations.go b/service/resiliencehub/api_op_ListSopRecommendations.go index e5c33a6597e..8fadb93c64b 100644 --- a/service/resiliencehub/api_op_ListSopRecommendations.go +++ b/service/resiliencehub/api_op_ListSopRecommendations.go @@ -142,6 +142,11 @@ var _ ListSopRecommendationsAPIClient = (*Client)(nil) // ListSopRecommendationsPaginatorOptions is the paginator options for // ListSopRecommendations type ListSopRecommendationsPaginatorOptions 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 @@ -163,6 +168,9 @@ func NewListSopRecommendationsPaginator(client ListSopRecommendationsAPIClient, } options := ListSopRecommendationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -191,6 +199,12 @@ func (p *ListSopRecommendationsPaginator) NextPage(ctx context.Context, optFns . params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListSopRecommendations(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go b/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go index 2eca2f8b949..e3b3e268860 100644 --- a/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go +++ b/service/resiliencehub/api_op_ListSuggestedResiliencyPolicies.go @@ -128,6 +128,11 @@ var _ ListSuggestedResiliencyPoliciesAPIClient = (*Client)(nil) // ListSuggestedResiliencyPoliciesPaginatorOptions is the paginator options for // ListSuggestedResiliencyPolicies type ListSuggestedResiliencyPoliciesPaginatorOptions 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 @@ -151,6 +156,9 @@ func NewListSuggestedResiliencyPoliciesPaginator(client ListSuggestedResiliencyP } options := ListSuggestedResiliencyPoliciesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -179,6 +187,12 @@ func (p *ListSuggestedResiliencyPoliciesPaginator) NextPage(ctx context.Context, params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListSuggestedResiliencyPolicies(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListTestRecommendations.go b/service/resiliencehub/api_op_ListTestRecommendations.go index 1647dcbd2a3..f1fea99d088 100644 --- a/service/resiliencehub/api_op_ListTestRecommendations.go +++ b/service/resiliencehub/api_op_ListTestRecommendations.go @@ -140,6 +140,11 @@ var _ ListTestRecommendationsAPIClient = (*Client)(nil) // ListTestRecommendationsPaginatorOptions is the paginator options for // ListTestRecommendations type ListTestRecommendationsPaginatorOptions 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 @@ -162,6 +167,9 @@ func NewListTestRecommendationsPaginator(client ListTestRecommendationsAPIClient } options := ListTestRecommendationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -190,6 +198,12 @@ func (p *ListTestRecommendationsPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListTestRecommendations(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go b/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go index b584d8e72ae..b42cc0bfddb 100644 --- a/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go +++ b/service/resiliencehub/api_op_ListUnsupportedAppVersionResources.go @@ -155,6 +155,11 @@ var _ ListUnsupportedAppVersionResourcesAPIClient = (*Client)(nil) // ListUnsupportedAppVersionResourcesPaginatorOptions is the paginator options for // ListUnsupportedAppVersionResources type ListUnsupportedAppVersionResourcesPaginatorOptions 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 @@ -178,6 +183,9 @@ func NewListUnsupportedAppVersionResourcesPaginator(client ListUnsupportedAppVer } options := ListUnsupportedAppVersionResourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } for _, fn := range optFns { fn(&options) @@ -206,6 +214,12 @@ func (p *ListUnsupportedAppVersionResourcesPaginator) NextPage(ctx context.Conte params := *p.params params.NextToken = p.nextToken + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + result, err := p.client.ListUnsupportedAppVersionResources(ctx, ¶ms, optFns...) if err != nil { return nil, err diff --git a/service/resiliencehub/api_op_UpdateResiliencyPolicy.go b/service/resiliencehub/api_op_UpdateResiliencyPolicy.go index 79734891b26..1bfc75d0429 100644 --- a/service/resiliencehub/api_op_UpdateResiliencyPolicy.go +++ b/service/resiliencehub/api_op_UpdateResiliencyPolicy.go @@ -43,9 +43,7 @@ type UpdateResiliencyPolicyInput struct { DataLocationConstraint types.DataLocationConstraint // The type of resiliency policy to be created, including the recovery time - // objective (RTO) and recovery point objective (RPO) in seconds. If you do not - // want to specify regional targets for a regional policy, you must set the values - // of rpoInSecs and rtoInSecs to -1. + // objective (RTO) and recovery point objective (RPO) in seconds. Policy map[string]types.FailurePolicy // The description for the policy. diff --git a/service/resiliencehub/deserializers.go b/service/resiliencehub/deserializers.go index 858a4fc1e7c..9d6a65bb64c 100644 --- a/service/resiliencehub/deserializers.go +++ b/service/resiliencehub/deserializers.go @@ -7839,6 +7839,15 @@ func awsRestjson1_deserializeDocumentAppSummary(v **types.AppSummary, value inte } } + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppStatusType to be of type string, got %T instead", value) + } + sv.Status = types.AppStatusType(jtv) + } + default: _, _ = key, value diff --git a/service/resiliencehub/types/enums.go b/service/resiliencehub/types/enums.go index fab221fc9aa..aff0945833a 100644 --- a/service/resiliencehub/types/enums.go +++ b/service/resiliencehub/types/enums.go @@ -146,11 +146,12 @@ type ConfigRecommendationOptimizationType string // Enum values for ConfigRecommendationOptimizationType const ( - ConfigRecommendationOptimizationTypeLeastCost ConfigRecommendationOptimizationType = "LeastCost" - ConfigRecommendationOptimizationTypeLeastChange ConfigRecommendationOptimizationType = "LeastChange" - ConfigRecommendationOptimizationTypeBestAzRecovery ConfigRecommendationOptimizationType = "BestAZRecovery" - ConfigRecommendationOptimizationTypeLeastErrors ConfigRecommendationOptimizationType = "LeastErrors" - ConfigRecommendationOptimizationTypeBestAttainable ConfigRecommendationOptimizationType = "BestAttainable" + ConfigRecommendationOptimizationTypeLeastCost ConfigRecommendationOptimizationType = "LeastCost" + ConfigRecommendationOptimizationTypeLeastChange ConfigRecommendationOptimizationType = "LeastChange" + ConfigRecommendationOptimizationTypeBestAzRecovery ConfigRecommendationOptimizationType = "BestAZRecovery" + ConfigRecommendationOptimizationTypeLeastErrors ConfigRecommendationOptimizationType = "LeastErrors" + ConfigRecommendationOptimizationTypeBestAttainable ConfigRecommendationOptimizationType = "BestAttainable" + ConfigRecommendationOptimizationTypeBestRegionRecovery ConfigRecommendationOptimizationType = "BestRegionRecovery" ) // Values returns all known values for ConfigRecommendationOptimizationType. Note @@ -164,6 +165,7 @@ func (ConfigRecommendationOptimizationType) Values() []ConfigRecommendationOptim "BestAZRecovery", "LeastErrors", "BestAttainable", + "BestRegionRecovery", } } diff --git a/service/resiliencehub/types/types.go b/service/resiliencehub/types/types.go index 01920ace0d2..204fc1fe2d9 100644 --- a/service/resiliencehub/types/types.go +++ b/service/resiliencehub/types/types.go @@ -92,7 +92,7 @@ type App struct { // The current resiliency score for the application. ResiliencyScore float64 - // The status of the action. + // The status of the application. Status AppStatusType // The tags assigned to the resource. A tag is a label that you assign to an Amazon @@ -301,6 +301,9 @@ type AppSummary struct { // The current resiliency score for the application. ResiliencyScore float64 + // The status of the application. + Status AppStatusType + noSmithyDocumentSerde } diff --git a/service/rum/api_op_BatchCreateRumMetricDefinitions.go b/service/rum/api_op_BatchCreateRumMetricDefinitions.go new file mode 100644 index 00000000000..6e141600c36 --- /dev/null +++ b/service/rum/api_op_BatchCreateRumMetricDefinitions.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rum/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the extended metrics that you want a CloudWatch RUM app monitor to +// send to a destination. Valid destinations include CloudWatch and Evidently. By +// default, RUM app monitors send some metrics to CloudWatch. These default metrics +// are listed in CloudWatch metrics that you can collect with CloudWatch RUM +// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-metrics.html). +// If you also send extended metrics, you can send metrics to Evidently as well as +// CloudWatch, and you can also optionally send the metrics with additional +// dimensions. The valid dimension names for the additional dimensions are +// BrowserName, CountryCode, DeviceType, FileType, OSName, and PageId. For more +// information, see Extended metrics that you can send to CloudWatch and +// CloudWatch Evidently +// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-vended-metrics.html). +// The maximum number of metric definitions that you can specify in one +// BatchCreateRumMetricDefinitions operation is 200. The maximum number of metric +// definitions that one destination can contain is 2000. Extended metrics sent are +// charged as CloudWatch custom metrics. Each combination of additional dimension +// name and dimension value counts as a custom metric. For more information, see +// Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/). You must +// have already created a destination for the metrics before you send them. For +// more information, see PutRumMetricsDestination +// (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_PutRumMetricsDestination.html). +// If some metric definitions specified in a BatchCreateRumMetricDefinitions +// operations are not valid, those metric definitions fail and return errors, but +// all valid metric definitions in the same operation still succeed. +func (c *Client) BatchCreateRumMetricDefinitions(ctx context.Context, params *BatchCreateRumMetricDefinitionsInput, optFns ...func(*Options)) (*BatchCreateRumMetricDefinitionsOutput, error) { + if params == nil { + params = &BatchCreateRumMetricDefinitionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchCreateRumMetricDefinitions", params, optFns, c.addOperationBatchCreateRumMetricDefinitionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchCreateRumMetricDefinitionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchCreateRumMetricDefinitionsInput struct { + + // The name of the CloudWatch RUM app monitor that is to send the metrics. + // + // This member is required. + AppMonitorName *string + + // The destination to send the metrics to. Valid values are CloudWatch and + // Evidently. If you specify Evidently, you must also specify the ARN of the + // CloudWatchEvidently experiment that will receive the metrics and an IAM role + // that has permission to write to the experiment. + // + // This member is required. + Destination types.MetricDestination + + // An array of structures which define the metrics that you want to send. + // + // This member is required. + MetricDefinitions []types.MetricDefinitionRequest + + // This parameter is required if Destination is Evidently. If Destination is + // CloudWatch, do not use this parameter. This parameter specifies the ARN of the + // Evidently experiment that is to receive the metrics. You must have already + // defined this experiment as a valid destination. For more information, see + // PutRumMetricsDestination + // (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_PutRumMetricsDestination.html). + DestinationArn *string + + noSmithyDocumentSerde +} + +type BatchCreateRumMetricDefinitionsOutput struct { + + // An array of error objects, if the operation caused any errors. + // + // This member is required. + Errors []types.BatchCreateRumMetricDefinitionsError + + // An array of structures that define the extended metrics. + MetricDefinitions []types.MetricDefinition + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchCreateRumMetricDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchCreateRumMetricDefinitions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchCreateRumMetricDefinitions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchCreateRumMetricDefinitionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchCreateRumMetricDefinitions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchCreateRumMetricDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rum", + OperationName: "BatchCreateRumMetricDefinitions", + } +} diff --git a/service/rum/api_op_BatchDeleteRumMetricDefinitions.go b/service/rum/api_op_BatchDeleteRumMetricDefinitions.go new file mode 100644 index 00000000000..b5f8e41afe0 --- /dev/null +++ b/service/rum/api_op_BatchDeleteRumMetricDefinitions.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rum/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the specified metrics from being sent to an extended metrics +// destination. If some metric definition IDs specified in a +// BatchDeleteRumMetricDefinitions operations are not valid, those metric +// definitions fail and return errors, but all valid metric definition IDs in the +// same operation are still deleted. The maximum number of metric definitions that +// you can specify in one BatchDeleteRumMetricDefinitions operation is 200. +func (c *Client) BatchDeleteRumMetricDefinitions(ctx context.Context, params *BatchDeleteRumMetricDefinitionsInput, optFns ...func(*Options)) (*BatchDeleteRumMetricDefinitionsOutput, error) { + if params == nil { + params = &BatchDeleteRumMetricDefinitionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDeleteRumMetricDefinitions", params, optFns, c.addOperationBatchDeleteRumMetricDefinitionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDeleteRumMetricDefinitionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDeleteRumMetricDefinitionsInput struct { + + // The name of the CloudWatch RUM app monitor that is sending these metrics. + // + // This member is required. + AppMonitorName *string + + // Defines the destination where you want to stop sending the specified metrics. + // Valid values are CloudWatch and Evidently. If you specify Evidently, you must + // also specify the ARN of the CloudWatchEvidently experiment that is to be the + // destination and an IAM role that has permission to write to the experiment. + // + // This member is required. + Destination types.MetricDestination + + // An array of structures which define the metrics that you want to stop sending. + // + // This member is required. + MetricDefinitionIds []string + + // This parameter is required if Destination is Evidently. If Destination is + // CloudWatch, do not use this parameter. This parameter specifies the ARN of the + // Evidently experiment that was receiving the metrics that are being deleted. + DestinationArn *string + + noSmithyDocumentSerde +} + +type BatchDeleteRumMetricDefinitionsOutput struct { + + // An array of error objects, if the operation caused any errors. + // + // This member is required. + Errors []types.BatchDeleteRumMetricDefinitionsError + + // The IDs of the metric definitions that were deleted. + MetricDefinitionIds []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDeleteRumMetricDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchDeleteRumMetricDefinitions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchDeleteRumMetricDefinitions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchDeleteRumMetricDefinitionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteRumMetricDefinitions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchDeleteRumMetricDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rum", + OperationName: "BatchDeleteRumMetricDefinitions", + } +} diff --git a/service/rum/api_op_BatchGetRumMetricDefinitions.go b/service/rum/api_op_BatchGetRumMetricDefinitions.go new file mode 100644 index 00000000000..6ec7b83009b --- /dev/null +++ b/service/rum/api_op_BatchGetRumMetricDefinitions.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rum/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the list of metrics and dimensions that a RUM app monitor is sending +// to a single destination. +func (c *Client) BatchGetRumMetricDefinitions(ctx context.Context, params *BatchGetRumMetricDefinitionsInput, optFns ...func(*Options)) (*BatchGetRumMetricDefinitionsOutput, error) { + if params == nil { + params = &BatchGetRumMetricDefinitionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetRumMetricDefinitions", params, optFns, c.addOperationBatchGetRumMetricDefinitionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetRumMetricDefinitionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetRumMetricDefinitionsInput struct { + + // The name of the CloudWatch RUM app monitor that is sending the metrics. + // + // This member is required. + AppMonitorName *string + + // The type of destination that you want to view metrics for. Valid values are + // CloudWatch and Evidently. + // + // This member is required. + Destination types.MetricDestination + + // This parameter is required if Destination is Evidently. If Destination is + // CloudWatch, do not use this parameter. This parameter specifies the ARN of the + // Evidently experiment that corresponds to the destination. + DestinationArn *string + + // The maximum number of results to return in one operation. The default is 50. The + // maximum that you can specify is 100. To retrieve the remaining results, make + // another call with the returned NextToken value. + MaxResults *int32 + + // Use the token returned by the previous operation to request the next page of + // results. + NextToken *string + + noSmithyDocumentSerde +} + +type BatchGetRumMetricDefinitionsOutput struct { + + // An array of structures that display information about the metrics that are sent + // by the specified app monitor to the specified destination. + MetricDefinitions []types.MetricDefinition + + // A token that you can use in a subsequent operation to retrieve the next set of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetRumMetricDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetRumMetricDefinitions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetRumMetricDefinitions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchGetRumMetricDefinitionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetRumMetricDefinitions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// BatchGetRumMetricDefinitionsAPIClient is a client that implements the +// BatchGetRumMetricDefinitions operation. +type BatchGetRumMetricDefinitionsAPIClient interface { + BatchGetRumMetricDefinitions(context.Context, *BatchGetRumMetricDefinitionsInput, ...func(*Options)) (*BatchGetRumMetricDefinitionsOutput, error) +} + +var _ BatchGetRumMetricDefinitionsAPIClient = (*Client)(nil) + +// BatchGetRumMetricDefinitionsPaginatorOptions is the paginator options for +// BatchGetRumMetricDefinitions +type BatchGetRumMetricDefinitionsPaginatorOptions struct { + // The maximum number of results to return in one operation. The default is 50. The + // maximum that you can specify is 100. To retrieve the remaining results, make + // another call with the returned NextToken value. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// BatchGetRumMetricDefinitionsPaginator is a paginator for +// BatchGetRumMetricDefinitions +type BatchGetRumMetricDefinitionsPaginator struct { + options BatchGetRumMetricDefinitionsPaginatorOptions + client BatchGetRumMetricDefinitionsAPIClient + params *BatchGetRumMetricDefinitionsInput + nextToken *string + firstPage bool +} + +// NewBatchGetRumMetricDefinitionsPaginator returns a new +// BatchGetRumMetricDefinitionsPaginator +func NewBatchGetRumMetricDefinitionsPaginator(client BatchGetRumMetricDefinitionsAPIClient, params *BatchGetRumMetricDefinitionsInput, optFns ...func(*BatchGetRumMetricDefinitionsPaginatorOptions)) *BatchGetRumMetricDefinitionsPaginator { + if params == nil { + params = &BatchGetRumMetricDefinitionsInput{} + } + + options := BatchGetRumMetricDefinitionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &BatchGetRumMetricDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *BatchGetRumMetricDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next BatchGetRumMetricDefinitions page. +func (p *BatchGetRumMetricDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*BatchGetRumMetricDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.BatchGetRumMetricDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opBatchGetRumMetricDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rum", + OperationName: "BatchGetRumMetricDefinitions", + } +} diff --git a/service/rum/api_op_DeleteRumMetricsDestination.go b/service/rum/api_op_DeleteRumMetricsDestination.go new file mode 100644 index 00000000000..652466c0546 --- /dev/null +++ b/service/rum/api_op_DeleteRumMetricsDestination.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rum/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a destination for CloudWatch RUM extended metrics, so that the specified +// app monitor stops sending extended metrics to that destination. +func (c *Client) DeleteRumMetricsDestination(ctx context.Context, params *DeleteRumMetricsDestinationInput, optFns ...func(*Options)) (*DeleteRumMetricsDestinationOutput, error) { + if params == nil { + params = &DeleteRumMetricsDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRumMetricsDestination", params, optFns, c.addOperationDeleteRumMetricsDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRumMetricsDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRumMetricsDestinationInput struct { + + // The name of the app monitor that is sending metrics to the destination that you + // want to delete. + // + // This member is required. + AppMonitorName *string + + // The type of destination to delete. Valid values are CloudWatch and Evidently. + // + // This member is required. + Destination types.MetricDestination + + // This parameter is required if Destination is Evidently. If Destination is + // CloudWatch, do not use this parameter. This parameter specifies the ARN of the + // Evidently experiment that corresponds to the destination to delete. + DestinationArn *string + + noSmithyDocumentSerde +} + +type DeleteRumMetricsDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRumMetricsDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRumMetricsDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRumMetricsDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteRumMetricsDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRumMetricsDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRumMetricsDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rum", + OperationName: "DeleteRumMetricsDestination", + } +} diff --git a/service/rum/api_op_ListAppMonitors.go b/service/rum/api_op_ListAppMonitors.go index b29d51a3850..8bcd9fbe02e 100644 --- a/service/rum/api_op_ListAppMonitors.go +++ b/service/rum/api_op_ListAppMonitors.go @@ -30,7 +30,8 @@ func (c *Client) ListAppMonitors(ctx context.Context, params *ListAppMonitorsInp type ListAppMonitorsInput struct { - // The maximum number of results to return in one operation. + // The maximum number of results to return in one operation. The default is 50. The + // maximum that you can specify is 100. MaxResults *int32 // Use the token returned by the previous operation to request the next page of @@ -125,7 +126,8 @@ var _ ListAppMonitorsAPIClient = (*Client)(nil) // ListAppMonitorsPaginatorOptions is the paginator options for ListAppMonitors type ListAppMonitorsPaginatorOptions struct { - // The maximum number of results to return in one operation. + // The maximum number of results to return in one operation. The default is 50. The + // maximum that you can specify is 100. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/rum/api_op_ListRumMetricsDestinations.go b/service/rum/api_op_ListRumMetricsDestinations.go new file mode 100644 index 00000000000..8615b71bba9 --- /dev/null +++ b/service/rum/api_op_ListRumMetricsDestinations.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rum/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of destinations that you have created to receive RUM extended +// metrics, for the specified app monitor. For more information about extended +// metrics, see AddRumMetrics +// (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_AddRumMetrcs.html). +func (c *Client) ListRumMetricsDestinations(ctx context.Context, params *ListRumMetricsDestinationsInput, optFns ...func(*Options)) (*ListRumMetricsDestinationsOutput, error) { + if params == nil { + params = &ListRumMetricsDestinationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRumMetricsDestinations", params, optFns, c.addOperationListRumMetricsDestinationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRumMetricsDestinationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRumMetricsDestinationsInput struct { + + // The name of the app monitor associated with the destinations that you want to + // retrieve. + // + // This member is required. + AppMonitorName *string + + // The maximum number of results to return in one operation. The default is 50. The + // maximum that you can specify is 100. To retrieve the remaining results, make + // another call with the returned NextToken value. + MaxResults *int32 + + // Use the token returned by the previous operation to request the next page of + // results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListRumMetricsDestinationsOutput struct { + + // The list of CloudWatch RUM extended metrics destinations associated with the app + // monitor that you specified. + Destinations []types.MetricDestinationSummary + + // A token that you can use in a subsequent operation to retrieve the next set of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRumMetricsDestinationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRumMetricsDestinations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRumMetricsDestinations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListRumMetricsDestinationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRumMetricsDestinations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListRumMetricsDestinationsAPIClient is a client that implements the +// ListRumMetricsDestinations operation. +type ListRumMetricsDestinationsAPIClient interface { + ListRumMetricsDestinations(context.Context, *ListRumMetricsDestinationsInput, ...func(*Options)) (*ListRumMetricsDestinationsOutput, error) +} + +var _ ListRumMetricsDestinationsAPIClient = (*Client)(nil) + +// ListRumMetricsDestinationsPaginatorOptions is the paginator options for +// ListRumMetricsDestinations +type ListRumMetricsDestinationsPaginatorOptions struct { + // The maximum number of results to return in one operation. The default is 50. The + // maximum that you can specify is 100. To retrieve the remaining results, make + // another call with the returned NextToken value. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListRumMetricsDestinationsPaginator is a paginator for +// ListRumMetricsDestinations +type ListRumMetricsDestinationsPaginator struct { + options ListRumMetricsDestinationsPaginatorOptions + client ListRumMetricsDestinationsAPIClient + params *ListRumMetricsDestinationsInput + nextToken *string + firstPage bool +} + +// NewListRumMetricsDestinationsPaginator returns a new +// ListRumMetricsDestinationsPaginator +func NewListRumMetricsDestinationsPaginator(client ListRumMetricsDestinationsAPIClient, params *ListRumMetricsDestinationsInput, optFns ...func(*ListRumMetricsDestinationsPaginatorOptions)) *ListRumMetricsDestinationsPaginator { + if params == nil { + params = &ListRumMetricsDestinationsInput{} + } + + options := ListRumMetricsDestinationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRumMetricsDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRumMetricsDestinationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRumMetricsDestinations page. +func (p *ListRumMetricsDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRumMetricsDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListRumMetricsDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListRumMetricsDestinations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rum", + OperationName: "ListRumMetricsDestinations", + } +} diff --git a/service/rum/api_op_PutRumMetricsDestination.go b/service/rum/api_op_PutRumMetricsDestination.go new file mode 100644 index 00000000000..2371c7c580d --- /dev/null +++ b/service/rum/api_op_PutRumMetricsDestination.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rum/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a destination to receive extended metrics from CloudWatch +// RUM. You can send extended metrics to CloudWatch or to a CloudWatch Evidently +// experiment. For more information about extended metrics, see AddRumMetrics +// (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_AddRumMetrics.html). +func (c *Client) PutRumMetricsDestination(ctx context.Context, params *PutRumMetricsDestinationInput, optFns ...func(*Options)) (*PutRumMetricsDestinationOutput, error) { + if params == nil { + params = &PutRumMetricsDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutRumMetricsDestination", params, optFns, c.addOperationPutRumMetricsDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutRumMetricsDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutRumMetricsDestinationInput struct { + + // The name of the CloudWatch RUM app monitor that will send the metrics. + // + // This member is required. + AppMonitorName *string + + // Defines the destination to send the metrics to. Valid values are CloudWatch and + // Evidently. If you specify Evidently, you must also specify the ARN of the + // CloudWatchEvidently experiment that is to be the destination and an IAM role + // that has permission to write to the experiment. + // + // This member is required. + Destination types.MetricDestination + + // Use this parameter only if Destination is Evidently. This parameter specifies + // the ARN of the Evidently experiment that will receive the extended metrics. + DestinationArn *string + + // This parameter is required if Destination is Evidently. If Destination is + // CloudWatch, do not use this parameter. This parameter specifies the ARN of an + // IAM role that RUM will assume to write to the Evidently experiment that you are + // sending metrics to. This role must have permission to write to that experiment. + IamRoleArn *string + + noSmithyDocumentSerde +} + +type PutRumMetricsDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutRumMetricsDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutRumMetricsDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutRumMetricsDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutRumMetricsDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRumMetricsDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutRumMetricsDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rum", + OperationName: "PutRumMetricsDestination", + } +} diff --git a/service/rum/api_op_UpdateRumMetricDefinition.go b/service/rum/api_op_UpdateRumMetricDefinition.go new file mode 100644 index 00000000000..11a86b1ec08 --- /dev/null +++ b/service/rum/api_op_UpdateRumMetricDefinition.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rum/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies one existing metric definition for CloudWatch RUM extended metrics. For +// more information about extended metrics, see BatchCreateRumMetricsDefinitions +// (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_BatchCreateRumMetricsDefinitions.html). +func (c *Client) UpdateRumMetricDefinition(ctx context.Context, params *UpdateRumMetricDefinitionInput, optFns ...func(*Options)) (*UpdateRumMetricDefinitionOutput, error) { + if params == nil { + params = &UpdateRumMetricDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRumMetricDefinition", params, optFns, c.addOperationUpdateRumMetricDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRumMetricDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRumMetricDefinitionInput struct { + + // The name of the CloudWatch RUM app monitor that sends these metrics. + // + // This member is required. + AppMonitorName *string + + // The destination to send the metrics to. Valid values are CloudWatch and + // Evidently. If you specify Evidently, you must also specify the ARN of the + // CloudWatchEvidently experiment that will receive the metrics and an IAM role + // that has permission to write to the experiment. + // + // This member is required. + Destination types.MetricDestination + + // A structure that contains the new definition that you want to use for this + // metric. + // + // This member is required. + MetricDefinition *types.MetricDefinitionRequest + + // The ID of the metric definition to update. + // + // This member is required. + MetricDefinitionId *string + + // This parameter is required if Destination is Evidently. If Destination is + // CloudWatch, do not use this parameter. This parameter specifies the ARN of the + // Evidently experiment that is to receive the metrics. You must have already + // defined this experiment as a valid destination. For more information, see + // PutRumMetricsDestination + // (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_PutRumMetricsDestination.html). + DestinationArn *string + + noSmithyDocumentSerde +} + +type UpdateRumMetricDefinitionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRumMetricDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRumMetricDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRumMetricDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRumMetricDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRumMetricDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRumMetricDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rum", + OperationName: "UpdateRumMetricDefinition", + } +} diff --git a/service/rum/deserializers.go b/service/rum/deserializers.go index 011f8000d76..785e96b8796 100644 --- a/service/rum/deserializers.go +++ b/service/rum/deserializers.go @@ -20,14 +20,14 @@ import ( "strings" ) -type awsRestjson1_deserializeOpCreateAppMonitor struct { +type awsRestjson1_deserializeOpBatchCreateRumMetricDefinitions struct { } -func (*awsRestjson1_deserializeOpCreateAppMonitor) ID() string { +func (*awsRestjson1_deserializeOpBatchCreateRumMetricDefinitions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchCreateRumMetricDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -41,9 +41,9 @@ func (m *awsRestjson1_deserializeOpCreateAppMonitor) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAppMonitor(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchCreateRumMetricDefinitions(response, &metadata) } - output := &CreateAppMonitorOutput{} + output := &BatchCreateRumMetricDefinitionsOutput{} out.Result = output var buff [1024]byte @@ -64,7 +64,7 @@ func (m *awsRestjson1_deserializeOpCreateAppMonitor) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateAppMonitorOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchCreateRumMetricDefinitionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -77,7 +77,7 @@ func (m *awsRestjson1_deserializeOpCreateAppMonitor) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchCreateRumMetricDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -127,6 +127,9 @@ func awsRestjson1_deserializeOpErrorCreateAppMonitor(response *smithyhttp.Respon 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) @@ -146,7 +149,7 @@ func awsRestjson1_deserializeOpErrorCreateAppMonitor(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentCreateAppMonitorOutput(v **CreateAppMonitorOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchCreateRumMetricDefinitionsOutput(v **BatchCreateRumMetricDefinitionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -159,22 +162,23 @@ func awsRestjson1_deserializeOpDocumentCreateAppMonitorOutput(v **CreateAppMonit return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateAppMonitorOutput + var sv *BatchCreateRumMetricDefinitionsOutput if *v == nil { - sv = &CreateAppMonitorOutput{} + sv = &BatchCreateRumMetricDefinitionsOutput{} } 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 AppMonitorId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) + case "Errors": + if err := awsRestjson1_deserializeDocumentBatchCreateRumMetricDefinitionsErrors(&sv.Errors, value); err != nil { + return err + } + + case "MetricDefinitions": + if err := awsRestjson1_deserializeDocumentMetricDefinitions(&sv.MetricDefinitions, value); err != nil { + return err } default: @@ -186,112 +190,14 @@ func awsRestjson1_deserializeOpDocumentCreateAppMonitorOutput(v **CreateAppMonit return nil } -type awsRestjson1_deserializeOpDeleteAppMonitor struct { -} - -func (*awsRestjson1_deserializeOpDeleteAppMonitor) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAppMonitor(response, &metadata) - } - output := &DeleteAppMonitorOutput{} - out.Result = output - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpGetAppMonitor struct { +type awsRestjson1_deserializeOpBatchDeleteRumMetricDefinitions struct { } -func (*awsRestjson1_deserializeOpGetAppMonitor) ID() string { +func (*awsRestjson1_deserializeOpBatchDeleteRumMetricDefinitions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchDeleteRumMetricDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -305,9 +211,9 @@ func (m *awsRestjson1_deserializeOpGetAppMonitor) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAppMonitor(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchDeleteRumMetricDefinitions(response, &metadata) } - output := &GetAppMonitorOutput{} + output := &BatchDeleteRumMetricDefinitionsOutput{} out.Result = output var buff [1024]byte @@ -328,7 +234,7 @@ func (m *awsRestjson1_deserializeOpGetAppMonitor) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAppMonitorOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchDeleteRumMetricDefinitionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -341,7 +247,7 @@ func (m *awsRestjson1_deserializeOpGetAppMonitor) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchDeleteRumMetricDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -385,6 +291,9 @@ func awsRestjson1_deserializeOpErrorGetAppMonitor(response *smithyhttp.Response, 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) @@ -407,7 +316,7 @@ func awsRestjson1_deserializeOpErrorGetAppMonitor(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetAppMonitorOutput(v **GetAppMonitorOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchDeleteRumMetricDefinitionsOutput(v **BatchDeleteRumMetricDefinitionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -420,17 +329,22 @@ func awsRestjson1_deserializeOpDocumentGetAppMonitorOutput(v **GetAppMonitorOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAppMonitorOutput + var sv *BatchDeleteRumMetricDefinitionsOutput if *v == nil { - sv = &GetAppMonitorOutput{} + sv = &BatchDeleteRumMetricDefinitionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AppMonitor": - if err := awsRestjson1_deserializeDocumentAppMonitor(&sv.AppMonitor, value); err != nil { + case "Errors": + if err := awsRestjson1_deserializeDocumentBatchDeleteRumMetricDefinitionsErrors(&sv.Errors, value); err != nil { + return err + } + + case "MetricDefinitionIds": + if err := awsRestjson1_deserializeDocumentMetricDefinitionIds(&sv.MetricDefinitionIds, value); err != nil { return err } @@ -443,14 +357,14 @@ func awsRestjson1_deserializeOpDocumentGetAppMonitorOutput(v **GetAppMonitorOutp return nil } -type awsRestjson1_deserializeOpGetAppMonitorData struct { +type awsRestjson1_deserializeOpBatchGetRumMetricDefinitions struct { } -func (*awsRestjson1_deserializeOpGetAppMonitorData) ID() string { +func (*awsRestjson1_deserializeOpBatchGetRumMetricDefinitions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetAppMonitorData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchGetRumMetricDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -464,9 +378,9 @@ func (m *awsRestjson1_deserializeOpGetAppMonitorData) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetAppMonitorData(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchGetRumMetricDefinitions(response, &metadata) } - output := &GetAppMonitorDataOutput{} + output := &BatchGetRumMetricDefinitionsOutput{} out.Result = output var buff [1024]byte @@ -487,7 +401,7 @@ func (m *awsRestjson1_deserializeOpGetAppMonitorData) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetAppMonitorDataOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchGetRumMetricDefinitionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -500,7 +414,7 @@ func (m *awsRestjson1_deserializeOpGetAppMonitorData) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetAppMonitorData(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchGetRumMetricDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -550,9 +464,6 @@ func awsRestjson1_deserializeOpErrorGetAppMonitorData(response *smithyhttp.Respo 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) @@ -566,7 +477,7 @@ func awsRestjson1_deserializeOpErrorGetAppMonitorData(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetAppMonitorDataOutput(v **GetAppMonitorDataOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchGetRumMetricDefinitionsOutput(v **BatchGetRumMetricDefinitionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -579,17 +490,17 @@ func awsRestjson1_deserializeOpDocumentGetAppMonitorDataOutput(v **GetAppMonitor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetAppMonitorDataOutput + var sv *BatchGetRumMetricDefinitionsOutput if *v == nil { - sv = &GetAppMonitorDataOutput{} + sv = &BatchGetRumMetricDefinitionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Events": - if err := awsRestjson1_deserializeDocumentEventDataList(&sv.Events, value); err != nil { + case "MetricDefinitions": + if err := awsRestjson1_deserializeDocumentMetricDefinitions(&sv.MetricDefinitions, value); err != nil { return err } @@ -597,7 +508,7 @@ func awsRestjson1_deserializeOpDocumentGetAppMonitorDataOutput(v **GetAppMonitor if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Token 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) } @@ -611,14 +522,14 @@ func awsRestjson1_deserializeOpDocumentGetAppMonitorDataOutput(v **GetAppMonitor return nil } -type awsRestjson1_deserializeOpListAppMonitors struct { +type awsRestjson1_deserializeOpCreateAppMonitor struct { } -func (*awsRestjson1_deserializeOpListAppMonitors) ID() string { +func (*awsRestjson1_deserializeOpCreateAppMonitor) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppMonitors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -632,9 +543,9 @@ func (m *awsRestjson1_deserializeOpListAppMonitors) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppMonitors(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAppMonitor(response, &metadata) } - output := &ListAppMonitorsOutput{} + output := &CreateAppMonitorOutput{} out.Result = output var buff [1024]byte @@ -655,7 +566,7 @@ func (m *awsRestjson1_deserializeOpListAppMonitors) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppMonitorsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAppMonitorOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -668,7 +579,7 @@ func (m *awsRestjson1_deserializeOpListAppMonitors) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppMonitors(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -712,9 +623,18 @@ func awsRestjson1_deserializeOpErrorListAppMonitors(response *smithyhttp.Respons 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) @@ -731,7 +651,7 @@ func awsRestjson1_deserializeOpErrorListAppMonitors(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListAppMonitorsOutput(v **ListAppMonitorsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAppMonitorOutput(v **CreateAppMonitorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -744,27 +664,22 @@ func awsRestjson1_deserializeOpDocumentListAppMonitorsOutput(v **ListAppMonitors return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppMonitorsOutput + var sv *CreateAppMonitorOutput if *v == nil { - sv = &ListAppMonitorsOutput{} + sv = &CreateAppMonitorOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AppMonitorSummaries": - if err := awsRestjson1_deserializeDocumentAppMonitorSummaryList(&sv.AppMonitorSummaries, value); err != nil { - return err - } - - case "NextToken": + 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 AppMonitorId to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Id = ptr.String(jtv) } default: @@ -776,14 +691,14 @@ func awsRestjson1_deserializeOpDocumentListAppMonitorsOutput(v **ListAppMonitors return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpDeleteAppMonitor struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpDeleteAppMonitor) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -797,43 +712,15 @@ 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_deserializeOpErrorDeleteAppMonitor(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &DeleteAppMonitorOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -874,12 +761,21 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } 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) @@ -893,59 +789,14 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -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 - } +type awsRestjson1_deserializeOpDeleteRumMetricsDestination struct { +} - 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 "ResourceArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.ResourceArn = ptr.String(jtv) - } - - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpPutRumEvents struct { -} - -func (*awsRestjson1_deserializeOpPutRumEvents) ID() string { +func (*awsRestjson1_deserializeOpDeleteRumMetricsDestination) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutRumEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRumMetricsDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -959,15 +810,15 @@ func (m *awsRestjson1_deserializeOpPutRumEvents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutRumEvents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRumMetricsDestination(response, &metadata) } - output := &PutRumEventsOutput{} + output := &DeleteRumMetricsDestinationOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutRumEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRumMetricsDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1011,6 +862,9 @@ func awsRestjson1_deserializeOpErrorPutRumEvents(response *smithyhttp.Response, 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) @@ -1033,14 +887,14 @@ func awsRestjson1_deserializeOpErrorPutRumEvents(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpGetAppMonitor struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpGetAppMonitor) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1054,15 +908,43 @@ 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_deserializeOpErrorGetAppMonitor(response, &metadata) } - output := &TagResourceOutput{} + output := &GetAppMonitorOutput{} 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_deserializeOpDocumentGetAppMonitorOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1103,12 +985,18 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } 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) @@ -1122,14 +1010,50 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentGetAppMonitorOutput(v **GetAppMonitorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAppMonitorOutput + if *v == nil { + sv = &GetAppMonitorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AppMonitor": + if err := awsRestjson1_deserializeDocumentAppMonitor(&sv.AppMonitor, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpGetAppMonitorData struct { +} + +func (*awsRestjson1_deserializeOpGetAppMonitorData) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetAppMonitorData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1143,15 +1067,43 @@ 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_deserializeOpErrorGetAppMonitorData(response, &metadata) } - output := &UntagResourceOutput{} + output := &GetAppMonitorDataOutput{} 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_deserializeOpDocumentGetAppMonitorDataOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetAppMonitorData(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1192,12 +1144,18 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } 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) @@ -1211,14 +1169,59 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateAppMonitor struct { +func awsRestjson1_deserializeOpDocumentGetAppMonitorDataOutput(v **GetAppMonitorDataOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAppMonitorDataOutput + if *v == nil { + sv = &GetAppMonitorDataOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Events": + if err := awsRestjson1_deserializeDocumentEventDataList(&sv.Events, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateAppMonitor) ID() string { +type awsRestjson1_deserializeOpListAppMonitors struct { +} + +func (*awsRestjson1_deserializeOpListAppMonitors) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAppMonitors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1232,44 +1235,72 @@ func (m *awsRestjson1_deserializeOpUpdateAppMonitor) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAppMonitor(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAppMonitors(response, &metadata) } - output := &UpdateAppMonitorOutput{} + output := &ListAppMonitorsOutput{} out.Result = output - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) - if err != nil { + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListAppMonitorsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListAppMonitors(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err } errorBody.Seek(0, io.SeekStart) @@ -1284,15 +1315,9 @@ func awsRestjson1_deserializeOpErrorUpdateAppMonitor(response *smithyhttp.Respon 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) @@ -1309,80 +1334,82 @@ func awsRestjson1_deserializeOpErrorUpdateAppMonitor(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpDocumentListAppMonitorsOutput(v **ListAppMonitorsOutput, value interface{}) error { if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - 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)) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - return nil -} -func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + var sv *ListAppMonitorsOutput + if *v == nil { + sv = &ListAppMonitorsOutput{} + } else { + sv = *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 + for key, value := range shape { + switch key { + case "AppMonitorSummaries": + if err := awsRestjson1_deserializeDocumentAppMonitorSummaryList(&sv.AppMonitorSummaries, 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.RetryAfterSeconds = ptr.Int32(int32(vv)) } - + *v = sv return nil } -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } +type awsRestjson1_deserializeOpListRumMetricsDestinations struct { +} - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) +func (*awsRestjson1_deserializeOpListRumMetricsDestinations) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpListRumMetricsDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListRumMetricsDestinations(response, &metadata) + } + output := &ListRumMetricsDestinationsOutput{} + out.Result = 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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -1393,47 +1420,44 @@ func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Respons Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentConflictException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentListRumMetricsDestinationsOutput(&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), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} +func awsRestjson1_deserializeOpErrorListRumMetricsDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot 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) - + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1445,92 +1469,112 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - - if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message } - return output -} + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - 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 - } + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err - } - - errorBody.Seek(0, io.SeekStart) + return genericError - 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 +func awsRestjson1_deserializeOpDocumentListRumMetricsDestinationsOutput(v **ListRumMetricsDestinationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListRumMetricsDestinationsOutput + if *v == nil { + sv = &ListRumMetricsDestinationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Destinations": + if err := awsRestjson1_deserializeDocumentMetricDestinationSummaryList(&sv.Destinations, 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 - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } + *v = sv + return nil +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpListTagsForResource struct { +} - return output +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -1541,40 +1585,45 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&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), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) + return out, metadata, err +} - 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)} +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()) - return output -} + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } -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 { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1584,8 +1633,130 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("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 "ResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutRumEvents struct { +} + +func (*awsRestjson1_deserializeOpPutRumEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutRumEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutRumEvents(response, &metadata) + } + output := &PutRumEventsOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutRumEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1597,11 +1768,1324 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - return output + 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_deserializeOpPutRumMetricsDestination struct { +} + +func (*awsRestjson1_deserializeOpPutRumMetricsDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutRumMetricsDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutRumMetricsDestination(response, &metadata) + } + output := &PutRumMetricsDestinationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutRumMetricsDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("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 + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("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 + + } +} + +type awsRestjson1_deserializeOpUpdateAppMonitor struct { +} + +func (*awsRestjson1_deserializeOpUpdateAppMonitor) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAppMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAppMonitor(response, &metadata) + } + output := &UpdateAppMonitorOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAppMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateRumMetricDefinition struct { +} + +func (*awsRestjson1_deserializeOpUpdateRumMetricDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateRumMetricDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateRumMetricDefinition(response, &metadata) + } + output := &UpdateRumMetricDefinitionOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateRumMetricDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_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) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(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_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": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppMonitor(v **types.AppMonitor, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AppMonitor + if *v == nil { + sv = &types.AppMonitor{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AppMonitorConfiguration": + if err := awsRestjson1_deserializeDocumentAppMonitorConfiguration(&sv.AppMonitorConfiguration, value); err != nil { + return err + } + + case "Created": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) + } + sv.Created = ptr.String(jtv) + } + + case "DataStorage": + if err := awsRestjson1_deserializeDocumentDataStorage(&sv.DataStorage, value); err != nil { + return err + } + + case "Domain": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppMonitorDomain to be of type string, got %T instead", value) + } + sv.Domain = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppMonitorId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) + } + sv.LastModified = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppMonitorName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StateEnum to be of type string, got %T instead", value) + } + sv.State = types.StateEnum(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppMonitorConfiguration(v **types.AppMonitorConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AppMonitorConfiguration + if *v == nil { + sv = &types.AppMonitorConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowCookies": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AllowCookies = ptr.Bool(jtv) + } + + case "EnableXRay": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableXRay = ptr.Bool(jtv) + } + + case "ExcludedPages": + if err := awsRestjson1_deserializeDocumentPages(&sv.ExcludedPages, value); err != nil { + return err + } + + case "FavoritePages": + if err := awsRestjson1_deserializeDocumentFavoritePages(&sv.FavoritePages, value); err != nil { + return err + } + + case "GuestRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.GuestRoleArn = ptr.String(jtv) + } + + case "IdentityPoolId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityPoolId to be of type string, got %T instead", value) + } + sv.IdentityPoolId = ptr.String(jtv) + } + + case "IncludedPages": + if err := awsRestjson1_deserializeDocumentPages(&sv.IncludedPages, value); err != nil { + return err + } + + case "SessionSampleRate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SessionSampleRate = 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.SessionSampleRate = f64 + + default: + return fmt.Errorf("expected SessionSampleRate to be a JSON Number, got %T instead", value) + + } + } + + case "Telemetries": + if err := awsRestjson1_deserializeDocumentTelemetries(&sv.Telemetries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppMonitorSummary(v **types.AppMonitorSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AppMonitorSummary + if *v == nil { + sv = &types.AppMonitorSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Created": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) + } + sv.Created = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppMonitorId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastModified": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) + } + sv.LastModified = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppMonitorName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StateEnum to be of type string, got %T instead", value) + } + sv.State = types.StateEnum(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppMonitorSummaryList(v *[]types.AppMonitorSummary, 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.AppMonitorSummary + if *v == nil { + cv = []types.AppMonitorSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AppMonitorSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAppMonitorSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchCreateRumMetricDefinitionsError(v **types.BatchCreateRumMetricDefinitionsError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchCreateRumMetricDefinitionsError + if *v == nil { + sv = &types.BatchCreateRumMetricDefinitionsError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "MetricDefinition": + if err := awsRestjson1_deserializeDocumentMetricDefinitionRequest(&sv.MetricDefinition, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchCreateRumMetricDefinitionsErrors(v *[]types.BatchCreateRumMetricDefinitionsError, 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.BatchCreateRumMetricDefinitionsError + if *v == nil { + cv = []types.BatchCreateRumMetricDefinitionsError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchCreateRumMetricDefinitionsError + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchCreateRumMetricDefinitionsError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchDeleteRumMetricDefinitionsError(v **types.BatchDeleteRumMetricDefinitionsError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchDeleteRumMetricDefinitionsError + if *v == nil { + sv = &types.BatchDeleteRumMetricDefinitionsError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "MetricDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricDefinitionId to be of type string, got %T instead", value) + } + sv.MetricDefinitionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsRestjson1_deserializeDocumentBatchDeleteRumMetricDefinitionsErrors(v *[]types.BatchDeleteRumMetricDefinitionsError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1609,39 +3093,33 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie 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.AccessDeniedException + var cv []types.BatchDeleteRumMetricDefinitionsError if *v == nil { - sv = &types.AccessDeniedException{} + cv = []types.BatchDeleteRumMetricDefinitionsError{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.BatchDeleteRumMetricDefinitionsError + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchDeleteRumMetricDefinitionsError(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAppMonitor(v **types.AppMonitor, value interface{}) error { +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1654,82 +3132,40 @@ func awsRestjson1_deserializeDocumentAppMonitor(v **types.AppMonitor, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AppMonitor + var sv *types.ConflictException if *v == nil { - sv = &types.AppMonitor{} + sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { - case "AppMonitorConfiguration": - if err := awsRestjson1_deserializeDocumentAppMonitorConfiguration(&sv.AppMonitorConfiguration, value); err != nil { - return err - } - - case "Created": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) - } - sv.Created = ptr.String(jtv) - } - - case "DataStorage": - if err := awsRestjson1_deserializeDocumentDataStorage(&sv.DataStorage, value); err != nil { - return err - } - - case "Domain": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AppMonitorDomain to be of type string, got %T instead", value) - } - sv.Domain = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AppMonitorId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "LastModified": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.LastModified = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "Name": + case "resourceName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AppMonitorName to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.ResourceName = ptr.String(jtv) } - case "State": + case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected StateEnum to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.State = types.StateEnum(jtv) - } - - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err + sv.ResourceType = ptr.String(jtv) } default: @@ -1741,7 +3177,7 @@ func awsRestjson1_deserializeDocumentAppMonitor(v **types.AppMonitor, value inte return nil } -func awsRestjson1_deserializeDocumentAppMonitorConfiguration(v **types.AppMonitorConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentCwLog(v **types.CwLog, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1754,102 +3190,66 @@ func awsRestjson1_deserializeDocumentAppMonitorConfiguration(v **types.AppMonito return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AppMonitorConfiguration + var sv *types.CwLog if *v == nil { - sv = &types.AppMonitorConfiguration{} + sv = &types.CwLog{} } else { sv = *v } for key, value := range shape { switch key { - case "AllowCookies": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.AllowCookies = ptr.Bool(jtv) - } - - case "EnableXRay": + case "CwLogEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.EnableXRay = ptr.Bool(jtv) - } - - case "ExcludedPages": - if err := awsRestjson1_deserializeDocumentPages(&sv.ExcludedPages, value); err != nil { - return err - } - - case "FavoritePages": - if err := awsRestjson1_deserializeDocumentFavoritePages(&sv.FavoritePages, value); err != nil { - return err - } - - case "GuestRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.GuestRoleArn = ptr.String(jtv) + sv.CwLogEnabled = ptr.Bool(jtv) } - case "IdentityPoolId": + case "CwLogGroup": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected IdentityPoolId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.IdentityPoolId = ptr.String(jtv) - } - - case "IncludedPages": - if err := awsRestjson1_deserializeDocumentPages(&sv.IncludedPages, value); err != nil { - return err + sv.CwLogGroup = ptr.String(jtv) } - case "SessionSampleRate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.SessionSampleRate = 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: + _, _ = key, value - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) + } + } + *v = sv + return nil +} - } - sv.SessionSampleRate = f64 +func awsRestjson1_deserializeDocumentDataStorage(v **types.DataStorage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - default: - return fmt.Errorf("expected SessionSampleRate to be a JSON Number, got %T instead", value) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - } - } + var sv *types.DataStorage + if *v == nil { + sv = &types.DataStorage{} + } else { + sv = *v + } - case "Telemetries": - if err := awsRestjson1_deserializeDocumentTelemetries(&sv.Telemetries, value); err != nil { + for key, value := range shape { + switch key { + case "CwLog": + if err := awsRestjson1_deserializeDocumentCwLog(&sv.CwLog, value); err != nil { return err } @@ -1862,7 +3262,7 @@ func awsRestjson1_deserializeDocumentAppMonitorConfiguration(v **types.AppMonito return nil } -func awsRestjson1_deserializeDocumentAppMonitorSummary(v **types.AppMonitorSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentDimensionKeysMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1875,70 +3275,66 @@ func awsRestjson1_deserializeDocumentAppMonitorSummary(v **types.AppMonitorSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AppMonitorSummary + var mv map[string]string if *v == nil { - sv = &types.AppMonitorSummary{} + mv = map[string]string{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "Created": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) - } - sv.Created = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AppMonitorId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value) } + parsedVal = jtv + } + mv[key] = parsedVal - case "LastModified": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ISOTimestampString to be of type string, got %T instead", value) - } - sv.LastModified = ptr.String(jtv) - } + } + *v = mv + return nil +} - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AppMonitorName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } +func awsRestjson1_deserializeDocumentEventDataList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StateEnum to be of type string, got %T instead", value) - } - sv.State = types.StateEnum(jtv) - } + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - default: - _, _ = key, 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 EventData to be of type string, got %T instead", value) + } + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAppMonitorSummaryList(v *[]types.AppMonitorSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentFavoritePages(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1951,20 +3347,22 @@ func awsRestjson1_deserializeDocumentAppMonitorSummaryList(v *[]types.AppMonitor return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AppMonitorSummary + var cv []string if *v == nil { - cv = []types.AppMonitorSummary{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.AppMonitorSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentAppMonitorSummary(&destAddr, value); err != nil { - return err + 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 } - col = *destAddr cv = append(cv, col) } @@ -1972,7 +3370,7 @@ func awsRestjson1_deserializeDocumentAppMonitorSummaryList(v *[]types.AppMonitor return nil } -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1985,9 +3383,9 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConflictException + var sv *types.InternalServerException if *v == nil { - sv = &types.ConflictException{} + sv = &types.InternalServerException{} } else { sv = *v } @@ -2003,22 +3401,17 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti sv.Message = ptr.String(jtv) } - case "resourceName": + case "retryAfterSeconds": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.ResourceName = ptr.String(jtv) - } - - case "resourceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.ResourceType = ptr.String(jtv) + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) } default: @@ -2030,7 +3423,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsRestjson1_deserializeDocumentCwLog(v **types.CwLog, value interface{}) error { +func awsRestjson1_deserializeDocumentMetricDefinition(v **types.MetricDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2043,31 +3436,63 @@ func awsRestjson1_deserializeDocumentCwLog(v **types.CwLog, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CwLog + var sv *types.MetricDefinition if *v == nil { - sv = &types.CwLog{} + sv = &types.MetricDefinition{} } else { sv = *v } for key, value := range shape { switch key { - case "CwLogEnabled": + case "DimensionKeys": + if err := awsRestjson1_deserializeDocumentDimensionKeysMap(&sv.DimensionKeys, value); err != nil { + return err + } + + case "EventPattern": 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 EventPattern to be of type string, got %T instead", value) } - sv.CwLogEnabled = ptr.Bool(jtv) + sv.EventPattern = ptr.String(jtv) } - case "CwLogGroup": + case "MetricDefinitionId": 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 MetricDefinitionId to be of type string, got %T instead", value) } - sv.CwLogGroup = ptr.String(jtv) + sv.MetricDefinitionId = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "UnitLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UnitLabel to be of type string, got %T instead", value) + } + sv.UnitLabel = 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: @@ -2079,7 +3504,7 @@ func awsRestjson1_deserializeDocumentCwLog(v **types.CwLog, value interface{}) e return nil } -func awsRestjson1_deserializeDocumentDataStorage(v **types.DataStorage, value interface{}) error { +func awsRestjson1_deserializeDocumentMetricDefinitionIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2087,35 +3512,35 @@ func awsRestjson1_deserializeDocumentDataStorage(v **types.DataStorage, value in 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.DataStorage + var cv []string if *v == nil { - sv = &types.DataStorage{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "CwLog": - if err := awsRestjson1_deserializeDocumentCwLog(&sv.CwLog, value); err != nil { - return err + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricDefinitionId 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 awsRestjson1_deserializeDocumentEventDataList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentMetricDefinitionRequest(v **types.MetricDefinitionRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2123,35 +3548,71 @@ func awsRestjson1_deserializeDocumentEventDataList(v *[]string, value interface{ return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.MetricDefinitionRequest if *v == nil { - cv = []string{} + sv = &types.MetricDefinitionRequest{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EventData to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "DimensionKeys": + if err := awsRestjson1_deserializeDocumentDimensionKeysMap(&sv.DimensionKeys, value); err != nil { + return err } - col = jtv - } - cv = append(cv, col) + case "EventPattern": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventPattern to be of type string, got %T instead", value) + } + sv.EventPattern = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "UnitLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UnitLabel to be of type string, got %T instead", value) + } + sv.UnitLabel = 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 = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentFavoritePages(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentMetricDefinitions(v *[]types.MetricDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2164,22 +3625,20 @@ func awsRestjson1_deserializeDocumentFavoritePages(v *[]string, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.MetricDefinition if *v == nil { - cv = []string{} + cv = []types.MetricDefinition{} } 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 + var col types.MetricDefinition + destAddr := &col + if err := awsRestjson1_deserializeDocumentMetricDefinition(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -2187,7 +3646,7 @@ func awsRestjson1_deserializeDocumentFavoritePages(v *[]string, value interface{ return nil } -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { +func awsRestjson1_deserializeDocumentMetricDestinationSummary(v **types.MetricDestinationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2200,35 +3659,40 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InternalServerException + var sv *types.MetricDestinationSummary if *v == nil { - sv = &types.InternalServerException{} + sv = &types.MetricDestinationSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + 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 MetricDestination to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Destination = types.MetricDestination(jtv) } - case "retryAfterSeconds": + case "DestinationArn": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.DestinationArn = ptr.String(jtv) + } + + case "IamRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) } - sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + sv.IamRoleArn = ptr.String(jtv) } default: @@ -2240,6 +3704,40 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return nil } +func awsRestjson1_deserializeDocumentMetricDestinationSummaryList(v *[]types.MetricDestinationSummary, 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.MetricDestinationSummary + if *v == nil { + cv = []types.MetricDestinationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MetricDestinationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentMetricDestinationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentPages(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/rum/generated.json b/service/rum/generated.json index c663bdf3bdc..dcfaf404a72 100644 --- a/service/rum/generated.json +++ b/service/rum/generated.json @@ -8,16 +8,23 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_BatchCreateRumMetricDefinitions.go", + "api_op_BatchDeleteRumMetricDefinitions.go", + "api_op_BatchGetRumMetricDefinitions.go", "api_op_CreateAppMonitor.go", "api_op_DeleteAppMonitor.go", + "api_op_DeleteRumMetricsDestination.go", "api_op_GetAppMonitor.go", "api_op_GetAppMonitorData.go", "api_op_ListAppMonitors.go", + "api_op_ListRumMetricsDestinations.go", "api_op_ListTagsForResource.go", "api_op_PutRumEvents.go", + "api_op_PutRumMetricsDestination.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateAppMonitor.go", + "api_op_UpdateRumMetricDefinition.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/rum/serializers.go b/service/rum/serializers.go index 69e2f3674dc..68a486fe14a 100644 --- a/service/rum/serializers.go +++ b/service/rum/serializers.go @@ -16,6 +16,245 @@ import ( "math" ) +type awsRestjson1_serializeOpBatchCreateRumMetricDefinitions struct { +} + +func (*awsRestjson1_serializeOpBatchCreateRumMetricDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchCreateRumMetricDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchCreateRumMetricDefinitionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rummetrics/{AppMonitorName}/metrics") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsBatchCreateRumMetricDefinitionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchCreateRumMetricDefinitionsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchCreateRumMetricDefinitionsInput(v *BatchCreateRumMetricDefinitionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppMonitorName == nil || len(*v.AppMonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AppMonitorName must not be empty")} + } + if v.AppMonitorName != nil { + if err := encoder.SetURI("AppMonitorName").String(*v.AppMonitorName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchCreateRumMetricDefinitionsInput(v *BatchCreateRumMetricDefinitionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Destination) > 0 { + ok := object.Key("Destination") + ok.String(string(v.Destination)) + } + + if v.DestinationArn != nil { + ok := object.Key("DestinationArn") + ok.String(*v.DestinationArn) + } + + if v.MetricDefinitions != nil { + ok := object.Key("MetricDefinitions") + if err := awsRestjson1_serializeDocumentMetricDefinitionsRequest(v.MetricDefinitions, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpBatchDeleteRumMetricDefinitions struct { +} + +func (*awsRestjson1_serializeOpBatchDeleteRumMetricDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchDeleteRumMetricDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchDeleteRumMetricDefinitionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rummetrics/{AppMonitorName}/metrics") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsBatchDeleteRumMetricDefinitionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchDeleteRumMetricDefinitionsInput(v *BatchDeleteRumMetricDefinitionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppMonitorName == nil || len(*v.AppMonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AppMonitorName must not be empty")} + } + if v.AppMonitorName != nil { + if err := encoder.SetURI("AppMonitorName").String(*v.AppMonitorName); err != nil { + return err + } + } + + if len(v.Destination) > 0 { + encoder.SetQuery("destination").String(string(v.Destination)) + } + + if v.DestinationArn != nil { + encoder.SetQuery("destinationArn").String(*v.DestinationArn) + } + + if v.MetricDefinitionIds != nil { + for i := range v.MetricDefinitionIds { + encoder.AddQuery("metricDefinitionIds").String(v.MetricDefinitionIds[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpBatchGetRumMetricDefinitions struct { +} + +func (*awsRestjson1_serializeOpBatchGetRumMetricDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchGetRumMetricDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetRumMetricDefinitionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rummetrics/{AppMonitorName}/metrics") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsBatchGetRumMetricDefinitionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchGetRumMetricDefinitionsInput(v *BatchGetRumMetricDefinitionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppMonitorName == nil || len(*v.AppMonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AppMonitorName must not be empty")} + } + if v.AppMonitorName != nil { + if err := encoder.SetURI("AppMonitorName").String(*v.AppMonitorName); err != nil { + return err + } + } + + if len(v.Destination) > 0 { + encoder.SetQuery("destination").String(string(v.Destination)) + } + + if v.DestinationArn != nil { + encoder.SetQuery("destinationArn").String(*v.DestinationArn) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpCreateAppMonitor struct { } @@ -166,6 +405,72 @@ func awsRestjson1_serializeOpHttpBindingsDeleteAppMonitorInput(v *DeleteAppMonit return nil } +type awsRestjson1_serializeOpDeleteRumMetricsDestination struct { +} + +func (*awsRestjson1_serializeOpDeleteRumMetricsDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteRumMetricsDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteRumMetricsDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rummetrics/{AppMonitorName}/metricsdestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteRumMetricsDestinationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteRumMetricsDestinationInput(v *DeleteRumMetricsDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppMonitorName == nil || len(*v.AppMonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AppMonitorName must not be empty")} + } + if v.AppMonitorName != nil { + if err := encoder.SetURI("AppMonitorName").String(*v.AppMonitorName); err != nil { + return err + } + } + + if len(v.Destination) > 0 { + encoder.SetQuery("destination").String(string(v.Destination)) + } + + if v.DestinationArn != nil { + encoder.SetQuery("destinationArn").String(*v.DestinationArn) + } + + return nil +} + type awsRestjson1_serializeOpGetAppMonitor struct { } @@ -381,6 +686,72 @@ func awsRestjson1_serializeOpHttpBindingsListAppMonitorsInput(v *ListAppMonitors return nil } +type awsRestjson1_serializeOpListRumMetricsDestinations struct { +} + +func (*awsRestjson1_serializeOpListRumMetricsDestinations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRumMetricsDestinations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListRumMetricsDestinationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rummetrics/{AppMonitorName}/metricsdestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListRumMetricsDestinationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListRumMetricsDestinationsInput(v *ListRumMetricsDestinationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppMonitorName == nil || len(*v.AppMonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AppMonitorName must not be empty")} + } + if v.AppMonitorName != nil { + if err := encoder.SetURI("AppMonitorName").String(*v.AppMonitorName); err != nil { + return err + } + } + + 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 { } @@ -541,6 +912,97 @@ func awsRestjson1_serializeOpDocumentPutRumEventsInput(v *PutRumEventsInput, val return nil } +type awsRestjson1_serializeOpPutRumMetricsDestination struct { +} + +func (*awsRestjson1_serializeOpPutRumMetricsDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutRumMetricsDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutRumMetricsDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rummetrics/{AppMonitorName}/metricsdestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutRumMetricsDestinationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutRumMetricsDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutRumMetricsDestinationInput(v *PutRumMetricsDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppMonitorName == nil || len(*v.AppMonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AppMonitorName must not be empty")} + } + if v.AppMonitorName != nil { + if err := encoder.SetURI("AppMonitorName").String(*v.AppMonitorName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutRumMetricsDestinationInput(v *PutRumMetricsDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Destination) > 0 { + ok := object.Key("Destination") + ok.String(string(v.Destination)) + } + + if v.DestinationArn != nil { + ok := object.Key("DestinationArn") + ok.String(*v.DestinationArn) + } + + if v.IamRoleArn != nil { + ok := object.Key("IamRoleArn") + ok.String(*v.IamRoleArn) + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } @@ -781,6 +1243,104 @@ func awsRestjson1_serializeOpDocumentUpdateAppMonitorInput(v *UpdateAppMonitorIn return nil } +type awsRestjson1_serializeOpUpdateRumMetricDefinition struct { +} + +func (*awsRestjson1_serializeOpUpdateRumMetricDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateRumMetricDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateRumMetricDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rummetrics/{AppMonitorName}/metrics") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateRumMetricDefinitionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateRumMetricDefinitionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateRumMetricDefinitionInput(v *UpdateRumMetricDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AppMonitorName == nil || len(*v.AppMonitorName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AppMonitorName must not be empty")} + } + if v.AppMonitorName != nil { + if err := encoder.SetURI("AppMonitorName").String(*v.AppMonitorName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateRumMetricDefinitionInput(v *UpdateRumMetricDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Destination) > 0 { + ok := object.Key("Destination") + ok.String(string(v.Destination)) + } + + if v.DestinationArn != nil { + ok := object.Key("DestinationArn") + ok.String(*v.DestinationArn) + } + + if v.MetricDefinition != nil { + ok := object.Key("MetricDefinition") + if err := awsRestjson1_serializeDocumentMetricDefinitionRequest(v.MetricDefinition, ok); err != nil { + return err + } + } + + if v.MetricDefinitionId != nil { + ok := object.Key("MetricDefinitionId") + ok.String(*v.MetricDefinitionId) + } + + return nil +} + func awsRestjson1_serializeDocumentAppMonitorConfiguration(v *types.AppMonitorConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -876,6 +1436,17 @@ func awsRestjson1_serializeDocumentAppMonitorDetails(v *types.AppMonitorDetails, return nil } +func awsRestjson1_serializeDocumentDimensionKeysMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + func awsRestjson1_serializeDocumentFavoritePages(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -887,6 +1458,53 @@ func awsRestjson1_serializeDocumentFavoritePages(v []string, value smithyjson.Va return nil } +func awsRestjson1_serializeDocumentMetricDefinitionRequest(v *types.MetricDefinitionRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DimensionKeys != nil { + ok := object.Key("DimensionKeys") + if err := awsRestjson1_serializeDocumentDimensionKeysMap(v.DimensionKeys, ok); err != nil { + return err + } + } + + if v.EventPattern != nil { + ok := object.Key("EventPattern") + ok.String(*v.EventPattern) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.UnitLabel != nil { + ok := object.Key("UnitLabel") + ok.String(*v.UnitLabel) + } + + if v.ValueKey != nil { + ok := object.Key("ValueKey") + ok.String(*v.ValueKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentMetricDefinitionsRequest(v []types.MetricDefinitionRequest, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentMetricDefinitionRequest(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentPages(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/rum/types/enums.go b/service/rum/types/enums.go index 5c8c69b0ecd..357d24bbb9d 100644 --- a/service/rum/types/enums.go +++ b/service/rum/types/enums.go @@ -2,6 +2,24 @@ package types +type MetricDestination string + +// Enum values for MetricDestination +const ( + MetricDestinationCloudWatch MetricDestination = "CloudWatch" + MetricDestinationEvidently MetricDestination = "Evidently" +) + +// Values returns all known values for MetricDestination. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (MetricDestination) Values() []MetricDestination { + return []MetricDestination{ + "CloudWatch", + "Evidently", + } +} + type StateEnum string // Enum values for StateEnum diff --git a/service/rum/types/types.go b/service/rum/types/types.go index b9e25d47ed3..5a883eb7353 100644 --- a/service/rum/types/types.go +++ b/service/rum/types/types.go @@ -68,8 +68,8 @@ type AppMonitorConfiguration struct { // operation. ExcludedPages []string - // A list of pages in the CloudWatch RUM console that are to be displayed with a - // "favorite" icon. + // A list of pages in your application that are to be displayed with a "favorite" + // icon in the CloudWatch RUM console. FavoritePages []string // The ARN of the guest IAM role that is attached to the Amazon Cognito identity @@ -85,10 +85,12 @@ type AppMonitorConfiguration struct { // ExcludedPages and IncludedPages in the same operation. IncludedPages []string - // Specifies the percentage of user sessions to use for RUM data collection. - // Choosing a higher percentage gives you more data but also incurs more costs. The - // number you specify is the percentage of user sessions that will be used. If you - // omit this parameter, the default of 10 is used. + // Specifies the portion of user sessions to use for RUM data collection. Choosing + // a higher portion gives you more data but also incurs more costs. The range for + // this value is 0 to 1 inclusive. Setting this to 1 means that 100% of user + // sessions are sampled, and setting it to 0.1 means that 10% of user sessions are + // sampled. If you omit this parameter, the default of 0.1 is used, and 10% of + // sessions will be sampled. SessionSampleRate float64 // An array that lists the types of telemetry data that this app monitor is to @@ -145,6 +147,52 @@ type AppMonitorSummary struct { noSmithyDocumentSerde } +// A structure that defines one error caused by a BatchCreateRumMetricsDefinitions +// (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_BatchCreateRumMetricsDefinitions.html) +// operation. +type BatchCreateRumMetricDefinitionsError struct { + + // The error code. + // + // This member is required. + ErrorCode *string + + // The error message for this metric definition. + // + // This member is required. + ErrorMessage *string + + // The metric definition that caused this error. + // + // This member is required. + MetricDefinition *MetricDefinitionRequest + + noSmithyDocumentSerde +} + +// A structure that defines one error caused by a BatchCreateRumMetricsDefinitions +// (https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_BatchDeleteRumMetricsDefinitions.html) +// operation. +type BatchDeleteRumMetricDefinitionsError struct { + + // The error code. + // + // This member is required. + ErrorCode *string + + // The error message for this metric definition. + // + // This member is required. + ErrorMessage *string + + // The ID of the metric definition that caused this error. + // + // This member is required. + MetricDefinitionId *string + + noSmithyDocumentSerde +} + // A structure that contains the information about whether the app monitor stores // copies of the data that RUM collects in CloudWatch Logs. If it does, this // structure also contains the name of the log group. @@ -172,6 +220,219 @@ type DataStorage struct { noSmithyDocumentSerde } +// A structure that displays the definition of one extended metric that RUM sends +// to CloudWatch or CloudWatch Evidently. For more information, see Additional +// metrics that you can send to CloudWatch and CloudWatch Evidently +// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-vended-metrics.html). +type MetricDefinition struct { + + // The ID of this metric definition. + // + // This member is required. + MetricDefinitionId *string + + // The name of the metric that is defined in this structure. + // + // This member is required. + Name *string + + // This field is a map of field paths to dimension names. It defines the dimensions + // to associate with this metric in CloudWatch The value of this field is used only + // if the metric destination is CloudWatch. If the metric destination is Evidently, + // the value of DimensionKeys is ignored. + DimensionKeys map[string]string + + // The pattern that defines the metric. RUM checks events that happen in a user's + // session against the pattern, and events that match the pattern are sent to the + // metric destination. If the metrics destination is CloudWatch and the event also + // matches a value in DimensionKeys, then the metric is published with the + // specified dimensions. + EventPattern *string + + // Use this field only if you are sending this metric to CloudWatch. It defines the + // CloudWatch metric unit that this metric is measured in. + UnitLabel *string + + // The field within the event object that the metric value is sourced from. + ValueKey *string + + noSmithyDocumentSerde +} + +// Use this structure to define one extended metric that RUM will send to +// CloudWatch or CloudWatch Evidently. For more information, see Additional +// metrics that you can send to CloudWatch and CloudWatch Evidently +// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-vended-metrics.html). +// Only certain combinations of values for Name, ValueKey, and EventPattern are +// valid. In addition to what is displayed in the list below, the EventPattern can +// also include information used by the DimensionKeys field. +// +// * If Name is +// PerformanceNavigationDuration, then ValueKeymust be event_details.duration and +// the EventPattern must include +// {"event_type":["com.amazon.rum.performance_navigation_event"]} +// +// * If Name is +// PerformanceResourceDuration, then ValueKeymust be event_details.duration and the +// EventPattern must include +// {"event_type":["com.amazon.rum.performance_resource_event"]} +// +// * If Name is +// NavigationSatisfiedTransaction, then ValueKeymust be null and the EventPattern +// must include { "event_type": ["com.amazon.rum.performance_navigation_event"], +// "event_details": { "duration": [{ "numeric": [">",2000] }] } } +// +// * If Name is +// NavigationToleratedTransaction, then ValueKeymust be null and the EventPattern +// must include { "event_type": ["com.amazon.rum.performance_navigation_event"], +// "event_details": { "duration": [{ "numeric": [">=",2000,"<"8000] }] } } +// +// * If +// Name is NavigationFrustratedTransaction, then ValueKeymust be null and the +// EventPattern must include { "event_type": +// ["com.amazon.rum.performance_navigation_event"], "event_details": { "duration": +// [{ "numeric": [">=",8000] }] } } +// +// * If Name is WebVitalsCumulativeLayoutShift, +// then ValueKeymust be event_details.value and the EventPattern must include +// {"event_type":["com.amazon.rum.cumulative_layout_shift_event"]} +// +// * If Name is +// WebVitalsFirstInputDelay, then ValueKeymust be event_details.value and the +// EventPattern must include +// {"event_type":["com.amazon.rum.first_input_delay_event"]} +// +// * If Name is +// WebVitalsLargestContentfulPaint, then ValueKeymust be event_details.value and +// the EventPattern must include +// {"event_type":["com.amazon.rum.largest_contentful_paint_event"]} +// +// * If Name is +// JsErrorCount, then ValueKeymust be null and the EventPattern must include +// {"event_type":["com.amazon.rum.js_error_event"]} +// +// * If Name is HttpErrorCount, +// then ValueKeymust be null and the EventPattern must include +// {"event_type":["com.amazon.rum.http_event"]} +// +// * If Name is SessionCount, then +// ValueKeymust be null and the EventPattern must include +// {"event_type":["com.amazon.rum.session_start_event"]} +type MetricDefinitionRequest struct { + + // The name for the metric that is defined in this structure. Valid values are the + // following: + // + // * PerformanceNavigationDuration + // + // * PerformanceResourceDuration + // + // * + // NavigationSatisfiedTransaction + // + // * NavigationToleratedTransaction + // + // * + // NavigationFrustratedTransaction + // + // * WebVitalsCumulativeLayoutShift + // + // * + // WebVitalsFirstInputDelay + // + // * WebVitalsLargestContentfulPaint + // + // * JsErrorCount + // + // * + // HttpErrorCount + // + // * SessionCount + // + // This member is required. + Name *string + + // Use this field only if you are sending the metric to CloudWatch. This field is a + // map of field paths to dimension names. It defines the dimensions to associate + // with this metric in CloudWatch. Valid values for the entries in this field are + // the following: + // + // * "metadata.pageId": "PageId" + // + // * "metadata.browserName": + // "BrowserName" + // + // * "metadata.deviceType": "DeviceType" + // + // * "metadata.osName": + // "OSName" + // + // * "metadata.countryCode": "CountryCode" + // + // * "event_details.fileType": + // "FileType" + // + // All dimensions listed in this field must also be included in + // EventPattern. + DimensionKeys map[string]string + + // The pattern that defines the metric, specified as a JSON object. RUM checks + // events that happen in a user's session against the pattern, and events that + // match the pattern are sent to the metric destination. When you define extended + // metrics, the metric definition is not valid if EventPattern is omitted. Example + // event patterns: + // + // * '{ "event_type": ["com.amazon.rum.js_error_event"], + // "metadata": { "browserName": [ "Chrome", "Safari" ], } }' + // + // * '{ "event_type": + // ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ + // "Chrome", "Firefox" ] }, "event_details": { "duration": [{ "numeric": [ "<", + // 2000 ] }] } }' + // + // * '{ "event_type": + // ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ + // "Chrome", "Safari" ], "countryCode": [ "US" ] }, "event_details": { "duration": + // [{ "numeric": [ ">=", 2000, "<", 8000 ] }] } }' + // + // If the metrics destination' is + // CloudWatch and the event also matches a value in DimensionKeys, then the metric + // is published with the specified dimensions. + EventPattern *string + + // The CloudWatch metric unit to use for this metric. If you omit this field, the + // metric is recorded with no unit. + UnitLabel *string + + // The field within the event object that the metric value is sourced from. If you + // omit this field, a hardcoded value of 1 is pushed as the metric value. This is + // useful if you just want to count the number of events that the filter catches. + // If this metric is sent to CloudWatch Evidently, this field will be passed to + // Evidently raw and Evidently will handle data extraction from the event. + ValueKey *string + + noSmithyDocumentSerde +} + +// A structure that displays information about one destination that CloudWatch RUM +// sends extended metrics to. +type MetricDestinationSummary struct { + + // Specifies whether the destination is CloudWatch or Evidently. + Destination MetricDestination + + // If the destination is Evidently, this specifies the ARN of the Evidently + // experiment that receives the metrics. + DestinationArn *string + + // This field appears only when the destination is Evidently. It specifies the ARN + // of the IAM role that is used to write to the Evidently experiment that receives + // the metrics. + IamRoleArn *string + + noSmithyDocumentSerde +} + // A structure that defines a key and values that you can use to filter the // results. The only performance events that are returned are those that have // values matching the ones that you specify in one of your QueryFilter structures. diff --git a/service/rum/validators.go b/service/rum/validators.go index d387ca3a984..a90941cfb79 100644 --- a/service/rum/validators.go +++ b/service/rum/validators.go @@ -10,6 +10,66 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpBatchCreateRumMetricDefinitions struct { +} + +func (*validateOpBatchCreateRumMetricDefinitions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchCreateRumMetricDefinitions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchCreateRumMetricDefinitionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchCreateRumMetricDefinitionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchDeleteRumMetricDefinitions struct { +} + +func (*validateOpBatchDeleteRumMetricDefinitions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDeleteRumMetricDefinitions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDeleteRumMetricDefinitionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDeleteRumMetricDefinitionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchGetRumMetricDefinitions struct { +} + +func (*validateOpBatchGetRumMetricDefinitions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchGetRumMetricDefinitions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchGetRumMetricDefinitionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchGetRumMetricDefinitionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateAppMonitor struct { } @@ -50,6 +110,26 @@ func (m *validateOpDeleteAppMonitor) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDeleteRumMetricsDestination struct { +} + +func (*validateOpDeleteRumMetricsDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRumMetricsDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRumMetricsDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRumMetricsDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetAppMonitorData struct { } @@ -90,6 +170,26 @@ func (m *validateOpGetAppMonitor) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpListRumMetricsDestinations struct { +} + +func (*validateOpListRumMetricsDestinations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRumMetricsDestinations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRumMetricsDestinationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRumMetricsDestinationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -130,6 +230,26 @@ func (m *validateOpPutRumEvents) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpPutRumMetricsDestination struct { +} + +func (*validateOpPutRumMetricsDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutRumMetricsDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutRumMetricsDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutRumMetricsDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -190,6 +310,38 @@ func (m *validateOpUpdateAppMonitor) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpUpdateRumMetricDefinition struct { +} + +func (*validateOpUpdateRumMetricDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRumMetricDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRumMetricDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRumMetricDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpBatchCreateRumMetricDefinitionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchCreateRumMetricDefinitions{}, middleware.After) +} + +func addOpBatchDeleteRumMetricDefinitionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDeleteRumMetricDefinitions{}, middleware.After) +} + +func addOpBatchGetRumMetricDefinitionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchGetRumMetricDefinitions{}, middleware.After) +} + func addOpCreateAppMonitorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAppMonitor{}, middleware.After) } @@ -198,6 +350,10 @@ func addOpDeleteAppMonitorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAppMonitor{}, middleware.After) } +func addOpDeleteRumMetricsDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRumMetricsDestination{}, middleware.After) +} + func addOpGetAppMonitorDataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAppMonitorData{}, middleware.After) } @@ -206,6 +362,10 @@ func addOpGetAppMonitorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAppMonitor{}, middleware.After) } +func addOpListRumMetricsDestinationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRumMetricsDestinations{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -214,6 +374,10 @@ func addOpPutRumEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutRumEvents{}, middleware.After) } +func addOpPutRumMetricsDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutRumMetricsDestination{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -226,6 +390,42 @@ func addOpUpdateAppMonitorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAppMonitor{}, middleware.After) } +func addOpUpdateRumMetricDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRumMetricDefinition{}, middleware.After) +} + +func validateMetricDefinitionRequest(v *types.MetricDefinitionRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MetricDefinitionRequest"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMetricDefinitionsRequest(v []types.MetricDefinitionRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MetricDefinitionsRequest"} + for i := range v { + if err := validateMetricDefinitionRequest(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRumEvent(v *types.RumEvent) error { if v == nil { return nil @@ -279,6 +479,70 @@ func validateTimeRange(v *types.TimeRange) error { } } +func validateOpBatchCreateRumMetricDefinitionsInput(v *BatchCreateRumMetricDefinitionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchCreateRumMetricDefinitionsInput"} + if v.AppMonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppMonitorName")) + } + if len(v.Destination) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if v.MetricDefinitions == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricDefinitions")) + } else if v.MetricDefinitions != nil { + if err := validateMetricDefinitionsRequest(v.MetricDefinitions); err != nil { + invalidParams.AddNested("MetricDefinitions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchDeleteRumMetricDefinitionsInput(v *BatchDeleteRumMetricDefinitionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteRumMetricDefinitionsInput"} + if v.AppMonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppMonitorName")) + } + if len(v.Destination) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if v.MetricDefinitionIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricDefinitionIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchGetRumMetricDefinitionsInput(v *BatchGetRumMetricDefinitionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetRumMetricDefinitionsInput"} + if v.AppMonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppMonitorName")) + } + if len(v.Destination) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateAppMonitorInput(v *CreateAppMonitorInput) error { if v == nil { return nil @@ -312,6 +576,24 @@ func validateOpDeleteAppMonitorInput(v *DeleteAppMonitorInput) error { } } +func validateOpDeleteRumMetricsDestinationInput(v *DeleteRumMetricsDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRumMetricsDestinationInput"} + if v.AppMonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppMonitorName")) + } + if len(v.Destination) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetAppMonitorDataInput(v *GetAppMonitorDataInput) error { if v == nil { return nil @@ -349,6 +631,21 @@ func validateOpGetAppMonitorInput(v *GetAppMonitorInput) error { } } +func validateOpListRumMetricsDestinationsInput(v *ListRumMetricsDestinationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRumMetricsDestinationsInput"} + if v.AppMonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppMonitorName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -395,6 +692,24 @@ func validateOpPutRumEventsInput(v *PutRumEventsInput) error { } } +func validateOpPutRumMetricsDestinationInput(v *PutRumMetricsDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutRumMetricsDestinationInput"} + if v.AppMonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppMonitorName")) + } + if len(v.Destination) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil @@ -445,3 +760,31 @@ func validateOpUpdateAppMonitorInput(v *UpdateAppMonitorInput) error { return nil } } + +func validateOpUpdateRumMetricDefinitionInput(v *UpdateRumMetricDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRumMetricDefinitionInput"} + if v.AppMonitorName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AppMonitorName")) + } + if len(v.Destination) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if v.MetricDefinition == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricDefinition")) + } else if v.MetricDefinition != nil { + if err := validateMetricDefinitionRequest(v.MetricDefinition); err != nil { + invalidParams.AddNested("MetricDefinition", err.(smithy.InvalidParamsError)) + } + } + if v.MetricDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricDefinitionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/ssm/internal/endpoints/endpoints.go b/service/ssm/internal/endpoints/endpoints.go index abd6f430cea..300475bee4d 100644 --- a/service/ssm/internal/endpoints/endpoints.go +++ b/service/ssm/internal/endpoints/endpoints.go @@ -348,6 +348,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, }, }, {