diff --git a/.changelog/073981dd38cf4771a8450a6e0645d92d.json b/.changelog/073981dd38cf4771a8450a6e0645d92d.json new file mode 100644 index 00000000000..6aeec430579 --- /dev/null +++ b/.changelog/073981dd38cf4771a8450a6e0645d92d.json @@ -0,0 +1,8 @@ +{ + "id": "073981dd-38cf-4771-a845-0a6e0645d92d", + "type": "feature", + "description": "AWS introduces the new Amazon EventBridge Scheduler. EventBridge Scheduler is a serverless scheduler that allows you to create, run, and manage tasks from one central, managed service.", + "modules": [ + "service/scheduler" + ] +} \ No newline at end of file diff --git a/.changelog/13f465fbe5a74e478ed057a76407f9a8.json b/.changelog/13f465fbe5a74e478ed057a76407f9a8.json new file mode 100644 index 00000000000..b2639032da0 --- /dev/null +++ b/.changelog/13f465fbe5a74e478ed057a76407f9a8.json @@ -0,0 +1,8 @@ +{ + "id": "13f465fb-e5a7-4e47-8ed0-57a76407f9a8", + "type": "feature", + "description": "This release adds a new price capacity optimized allocation strategy for Spot Instances to help customers optimize provisioning of Spot Instances via EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. It allocates Spot Instances based on both spare capacity availability and Spot Instance price.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/278aeb51b038485ab5d07cc4e7ff711e.json b/.changelog/278aeb51b038485ab5d07cc4e7ff711e.json new file mode 100644 index 00000000000..3509fc4885c --- /dev/null +++ b/.changelog/278aeb51b038485ab5d07cc4e7ff711e.json @@ -0,0 +1,8 @@ +{ + "id": "278aeb51-b038-485a-b5d0-7cc4e7ff711e", + "type": "feature", + "description": "Amazon OpenSearch Service now offers managed VPC endpoints to connect to your Amazon OpenSearch Service VPC-enabled domain in a Virtual Private Cloud (VPC). This feature allows you to privately access OpenSearch Service domain without using public IPs or requiring traffic to traverse the Internet.", + "modules": [ + "service/elasticsearchservice" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..b19943f10bf --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/scheduler" + ] +} \ No newline at end of file diff --git a/.changelog/737897cffbba42c1b00ebcd9934e8c53.json b/.changelog/737897cffbba42c1b00ebcd9934e8c53.json new file mode 100644 index 00000000000..7f0853e83a2 --- /dev/null +++ b/.changelog/737897cffbba42c1b00ebcd9934e8c53.json @@ -0,0 +1,8 @@ +{ + "id": "737897cf-fbba-42c1-b00e-bcd9934e8c53", + "type": "documentation", + "description": "This release adds a new price capacity optimized allocation strategy for Spot Instances to help customers optimize provisioning of Spot Instances via EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. It allocates Spot Instances based on both spare capacity availability and Spot Instance price.", + "modules": [ + "service/autoscaling" + ] +} \ No newline at end of file diff --git a/.changelog/a7bf989b952c4c1986776e7aa0612eb0.json b/.changelog/a7bf989b952c4c1986776e7aa0612eb0.json new file mode 100644 index 00000000000..497199a729b --- /dev/null +++ b/.changelog/a7bf989b952c4c1986776e7aa0612eb0.json @@ -0,0 +1,8 @@ +{ + "id": "a7bf989b-952c-4c19-8677-6e7aa0612eb0", + "type": "feature", + "description": "This release adds support for task scale-in protection with updateTaskProtection and getTaskProtection APIs. UpdateTaskProtection API can be used to protect a service managed task from being terminated by scale-in events and getTaskProtection API to get the scale-in protection status of a task.", + "modules": [ + "service/ecs" + ] +} \ No newline at end of file diff --git a/.changelog/c98764fcefa5414988f12abf4143090d.json b/.changelog/c98764fcefa5414988f12abf4143090d.json new file mode 100644 index 00000000000..1daf257b783 --- /dev/null +++ b/.changelog/c98764fcefa5414988f12abf4143090d.json @@ -0,0 +1,8 @@ +{ + "id": "c98764fc-efa5-4149-88f1-2abf4143090d", + "type": "documentation", + "description": "Text only updates to some Resource Explorer descriptions.", + "modules": [ + "service/resourceexplorer2" + ] +} \ No newline at end of file diff --git a/service/accessanalyzer/internal/endpoints/endpoints.go b/service/accessanalyzer/internal/endpoints/endpoints.go index 6fd1f48b252..3627a647a19 100644 --- a/service/accessanalyzer/internal/endpoints/endpoints.go +++ b/service/accessanalyzer/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/acm/internal/endpoints/endpoints.go b/service/acm/internal/endpoints/endpoints.go index b41048e5116..f937887fc9a 100644 --- a/service/acm/internal/endpoints/endpoints.go +++ b/service/acm/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/apigateway/internal/endpoints/endpoints.go b/service/apigateway/internal/endpoints/endpoints.go index 65d8a83d576..d17c9df6adc 100644 --- a/service/apigateway/internal/endpoints/endpoints.go +++ b/service/apigateway/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/apigatewayv2/internal/endpoints/endpoints.go b/service/apigatewayv2/internal/endpoints/endpoints.go index c5b8929b43c..fde1bb15b01 100644 --- a/service/apigatewayv2/internal/endpoints/endpoints.go +++ b/service/apigatewayv2/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/appconfig/internal/endpoints/endpoints.go b/service/appconfig/internal/endpoints/endpoints.go index 3cd9423aa4c..502eb268169 100644 --- a/service/appconfig/internal/endpoints/endpoints.go +++ b/service/appconfig/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/applicationautoscaling/internal/endpoints/endpoints.go b/service/applicationautoscaling/internal/endpoints/endpoints.go index a240e75bb63..6545c0e444f 100644 --- a/service/applicationautoscaling/internal/endpoints/endpoints.go +++ b/service/applicationautoscaling/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/autoscaling/api_op_CreateAutoScalingGroup.go b/service/autoscaling/api_op_CreateAutoScalingGroup.go index 460324a86f6..5c1107e70f9 100644 --- a/service/autoscaling/api_op_CreateAutoScalingGroup.go +++ b/service/autoscaling/api_op_CreateAutoScalingGroup.go @@ -49,7 +49,9 @@ func (c *Client) CreateAutoScalingGroup(ctx context.Context, params *CreateAutoS type CreateAutoScalingGroupInput struct { // The name of the Auto Scaling group. This name must be unique per Region per - // account. + // account. The name can contain any ASCII character 33 to 126 including most + // punctuation characters, digits, and upper and lowercased letters. You cannot use + // a colon (:) in the name. // // This member is required. AutoScalingGroupName *string @@ -136,9 +138,9 @@ type CreateAutoScalingGroupInput struct { // checking the health status of an EC2 instance that has come into service and // marking it unhealthy due to a failed Elastic Load Balancing or custom health // check. This is useful if your instances do not immediately pass these health - // checks after they enter the InService state. For more information, see Health - // check grace period - // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) + // checks after they enter the InService state. For more information, see Set the + // health check grace period for an Auto Scaling group + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html) // in the Amazon EC2 Auto Scaling User Guide. Default: 0 seconds HealthCheckGracePeriod *int32 diff --git a/service/autoscaling/api_op_UpdateAutoScalingGroup.go b/service/autoscaling/api_op_UpdateAutoScalingGroup.go index 5e6b12bee70..2cddd5b7b7f 100644 --- a/service/autoscaling/api_op_UpdateAutoScalingGroup.go +++ b/service/autoscaling/api_op_UpdateAutoScalingGroup.go @@ -128,9 +128,9 @@ type UpdateAutoScalingGroupInput struct { // checking the health status of an EC2 instance that has come into service and // marking it unhealthy due to a failed Elastic Load Balancing or custom health // check. This is useful if your instances do not immediately pass these health - // checks after they enter the InService state. For more information, see Health - // check grace period - // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period) + // checks after they enter the InService state. For more information, see Set the + // health check grace period for an Auto Scaling group + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html) // in the Amazon EC2 Auto Scaling User Guide. HealthCheckGracePeriod *int32 diff --git a/service/autoscaling/internal/endpoints/endpoints.go b/service/autoscaling/internal/endpoints/endpoints.go index 4f938b0b167..aa36464f0e5 100644 --- a/service/autoscaling/internal/endpoints/endpoints.go +++ b/service/autoscaling/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/autoscaling/types/types.go b/service/autoscaling/types/types.go index 227269032f6..7c2765cd4a0 100644 --- a/service/autoscaling/types/types.go +++ b/service/autoscaling/types/types.go @@ -1121,24 +1121,29 @@ type InstanceReusePolicy struct { // capacities for a mixed instances policy. type InstancesDistribution struct { - // The order of the launch template overrides to use in fulfilling On-Demand - // capacity. If you specify lowest-price, Amazon EC2 Auto Scaling uses price to - // determine the order, launching the lowest price first. If you specify - // prioritized, Amazon EC2 Auto Scaling uses the priority that you assigned to each - // launch template override, launching the highest priority first. If all your - // On-Demand capacity cannot be fulfilled using your highest priority instance, - // then Amazon EC2 Auto Scaling launches the remaining capacity using the second - // priority instance type, and so on. Default: lowest-price for Auto Scaling groups - // that specify InstanceRequirements in the overrides and prioritized for Auto - // Scaling groups that don't. Valid values: lowest-price | prioritized + // The allocation strategy to apply to your On-Demand Instances when they are + // launched. Possible instance types are determined by the launch template + // overrides that you specify. The following lists the valid values: lowest-price + // Uses price to determine which instance types are the highest priority, launching + // the lowest priced instance types within an Availability Zone first. This is the + // default value for Auto Scaling groups that specify InstanceRequirements. + // prioritized You set the order of instance types for the launch template + // overrides from highest to lowest priority (from first to last in the list). + // Amazon EC2 Auto Scaling launches your highest priority instance types first. If + // all your On-Demand capacity cannot be fulfilled using your highest priority + // instance type, then Amazon EC2 Auto Scaling launches the remaining capacity + // using the second priority instance type, and so on. This is the default value + // for Auto Scaling groups that don't specify InstanceRequirements and cannot be + // used for groups that do. OnDemandAllocationStrategy *string // The minimum amount of the Auto Scaling group's capacity that must be fulfilled // by On-Demand Instances. This base portion is launched first as your group - // scales. If you specify weights for the instance types in the overrides, the base - // capacity is measured in the same unit of measurement as the instance types. If - // you specify InstanceRequirements in the overrides, the base capacity is measured - // in the same unit of measurement as your group's desired capacity. Default: 0 + // scales. This number has the same unit of measurement as the group's desired + // capacity. If you change the default unit of measurement (number of instances) by + // specifying weighted capacity values in your launch template overrides list, or + // by changing the default desired capacity type setting of the group, you must + // specify this number using the same unit of measurement. Default: 0 OnDemandBaseCapacity *int32 // Controls the percentages of On-Demand Instances and Spot Instances for your @@ -1147,23 +1152,35 @@ type InstancesDistribution struct { // 100, only On-Demand Instances are used. Default: 100 OnDemandPercentageAboveBaseCapacity *int32 - // Indicates how to allocate instances across Spot Instance pools. If the - // allocation strategy is lowest-price, the Auto Scaling group launches instances - // using the Spot pools with the lowest price, and evenly allocates your instances - // across the number of Spot pools that you specify. If the allocation strategy is - // capacity-optimized (recommended), the Auto Scaling group launches instances - // using Spot pools that are optimally chosen based on the available Spot capacity. - // Alternatively, you can use capacity-optimized-prioritized and set the order of - // instance types in the list of launch template overrides from highest to lowest + // The allocation strategy to apply to your Spot Instances when they are launched. + // Possible instance types are determined by the launch template overrides that you + // specify. The following lists the valid values: capacity-optimized Requests Spot + // Instances using pools that are optimally chosen based on the available Spot + // capacity. This strategy has the lowest risk of interruption. To give certain + // instance types a higher chance of launching first, use + // capacity-optimized-prioritized. capacity-optimized-prioritized You set the order + // of instance types for the launch template overrides from highest to lowest // priority (from first to last in the list). Amazon EC2 Auto Scaling honors the - // instance type priorities on a best-effort basis but optimizes for capacity - // first. Default: lowest-price Valid values: lowest-price | capacity-optimized | - // capacity-optimized-prioritized + // instance type priorities on a best effort basis but optimizes for capacity + // first. Note that if the On-Demand allocation strategy is set to prioritized, the + // same priority is applied when fulfilling On-Demand capacity. This is not a valid + // value for Auto Scaling groups that specify InstanceRequirements. lowest-price + // Requests Spot Instances using the lowest priced pools within an Availability + // Zone, across the number of Spot pools that you specify for the SpotInstancePools + // property. To ensure that your desired capacity is met, you might receive Spot + // Instances from several pools. This is the default value, but it might lead to + // high interruption rates because this strategy only considers instance price and + // not available capacity. price-capacity-optimized (recommended) Amazon EC2 Auto + // Scaling identifies the pools with the highest capacity availability for the + // number of instances that are launching. This means that we will request Spot + // Instances from the pools that we believe have the lowest chance of interruption + // in the near term. Amazon EC2 Auto Scaling then requests Spot Instances from the + // lowest priced of these pools. SpotAllocationStrategy *string // The number of Spot Instance pools across which to allocate your Spot Instances. // The Spot pools are determined from the different instance types in the - // overrides. Valid only when the Spot allocation strategy is lowest-price. Value + // overrides. Valid only when the SpotAllocationStrategy is lowest-price. Value // must be in the range of 1–20. Default: 2 SpotInstancePools *int32 diff --git a/service/cloudcontrol/internal/endpoints/endpoints.go b/service/cloudcontrol/internal/endpoints/endpoints.go index 670063169bb..115ceeeae2a 100644 --- a/service/cloudcontrol/internal/endpoints/endpoints.go +++ b/service/cloudcontrol/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/cloudformation/internal/endpoints/endpoints.go b/service/cloudformation/internal/endpoints/endpoints.go index 6b80c940c3b..bddbaad1a0c 100644 --- a/service/cloudformation/internal/endpoints/endpoints.go +++ b/service/cloudformation/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/cloudtrail/internal/endpoints/endpoints.go b/service/cloudtrail/internal/endpoints/endpoints.go index 9621feef920..21ac14abb44 100644 --- a/service/cloudtrail/internal/endpoints/endpoints.go +++ b/service/cloudtrail/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/cloudwatch/internal/endpoints/endpoints.go b/service/cloudwatch/internal/endpoints/endpoints.go index 53dd7abc1cd..185f46b857d 100644 --- a/service/cloudwatch/internal/endpoints/endpoints.go +++ b/service/cloudwatch/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/cloudwatchevents/internal/endpoints/endpoints.go b/service/cloudwatchevents/internal/endpoints/endpoints.go index 15a949de16f..f1160bd2a88 100644 --- a/service/cloudwatchevents/internal/endpoints/endpoints.go +++ b/service/cloudwatchevents/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/cloudwatchlogs/internal/endpoints/endpoints.go b/service/cloudwatchlogs/internal/endpoints/endpoints.go index cb524982da5..85cad547f92 100644 --- a/service/cloudwatchlogs/internal/endpoints/endpoints.go +++ b/service/cloudwatchlogs/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/codedeploy/internal/endpoints/endpoints.go b/service/codedeploy/internal/endpoints/endpoints.go index af032a035a3..6e6052d121f 100644 --- a/service/codedeploy/internal/endpoints/endpoints.go +++ b/service/codedeploy/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/configservice/internal/endpoints/endpoints.go b/service/configservice/internal/endpoints/endpoints.go index f09ba5c7a67..37db3c96eb4 100644 --- a/service/configservice/internal/endpoints/endpoints.go +++ b/service/configservice/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/databasemigrationservice/internal/endpoints/endpoints.go b/service/databasemigrationservice/internal/endpoints/endpoints.go index d98148632c4..ec1436863b0 100644 --- a/service/databasemigrationservice/internal/endpoints/endpoints.go +++ b/service/databasemigrationservice/internal/endpoints/endpoints.go @@ -195,6 +195,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/directconnect/internal/endpoints/endpoints.go b/service/directconnect/internal/endpoints/endpoints.go index f491539fee0..992507ae0d2 100644 --- a/service/directconnect/internal/endpoints/endpoints.go +++ b/service/directconnect/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/docdb/internal/endpoints/endpoints.go b/service/docdb/internal/endpoints/endpoints.go index 3db2525fec5..7226750fe37 100644 --- a/service/docdb/internal/endpoints/endpoints.go +++ b/service/docdb/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/dynamodb/internal/endpoints/endpoints.go b/service/dynamodb/internal/endpoints/endpoints.go index 0f35aa7353d..88c467c7353 100644 --- a/service/dynamodb/internal/endpoints/endpoints.go +++ b/service/dynamodb/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/dynamodbstreams/internal/endpoints/endpoints.go b/service/dynamodbstreams/internal/endpoints/endpoints.go index dd102719654..87fcdc24033 100644 --- a/service/dynamodbstreams/internal/endpoints/endpoints.go +++ b/service/dynamodbstreams/internal/endpoints/endpoints.go @@ -180,6 +180,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/ec2/internal/endpoints/endpoints.go b/service/ec2/internal/endpoints/endpoints.go index 30ebedc7ff7..3847bbcc845 100644 --- a/service/ec2/internal/endpoints/endpoints.go +++ b/service/ec2/internal/endpoints/endpoints.go @@ -180,6 +180,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 14aef38807e..05cce3b3f59 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -222,6 +222,7 @@ const ( AllocationStrategyDiversified AllocationStrategy = "diversified" AllocationStrategyCapacityOptimized AllocationStrategy = "capacityOptimized" AllocationStrategyCapacityOptimizedPrioritized AllocationStrategy = "capacityOptimizedPrioritized" + AllocationStrategyPriceCapacityOptimized AllocationStrategy = "priceCapacityOptimized" ) // Values returns all known values for AllocationStrategy. Note that this can be @@ -233,6 +234,7 @@ func (AllocationStrategy) Values() []AllocationStrategy { "diversified", "capacityOptimized", "capacityOptimizedPrioritized", + "priceCapacityOptimized", } } @@ -5873,6 +5875,7 @@ const ( SpotAllocationStrategyDiversified SpotAllocationStrategy = "diversified" SpotAllocationStrategyCapacityOptimized SpotAllocationStrategy = "capacity-optimized" SpotAllocationStrategyCapacityOptimizedPrioritized SpotAllocationStrategy = "capacity-optimized-prioritized" + SpotAllocationStrategyPriceCapacityOptimized SpotAllocationStrategy = "price-capacity-optimized" ) // Values returns all known values for SpotAllocationStrategy. Note that this can @@ -5884,6 +5887,7 @@ func (SpotAllocationStrategy) Values() []SpotAllocationStrategy { "diversified", "capacity-optimized", "capacity-optimized-prioritized", + "price-capacity-optimized", } } diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 6c6d5423331..25b4cfe2125 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -13194,24 +13194,36 @@ type SpotFleetRequestConfigData struct { // across the Spot Instance pools specified by the Spot Fleet launch configuration. // For more information, see Allocation strategies for Spot Instances // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-allocation-strategy.html) - // in the Amazon EC2 User Guide. lowestPrice - Spot Fleet launches instances from - // the lowest-price Spot Instance pool that has available capacity. If the cheapest - // pool doesn't have available capacity, the Spot Instances come from the next - // cheapest pool that has available capacity. If a pool runs out of capacity before - // fulfilling your desired capacity, Spot Fleet will continue to fulfill your - // request by drawing from the next cheapest pool. To ensure that your desired - // capacity is met, you might receive Spot Instances from several pools. - // diversified - Spot Fleet launches instances from all of the Spot Instance pools - // that you specify. capacityOptimized (recommended) - Spot Fleet launches - // instances from Spot Instance pools with optimal capacity for the number of - // instances that are launching. To give certain instance types a higher chance of - // launching first, use capacityOptimizedPrioritized. Set a priority for each - // instance type by using the Priority parameter for LaunchTemplateOverrides. You - // can assign the same priority to different LaunchTemplateOverrides. EC2 - // implements the priorities on a best-effort basis, but optimizes for capacity - // first. capacityOptimizedPrioritized is supported only if your Spot Fleet uses a - // launch template. Note that if the OnDemandAllocationStrategy is set to - // prioritized, the same priority is applied when fulfilling On-Demand capacity. + // in the Amazon EC2 User Guide. priceCapacityOptimized (recommended) Spot Fleet + // identifies the pools with + // + // the highest capacity availability for the number of + // instances that are launching. This means that we will request Spot Instances + // from the pools that we believe have the lowest chance of interruption in the + // near term. Spot Fleet then requests Spot Instances from the lowest priced of + // these pools. capacityOptimized Spot Fleet identifies the pools with + // + // the highest + // capacity availability for the number of instances that are launching. This means + // that we will request Spot Instances from the pools that we believe have the + // lowest chance of interruption in the near term. To give certain instance types a + // higher chance of launching first, use capacityOptimizedPrioritized. Set a + // priority for each instance type by using the Priority parameter for + // LaunchTemplateOverrides. You can assign the same priority to different + // LaunchTemplateOverrides. EC2 implements the priorities on a best-effort basis, + // but optimizes for capacity first. capacityOptimizedPrioritized is supported only + // if your Spot Fleet uses a launch template. Note that if the + // OnDemandAllocationStrategy is set to prioritized, the same priority is applied + // when fulfilling On-Demand capacity. diversified Spot Fleet requests instances + // from all of the Spot Instance pools that you specify. lowestPrice Spot Fleet + // requests instances from the lowest priced Spot Instance pool that has available + // capacity. If the lowest priced pool doesn't have available capacity, the Spot + // Instances come from the next lowest priced pool that has available capacity. If + // a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet + // will continue to fulfill your request by drawing from the next lowest priced + // pool. To ensure that your desired capacity is met, you might receive Spot + // Instances from several pools. Because this strategy only considers instance + // price and not capacity availability, it might lead to high interruption rates. // Default: lowestPrice AllocationStrategy AllocationStrategy @@ -13549,25 +13561,37 @@ type SpotOptions struct { // across the Spot Instance pools specified by the EC2 Fleet launch configuration. // For more information, see Allocation strategies for Spot Instances // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html) - // in the Amazon EC2 User Guide. lowest-price - EC2 Fleet launches instances from - // the lowest-price Spot Instance pool that has available capacity. If the cheapest - // pool doesn't have available capacity, the Spot Instances come from the next - // cheapest pool that has available capacity. If a pool runs out of capacity before - // fulfilling your desired capacity, EC2 Fleet will continue to fulfill your - // request by drawing from the next cheapest pool. To ensure that your desired - // capacity is met, you might receive Spot Instances from several pools. - // diversified - EC2 Fleet launches instances from all of the Spot Instance pools - // that you specify. capacity-optimized (recommended) - EC2 Fleet launches - // instances from Spot Instance pools with optimal capacity for the number of - // instances that are launching. To give certain instance types a higher chance of - // launching first, use capacity-optimized-prioritized. Set a priority for each - // instance type by using the Priority parameter for LaunchTemplateOverrides. You - // can assign the same priority to different LaunchTemplateOverrides. EC2 - // implements the priorities on a best-effort basis, but optimizes for capacity - // first. capacity-optimized-prioritized is supported only if your fleet uses a - // launch template. Note that if the On-Demand AllocationStrategy is set to - // prioritized, the same priority is applied when fulfilling On-Demand capacity. - // Default: lowest-price + // in the Amazon EC2 User Guide. price-capacity-optimized (recommended) EC2 Fleet + // identifies the pools with + // + // the highest capacity availability for the number of + // instances that are launching. This means that we will request Spot Instances + // from the pools that we believe have the lowest chance of interruption in the + // near term. EC2 Fleet then requests Spot Instances from the lowest priced of + // these pools. capacity-optimized EC2 Fleet identifies the pools with + // + // the highest + // capacity availability for the number of instances that are launching. This means + // that we will request Spot Instances from the pools that we believe have the + // lowest chance of interruption in the near term. To give certain instance types a + // higher chance of launching first, use capacity-optimized-prioritized. Set a + // priority for each instance type by using the Priority parameter for + // LaunchTemplateOverrides. You can assign the same priority to different + // LaunchTemplateOverrides. EC2 implements the priorities on a best-effort basis, + // but optimizes for capacity first. capacity-optimized-prioritized is supported + // only if your EC2 Fleet uses a launch template. Note that if the On-Demand + // AllocationStrategy is set to prioritized, the same priority is applied when + // fulfilling On-Demand capacity. diversified EC2 Fleet requests instances from all + // of the Spot Instance pools that you specify. lowest-price EC2 Fleet requests + // instances from the lowest priced Spot Instance pool that has available capacity. + // If the lowest priced pool doesn't have available capacity, the Spot Instances + // come from the next lowest priced pool that has available capacity. If a pool + // runs out of capacity before fulfilling your desired capacity, EC2 Fleet will + // continue to fulfill your request by drawing from the next lowest priced pool. To + // ensure that your desired capacity is met, you might receive Spot Instances from + // several pools. Because this strategy only considers instance price and not + // capacity availability, it might lead to high interruption rates. Default: + // lowest-price AllocationStrategy SpotAllocationStrategy // The behavior when a Spot Instance is interrupted. Default: terminate @@ -13621,25 +13645,37 @@ type SpotOptionsRequest struct { // across the Spot Instance pools specified by the EC2 Fleet launch configuration. // For more information, see Allocation strategies for Spot Instances // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html) - // in the Amazon EC2 User Guide. lowest-price - EC2 Fleet launches instances from - // the lowest-price Spot Instance pool that has available capacity. If the cheapest - // pool doesn't have available capacity, the Spot Instances come from the next - // cheapest pool that has available capacity. If a pool runs out of capacity before - // fulfilling your desired capacity, EC2 Fleet will continue to fulfill your - // request by drawing from the next cheapest pool. To ensure that your desired - // capacity is met, you might receive Spot Instances from several pools. - // diversified - EC2 Fleet launches instances from all of the Spot Instance pools - // that you specify. capacity-optimized (recommended) - EC2 Fleet launches - // instances from Spot Instance pools with optimal capacity for the number of - // instances that are launching. To give certain instance types a higher chance of - // launching first, use capacity-optimized-prioritized. Set a priority for each - // instance type by using the Priority parameter for LaunchTemplateOverrides. You - // can assign the same priority to different LaunchTemplateOverrides. EC2 - // implements the priorities on a best-effort basis, but optimizes for capacity - // first. capacity-optimized-prioritized is supported only if your fleet uses a - // launch template. Note that if the On-Demand AllocationStrategy is set to - // prioritized, the same priority is applied when fulfilling On-Demand capacity. - // Default: lowest-price + // in the Amazon EC2 User Guide. price-capacity-optimized (recommended) EC2 Fleet + // identifies the pools with + // + // the highest capacity availability for the number of + // instances that are launching. This means that we will request Spot Instances + // from the pools that we believe have the lowest chance of interruption in the + // near term. EC2 Fleet then requests Spot Instances from the lowest priced of + // these pools. capacity-optimized EC2 Fleet identifies the pools with + // + // the highest + // capacity availability for the number of instances that are launching. This means + // that we will request Spot Instances from the pools that we believe have the + // lowest chance of interruption in the near term. To give certain instance types a + // higher chance of launching first, use capacity-optimized-prioritized. Set a + // priority for each instance type by using the Priority parameter for + // LaunchTemplateOverrides. You can assign the same priority to different + // LaunchTemplateOverrides. EC2 implements the priorities on a best-effort basis, + // but optimizes for capacity first. capacity-optimized-prioritized is supported + // only if your EC2 Fleet uses a launch template. Note that if the On-Demand + // AllocationStrategy is set to prioritized, the same priority is applied when + // fulfilling On-Demand capacity. diversified EC2 Fleet requests instances from all + // of the Spot Instance pools that you specify. lowest-price EC2 Fleet requests + // instances from the lowest priced Spot Instance pool that has available capacity. + // If the lowest priced pool doesn't have available capacity, the Spot Instances + // come from the next lowest priced pool that has available capacity. If a pool + // runs out of capacity before fulfilling your desired capacity, EC2 Fleet will + // continue to fulfill your request by drawing from the next lowest priced pool. To + // ensure that your desired capacity is met, you might receive Spot Instances from + // several pools. Because this strategy only considers instance price and not + // capacity availability, it might lead to high interruption rates. Default: + // lowest-price AllocationStrategy SpotAllocationStrategy // The behavior when a Spot Instance is interrupted. Default: terminate diff --git a/service/ecr/internal/endpoints/endpoints.go b/service/ecr/internal/endpoints/endpoints.go index e91c8df93cc..d14592bb8dc 100644 --- a/service/ecr/internal/endpoints/endpoints.go +++ b/service/ecr/internal/endpoints/endpoints.go @@ -295,6 +295,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-central-1", }, }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "api.ecr.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{ diff --git a/service/ecs/api_op_GetTaskProtection.go b/service/ecs/api_op_GetTaskProtection.go new file mode 100644 index 00000000000..3c78fb55ffa --- /dev/null +++ b/service/ecs/api_op_GetTaskProtection.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecs + +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/ecs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the protection status of tasks in an Amazon ECS service. +func (c *Client) GetTaskProtection(ctx context.Context, params *GetTaskProtectionInput, optFns ...func(*Options)) (*GetTaskProtectionOutput, error) { + if params == nil { + params = &GetTaskProtectionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTaskProtection", params, optFns, c.addOperationGetTaskProtectionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTaskProtectionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTaskProtectionInput struct { + + // The short name or full Amazon Resource Name (ARN) of the cluster that hosts the + // service that the task sets exist in. + // + // This member is required. + Cluster *string + + // A list of up to 100 task IDs or full ARN entries. + Tasks []string + + noSmithyDocumentSerde +} + +type GetTaskProtectionOutput struct { + + // Any failures associated with the call. + Failures []types.Failure + + // A list of tasks with the following information. + // + // * taskArn: The task ARN. + // + // * + // protectionEnabled: The protection status of the task. If scale-in protection is + // enabled for a task, the value is true. Otherwise, it is false. + // + // * + // expirationDate: The epoch time when protection for the task will expire. + ProtectedTasks []types.ProtectedTask + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTaskProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTaskProtection{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTaskProtection{}, 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 = addOpGetTaskProtectionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTaskProtection(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_opGetTaskProtection(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ecs", + OperationName: "GetTaskProtection", + } +} diff --git a/service/ecs/api_op_UpdateTaskProtection.go b/service/ecs/api_op_UpdateTaskProtection.go new file mode 100644 index 00000000000..0b84f711afc --- /dev/null +++ b/service/ecs/api_op_UpdateTaskProtection.go @@ -0,0 +1,176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecs + +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/ecs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the protection status of a task. You can set protectionEnabled to true +// to protect your task from termination during scale-in events from Service +// Autoscaling +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html) +// or deployments +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html). +// Task-protection, by default, expires after 2 hours at which point Amazon ECS +// unsets the protectionEnabled property making the task eligible for termination +// by a subsequent scale-in event. You can specify a custom expiration period for +// task protection from 1 minute to up to 2,880 minutes (48 hours). To specify the +// custom expiration period, set the expiresInMinutes property. The +// expiresInMinutes property is always reset when you invoke this operation for a +// task that already has protectionEnabled set to true. You can keep extending the +// protection expiration period of a task by invoking this operation repeatedly. To +// learn more about Amazon ECS task protection, see Task scale-in protection +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-scale-in-protection.html) +// in the Amazon Elastic Container Service Developer Guide. This operation is only +// supported for tasks belonging to an Amazon ECS service. Invoking this operation +// for a standalone task will result in an TASK_NOT_VALID failure. For more +// information, see API failure reasons +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html.html). +// If you prefer to set task protection from within the container, we recommend +// using the Amazon ECS container agent endpoint +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-endpoint.html). +func (c *Client) UpdateTaskProtection(ctx context.Context, params *UpdateTaskProtectionInput, optFns ...func(*Options)) (*UpdateTaskProtectionOutput, error) { + if params == nil { + params = &UpdateTaskProtectionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateTaskProtection", params, optFns, c.addOperationUpdateTaskProtectionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateTaskProtectionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateTaskProtectionInput struct { + + // The short name or full Amazon Resource Name (ARN) of the cluster that hosts the + // service that the task sets exist in. + // + // This member is required. + Cluster *string + + // Specify true to mark a task for protection and false to unset protection, making + // it eligible for termination. + // + // This member is required. + ProtectionEnabled bool + + // A list of up to 10 task IDs or full ARN entries. + // + // This member is required. + Tasks []string + + // If you set protectionEnabled to true, you can specify the duration for task + // protection in minutes. You can specify a value from 1 minute to up to 2,880 + // minutes (48 hours). During this time, your task will not be terminated by + // scale-in events from Service Auto Scaling or deployments. After this time period + // lapses, protectionEnabled will be reset to false. If you don’t specify the time, + // then the task is automatically protected for 120 minutes (2 hours). + ExpiresInMinutes *int32 + + noSmithyDocumentSerde +} + +type UpdateTaskProtectionOutput struct { + + // Any failures associated with the call. + Failures []types.Failure + + // A list of tasks with the following information. + // + // * taskArn: The task ARN. + // + // * + // protectionEnabled: The protection status of the task. If scale-in protection is + // enabled for a task, the value is true. Otherwise, it is false. + // + // * + // expirationDate: The epoch time when protection for the task will expire. + ProtectedTasks []types.ProtectedTask + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateTaskProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateTaskProtection{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateTaskProtection{}, 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 = addOpUpdateTaskProtectionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTaskProtection(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_opUpdateTaskProtection(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ecs", + OperationName: "UpdateTaskProtection", + } +} diff --git a/service/ecs/deserializers.go b/service/ecs/deserializers.go index 7fc61d77b3e..f9001e4f347 100644 --- a/service/ecs/deserializers.go +++ b/service/ecs/deserializers.go @@ -2591,6 +2591,135 @@ func awsAwsjson11_deserializeOpErrorExecuteCommand(response *smithyhttp.Response } } +type awsAwsjson11_deserializeOpGetTaskProtection struct { +} + +func (*awsAwsjson11_deserializeOpGetTaskProtection) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetTaskProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetTaskProtection(response, &metadata) + } + output := &GetTaskProtectionOutput{} + 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_deserializeOpDocumentGetTaskProtectionOutput(&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_deserializeOpErrorGetTaskProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ClientException", errorCode): + return awsAwsjson11_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ClusterNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorClusterNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("UnsupportedFeatureException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedFeatureException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListAccountSettings struct { } @@ -6224,6 +6353,135 @@ func awsAwsjson11_deserializeOpErrorUpdateServicePrimaryTaskSet(response *smithy } } +type awsAwsjson11_deserializeOpUpdateTaskProtection struct { +} + +func (*awsAwsjson11_deserializeOpUpdateTaskProtection) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateTaskProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateTaskProtection(response, &metadata) + } + output := &UpdateTaskProtectionOutput{} + 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_deserializeOpDocumentUpdateTaskProtectionOutput(&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_deserializeOpErrorUpdateTaskProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ClientException", errorCode): + return awsAwsjson11_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ClusterNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorClusterNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("UnsupportedFeatureException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedFeatureException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpUpdateTaskSet struct { } @@ -12687,6 +12945,105 @@ func awsAwsjson11_deserializeDocumentPortMappingList(v *[]types.PortMapping, val return nil } +func awsAwsjson11_deserializeDocumentProtectedTask(v **types.ProtectedTask, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ProtectedTask + if *v == nil { + sv = &types.ProtectedTask{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expirationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "protectionEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.ProtectionEnabled = jtv + } + + case "taskArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TaskArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentProtectedTasks(v *[]types.ProtectedTask, 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.ProtectedTask + if *v == nil { + cv = []types.ProtectedTask{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProtectedTask + destAddr := &col + if err := awsAwsjson11_deserializeDocumentProtectedTask(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentProxyConfiguration(v **types.ProxyConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -17021,6 +17378,47 @@ func awsAwsjson11_deserializeOpDocumentExecuteCommandOutput(v **ExecuteCommandOu return nil } +func awsAwsjson11_deserializeOpDocumentGetTaskProtectionOutput(v **GetTaskProtectionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTaskProtectionOutput + if *v == nil { + sv = &GetTaskProtectionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failures": + if err := awsAwsjson11_deserializeDocumentFailures(&sv.Failures, value); err != nil { + return err + } + + case "protectedTasks": + if err := awsAwsjson11_deserializeDocumentProtectedTasks(&sv.ProtectedTasks, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListAccountSettingsOutput(v **ListAccountSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18195,6 +18593,47 @@ func awsAwsjson11_deserializeOpDocumentUpdateServicePrimaryTaskSetOutput(v **Upd return nil } +func awsAwsjson11_deserializeOpDocumentUpdateTaskProtectionOutput(v **UpdateTaskProtectionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateTaskProtectionOutput + if *v == nil { + sv = &UpdateTaskProtectionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failures": + if err := awsAwsjson11_deserializeDocumentFailures(&sv.Failures, value); err != nil { + return err + } + + case "protectedTasks": + if err := awsAwsjson11_deserializeDocumentProtectedTasks(&sv.ProtectedTasks, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateTaskSetOutput(v **UpdateTaskSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ecs/generated.json b/service/ecs/generated.json index 2ff7ad107a6..8d356fc4718 100644 --- a/service/ecs/generated.json +++ b/service/ecs/generated.json @@ -30,6 +30,7 @@ "api_op_DescribeTasks.go", "api_op_DiscoverPollEndpoint.go", "api_op_ExecuteCommand.go", + "api_op_GetTaskProtection.go", "api_op_ListAccountSettings.go", "api_op_ListAttributes.go", "api_op_ListClusters.go", @@ -60,6 +61,7 @@ "api_op_UpdateContainerInstancesState.go", "api_op_UpdateService.go", "api_op_UpdateServicePrimaryTaskSet.go", + "api_op_UpdateTaskProtection.go", "api_op_UpdateTaskSet.go", "deserializers.go", "doc.go", diff --git a/service/ecs/internal/endpoints/endpoints.go b/service/ecs/internal/endpoints/endpoints.go index 4f7d3c2085c..0612af225e0 100644 --- a/service/ecs/internal/endpoints/endpoints.go +++ b/service/ecs/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/ecs/serializers.go b/service/ecs/serializers.go index 40e5943b89c..f7a02fdd083 100644 --- a/service/ecs/serializers.go +++ b/service/ecs/serializers.go @@ -1172,6 +1172,61 @@ func (m *awsAwsjson11_serializeOpExecuteCommand) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetTaskProtection struct { +} + +func (*awsAwsjson11_serializeOpGetTaskProtection) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetTaskProtection) 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.(*GetTaskProtectionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("AmazonEC2ContainerServiceV20141113.GetTaskProtection") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetTaskProtectionInput(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_serializeOpListAccountSettings struct { } @@ -2822,6 +2877,61 @@ func (m *awsAwsjson11_serializeOpUpdateServicePrimaryTaskSet) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateTaskProtection struct { +} + +func (*awsAwsjson11_serializeOpUpdateTaskProtection) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateTaskProtection) 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.(*UpdateTaskProtectionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("AmazonEC2ContainerServiceV20141113.UpdateTaskProtection") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateTaskProtectionInput(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_serializeOpUpdateTaskSet struct { } @@ -5837,6 +5947,25 @@ func awsAwsjson11_serializeOpDocumentExecuteCommandInput(v *ExecuteCommandInput, return nil } +func awsAwsjson11_serializeOpDocumentGetTaskProtectionInput(v *GetTaskProtectionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Cluster != nil { + ok := object.Key("cluster") + ok.String(*v.Cluster) + } + + if v.Tasks != nil { + ok := object.Key("tasks") + if err := awsAwsjson11_serializeDocumentStringList(v.Tasks, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListAccountSettingsInput(v *ListAccountSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6974,6 +7103,35 @@ func awsAwsjson11_serializeOpDocumentUpdateServicePrimaryTaskSetInput(v *UpdateS return nil } +func awsAwsjson11_serializeOpDocumentUpdateTaskProtectionInput(v *UpdateTaskProtectionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Cluster != nil { + ok := object.Key("cluster") + ok.String(*v.Cluster) + } + + if v.ExpiresInMinutes != nil { + ok := object.Key("expiresInMinutes") + ok.Integer(*v.ExpiresInMinutes) + } + + { + ok := object.Key("protectionEnabled") + ok.Boolean(v.ProtectionEnabled) + } + + if v.Tasks != nil { + ok := object.Key("tasks") + if err := awsAwsjson11_serializeDocumentStringList(v.Tasks, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateTaskSetInput(v *UpdateTaskSetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/ecs/types/types.go b/service/ecs/types/types.go index 4e5d6040e2e..397bd36f949 100644 --- a/service/ecs/types/types.go +++ b/service/ecs/types/types.go @@ -2632,6 +2632,24 @@ type PortMapping struct { noSmithyDocumentSerde } +// An object representing the protection status details for a task. You can set the +// protection status with the UpdateTaskProtection API and get the status of tasks +// with the GetTaskProtection API. +type ProtectedTask struct { + + // The epoch time when protection for the task will expire. + ExpirationDate *time.Time + + // The protection status of the task. If scale-in protection is enabled for a task, + // the value is true. Otherwise, it is false. + ProtectionEnabled bool + + // The task ARN. + TaskArn *string + + noSmithyDocumentSerde +} + // The configuration details for the App Mesh proxy. For tasks that use the EC2 // launch type, the container instances require at least version 1.26.0 of the // container agent and at least version 1.26.0-1 of the ecs-init package to use a diff --git a/service/ecs/validators.go b/service/ecs/validators.go index b498ccf1904..257d34fd834 100644 --- a/service/ecs/validators.go +++ b/service/ecs/validators.go @@ -370,6 +370,26 @@ func (m *validateOpExecuteCommand) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpGetTaskProtection struct { +} + +func (*validateOpGetTaskProtection) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTaskProtection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTaskProtectionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTaskProtectionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAttributes struct { } @@ -810,6 +830,26 @@ func (m *validateOpUpdateServicePrimaryTaskSet) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpUpdateTaskProtection struct { +} + +func (*validateOpUpdateTaskProtection) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateTaskProtection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateTaskProtectionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateTaskProtectionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateTaskSet struct { } @@ -902,6 +942,10 @@ func addOpExecuteCommandValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpExecuteCommand{}, middleware.After) } +func addOpGetTaskProtectionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTaskProtection{}, middleware.After) +} + func addOpListAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAttributes{}, middleware.After) } @@ -990,6 +1034,10 @@ func addOpUpdateServicePrimaryTaskSetValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpUpdateServicePrimaryTaskSet{}, middleware.After) } +func addOpUpdateTaskProtectionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateTaskProtection{}, middleware.After) +} + func addOpUpdateTaskSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateTaskSet{}, middleware.After) } @@ -2250,6 +2298,21 @@ func validateOpExecuteCommandInput(v *ExecuteCommandInput) error { } } +func validateOpGetTaskProtectionInput(v *GetTaskProtectionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTaskProtectionInput"} + if v.Cluster == nil { + invalidParams.Add(smithy.NewErrParamRequired("Cluster")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAttributesInput(v *ListAttributesInput) error { if v == nil { return nil @@ -2709,6 +2772,24 @@ func validateOpUpdateServicePrimaryTaskSetInput(v *UpdateServicePrimaryTaskSetIn } } +func validateOpUpdateTaskProtectionInput(v *UpdateTaskProtectionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateTaskProtectionInput"} + if v.Cluster == nil { + invalidParams.Add(smithy.NewErrParamRequired("Cluster")) + } + if v.Tasks == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tasks")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateTaskSetInput(v *UpdateTaskSetInput) error { if v == nil { return nil diff --git a/service/efs/internal/endpoints/endpoints.go b/service/efs/internal/endpoints/endpoints.go index 88921cee569..bacfeab31e3 100644 --- a/service/efs/internal/endpoints/endpoints.go +++ b/service/efs/internal/endpoints/endpoints.go @@ -654,6 +654,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-us-iso-west-1", + }: endpoints.Endpoint{ + Hostname: "elasticfilesystem-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, @@ -663,6 +672,15 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "elasticfilesystem-fips.us-iso-east-1.c2s.ic.gov", }, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticfilesystem-fips.us-iso-west-1.c2s.ic.gov", + }, }, }, { diff --git a/service/elasticache/internal/endpoints/endpoints.go b/service/elasticache/internal/endpoints/endpoints.go index ba51fa0836d..3f6482ef3c8 100644 --- a/service/elasticache/internal/endpoints/endpoints.go +++ b/service/elasticache/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/elasticloadbalancing/internal/endpoints/endpoints.go b/service/elasticloadbalancing/internal/endpoints/endpoints.go index cd5c48f7bcb..99f39696880 100644 --- a/service/elasticloadbalancing/internal/endpoints/endpoints.go +++ b/service/elasticloadbalancing/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/elasticloadbalancingv2/internal/endpoints/endpoints.go b/service/elasticloadbalancingv2/internal/endpoints/endpoints.go index 040bb81d541..5a12669cb41 100644 --- a/service/elasticloadbalancingv2/internal/endpoints/endpoints.go +++ b/service/elasticloadbalancingv2/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/elasticsearchservice/api_op_AuthorizeVpcEndpointAccess.go b/service/elasticsearchservice/api_op_AuthorizeVpcEndpointAccess.go new file mode 100644 index 00000000000..4f6364a216d --- /dev/null +++ b/service/elasticsearchservice/api_op_AuthorizeVpcEndpointAccess.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides access to an Amazon OpenSearch Service domain through the use of an +// interface VPC endpoint. +func (c *Client) AuthorizeVpcEndpointAccess(ctx context.Context, params *AuthorizeVpcEndpointAccessInput, optFns ...func(*Options)) (*AuthorizeVpcEndpointAccessOutput, error) { + if params == nil { + params = &AuthorizeVpcEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AuthorizeVpcEndpointAccess", params, optFns, c.addOperationAuthorizeVpcEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AuthorizeVpcEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Container for request parameters to the AuthorizeVpcEndpointAccess operation. +// Specifies the account to be permitted to manage VPC endpoints against the +// domain. +type AuthorizeVpcEndpointAccessInput struct { + + // The account ID to grant access to. + // + // This member is required. + Account *string + + // The name of the OpenSearch Service domain to provide access to. + // + // This member is required. + DomainName *string + + noSmithyDocumentSerde +} + +// Container for response parameters to the AuthorizeVpcEndpointAccess operation. +// Contains the account ID and the type of the account being authorized to access +// the VPC endpoint. +type AuthorizeVpcEndpointAccessOutput struct { + + // Information about the account or service that was provided access to the domain. + // + // This member is required. + AuthorizedPrincipal *types.AuthorizedPrincipal + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAuthorizeVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAuthorizeVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess{}, 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 = addOpAuthorizeVpcEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAuthorizeVpcEndpointAccess(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_opAuthorizeVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "AuthorizeVpcEndpointAccess", + } +} diff --git a/service/elasticsearchservice/api_op_CreateVpcEndpoint.go b/service/elasticsearchservice/api_op_CreateVpcEndpoint.go new file mode 100644 index 00000000000..24ef09df734 --- /dev/null +++ b/service/elasticsearchservice/api_op_CreateVpcEndpoint.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon OpenSearch Service-managed VPC endpoint. +func (c *Client) CreateVpcEndpoint(ctx context.Context, params *CreateVpcEndpointInput, optFns ...func(*Options)) (*CreateVpcEndpointOutput, error) { + if params == nil { + params = &CreateVpcEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateVpcEndpoint", params, optFns, c.addOperationCreateVpcEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateVpcEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Container for the parameters to the CreateVpcEndpointRequest operation. +type CreateVpcEndpointInput struct { + + // The Amazon Resource Name (ARN) of the domain to grant access to. + // + // This member is required. + DomainArn *string + + // Options to specify the subnets and security groups for the endpoint. + // + // This member is required. + VpcOptions *types.VPCOptions + + // Unique, case-sensitive identifier to ensure idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +// Container for response parameters to the CreateVpcEndpoint operation. Contains +// the configuration and status of the VPC Endpoint being created. +type CreateVpcEndpointOutput struct { + + // Information about the newly created VPC endpoint. + // + // This member is required. + VpcEndpoint *types.VpcEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateVpcEndpoint{}, 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 = addOpCreateVpcEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcEndpoint(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_opCreateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "CreateVpcEndpoint", + } +} diff --git a/service/elasticsearchservice/api_op_DeleteVpcEndpoint.go b/service/elasticsearchservice/api_op_DeleteVpcEndpoint.go new file mode 100644 index 00000000000..e28d44f2ebd --- /dev/null +++ b/service/elasticsearchservice/api_op_DeleteVpcEndpoint.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Amazon OpenSearch Service-managed interface VPC endpoint. +func (c *Client) DeleteVpcEndpoint(ctx context.Context, params *DeleteVpcEndpointInput, optFns ...func(*Options)) (*DeleteVpcEndpointOutput, error) { + if params == nil { + params = &DeleteVpcEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVpcEndpoint", params, optFns, c.addOperationDeleteVpcEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVpcEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Deletes an Amazon OpenSearch Service-managed interface VPC endpoint. +type DeleteVpcEndpointInput struct { + + // The unique identifier of the endpoint to be deleted. + // + // This member is required. + VpcEndpointId *string + + noSmithyDocumentSerde +} + +// Container for response parameters to the DeleteVpcEndpoint operation. Contains +// the summarized detail of the VPC Endpoint being deleted. +type DeleteVpcEndpointOutput struct { + + // Information about the deleted endpoint, including its current status (DELETING + // or DELETE_FAILED). + // + // This member is required. + VpcEndpointSummary *types.VpcEndpointSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVpcEndpoint{}, 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 = addOpDeleteVpcEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcEndpoint(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_opDeleteVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "DeleteVpcEndpoint", + } +} diff --git a/service/elasticsearchservice/api_op_DescribeVpcEndpoints.go b/service/elasticsearchservice/api_op_DescribeVpcEndpoints.go new file mode 100644 index 00000000000..5d42b6e0dd4 --- /dev/null +++ b/service/elasticsearchservice/api_op_DescribeVpcEndpoints.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes one or more Amazon OpenSearch Service-managed VPC endpoints. +func (c *Client) DescribeVpcEndpoints(ctx context.Context, params *DescribeVpcEndpointsInput, optFns ...func(*Options)) (*DescribeVpcEndpointsOutput, error) { + if params == nil { + params = &DescribeVpcEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpoints", params, optFns, c.addOperationDescribeVpcEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeVpcEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Container for request parameters to the DescribeVpcEndpoints operation. +// Specifies the list of VPC endpoints to be described. +type DescribeVpcEndpointsInput struct { + + // The unique identifiers of the endpoints to get information about. + // + // This member is required. + VpcEndpointIds []string + + noSmithyDocumentSerde +} + +// Container for response parameters to the DescribeVpcEndpoints operation. Returns +// a list containing configuration details and status of the VPC Endpoints as well +// as a list containing error responses of the endpoints that could not be +// described +type DescribeVpcEndpointsOutput struct { + + // Any errors associated with the request. + // + // This member is required. + VpcEndpointErrors []types.VpcEndpointError + + // Information about each requested VPC endpoint. + // + // This member is required. + VpcEndpoints []types.VpcEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeVpcEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeVpcEndpoints{}, 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 = addOpDescribeVpcEndpointsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpoints(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_opDescribeVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "DescribeVpcEndpoints", + } +} diff --git a/service/elasticsearchservice/api_op_ListVpcEndpointAccess.go b/service/elasticsearchservice/api_op_ListVpcEndpointAccess.go new file mode 100644 index 00000000000..4bb78a375b6 --- /dev/null +++ b/service/elasticsearchservice/api_op_ListVpcEndpointAccess.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about each principal that is allowed to access a given +// Amazon OpenSearch Service domain through the use of an interface VPC endpoint. +func (c *Client) ListVpcEndpointAccess(ctx context.Context, params *ListVpcEndpointAccessInput, optFns ...func(*Options)) (*ListVpcEndpointAccessOutput, error) { + if params == nil { + params = &ListVpcEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpointAccess", params, optFns, c.addOperationListVpcEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVpcEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Retrieves information about each principal that is allowed to access a given +// Amazon OpenSearch Service domain through the use of an interface VPC endpoint +type ListVpcEndpointAccessInput struct { + + // The name of the OpenSearch Service domain to retrieve access information for. + // + // This member is required. + DomainName *string + + // Provides an identifier to allow retrieval of paginated results. + NextToken *string + + noSmithyDocumentSerde +} + +// Container for response parameters to the ListVpcEndpointAccess operation. +// Returns a list of accounts id and account type authorized to manage VPC +// endpoints. +type ListVpcEndpointAccessOutput struct { + + // List of AuthorizedPrincipal describing the details of the permissions to manage + // VPC endpoints against the specified domain. + // + // This member is required. + AuthorizedPrincipalList []types.AuthorizedPrincipal + + // Provides an identifier to allow retrieval of paginated results. + // + // This member is required. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpointAccess{}, 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 = addOpListVpcEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpointAccess(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_opListVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "ListVpcEndpointAccess", + } +} diff --git a/service/elasticsearchservice/api_op_ListVpcEndpoints.go b/service/elasticsearchservice/api_op_ListVpcEndpoints.go new file mode 100644 index 00000000000..c531cfa70ca --- /dev/null +++ b/service/elasticsearchservice/api_op_ListVpcEndpoints.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves all Amazon OpenSearch Service-managed VPC endpoints in the current +// account and Region. +func (c *Client) ListVpcEndpoints(ctx context.Context, params *ListVpcEndpointsInput, optFns ...func(*Options)) (*ListVpcEndpointsOutput, error) { + if params == nil { + params = &ListVpcEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpoints", params, optFns, c.addOperationListVpcEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVpcEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Container for request parameters to the ListVpcEndpoints operation. +type ListVpcEndpointsInput struct { + + // Identifier to allow retrieval of paginated results. + NextToken *string + + noSmithyDocumentSerde +} + +// Container for response parameters to the ListVpcEndpoints operation. Returns a +// list containing summarized details of the VPC endpoints. +type ListVpcEndpointsOutput struct { + + // Provides an identifier to allow retrieval of paginated results. + // + // This member is required. + NextToken *string + + // Information about each endpoint. + // + // This member is required. + VpcEndpointSummaryList []types.VpcEndpointSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpoints{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpoints(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_opListVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "ListVpcEndpoints", + } +} diff --git a/service/elasticsearchservice/api_op_ListVpcEndpointsForDomain.go b/service/elasticsearchservice/api_op_ListVpcEndpointsForDomain.go new file mode 100644 index 00000000000..3d1b8f29015 --- /dev/null +++ b/service/elasticsearchservice/api_op_ListVpcEndpointsForDomain.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves all Amazon OpenSearch Service-managed VPC endpoints associated with a +// particular domain. +func (c *Client) ListVpcEndpointsForDomain(ctx context.Context, params *ListVpcEndpointsForDomainInput, optFns ...func(*Options)) (*ListVpcEndpointsForDomainOutput, error) { + if params == nil { + params = &ListVpcEndpointsForDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpointsForDomain", params, optFns, c.addOperationListVpcEndpointsForDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVpcEndpointsForDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Container for request parameters to the ListVpcEndpointsForDomain operation. +// Specifies the domain whose VPC endpoints will be listed. +type ListVpcEndpointsForDomainInput struct { + + // Name of the ElasticSearch domain whose VPC endpoints are to be listed. + // + // This member is required. + DomainName *string + + // Provides an identifier to allow retrieval of paginated results. + NextToken *string + + noSmithyDocumentSerde +} + +// Container for response parameters to the ListVpcEndpointsForDomain operation. +// Returns a list containing summarized details of the VPC endpoints. +type ListVpcEndpointsForDomainOutput struct { + + // Information about each endpoint associated with the domain. + // + // This member is required. + NextToken *string + + // Provides list of VpcEndpointSummary summarizing details of the VPC endpoints. + // + // This member is required. + VpcEndpointSummaryList []types.VpcEndpointSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVpcEndpointsForDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpointsForDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpointsForDomain{}, 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 = addOpListVpcEndpointsForDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpointsForDomain(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_opListVpcEndpointsForDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "ListVpcEndpointsForDomain", + } +} diff --git a/service/elasticsearchservice/api_op_RevokeVpcEndpointAccess.go b/service/elasticsearchservice/api_op_RevokeVpcEndpointAccess.go new file mode 100644 index 00000000000..4cf46f78fa0 --- /dev/null +++ b/service/elasticsearchservice/api_op_RevokeVpcEndpointAccess.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Revokes access to an Amazon OpenSearch Service domain that was provided through +// an interface VPC endpoint. +func (c *Client) RevokeVpcEndpointAccess(ctx context.Context, params *RevokeVpcEndpointAccessInput, optFns ...func(*Options)) (*RevokeVpcEndpointAccessOutput, error) { + if params == nil { + params = &RevokeVpcEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RevokeVpcEndpointAccess", params, optFns, c.addOperationRevokeVpcEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RevokeVpcEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Revokes access to an Amazon OpenSearch Service domain that was provided through +// an interface VPC endpoint. +type RevokeVpcEndpointAccessInput struct { + + // The account ID to revoke access from. + // + // This member is required. + Account *string + + // The name of the OpenSearch Service domain. + // + // This member is required. + DomainName *string + + noSmithyDocumentSerde +} + +// Container for response parameters to the RevokeVpcEndpointAccess operation. The +// response body for this operation is empty. +type RevokeVpcEndpointAccessOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRevokeVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRevokeVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRevokeVpcEndpointAccess{}, 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 = addOpRevokeVpcEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeVpcEndpointAccess(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_opRevokeVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "RevokeVpcEndpointAccess", + } +} diff --git a/service/elasticsearchservice/api_op_UpdateVpcEndpoint.go b/service/elasticsearchservice/api_op_UpdateVpcEndpoint.go new file mode 100644 index 00000000000..99bb1117637 --- /dev/null +++ b/service/elasticsearchservice/api_op_UpdateVpcEndpoint.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +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/elasticsearchservice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an Amazon OpenSearch Service-managed interface VPC endpoint. +func (c *Client) UpdateVpcEndpoint(ctx context.Context, params *UpdateVpcEndpointInput, optFns ...func(*Options)) (*UpdateVpcEndpointOutput, error) { + if params == nil { + params = &UpdateVpcEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateVpcEndpoint", params, optFns, c.addOperationUpdateVpcEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateVpcEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Modifies an Amazon OpenSearch Service-managed interface VPC endpoint. +type UpdateVpcEndpointInput struct { + + // Unique identifier of the VPC endpoint to be updated. + // + // This member is required. + VpcEndpointId *string + + // The security groups and/or subnets to add, remove, or modify. + // + // This member is required. + VpcOptions *types.VPCOptions + + noSmithyDocumentSerde +} + +// Contains the configuration and status of the VPC endpoint being updated. +type UpdateVpcEndpointOutput struct { + + // The endpoint to be updated. + // + // This member is required. + VpcEndpoint *types.VpcEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateVpcEndpoint{}, 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 = addOpUpdateVpcEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVpcEndpoint(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_opUpdateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "UpdateVpcEndpoint", + } +} diff --git a/service/elasticsearchservice/deserializers.go b/service/elasticsearchservice/deserializers.go index 23476026c43..23908f7585a 100644 --- a/service/elasticsearchservice/deserializers.go +++ b/service/elasticsearchservice/deserializers.go @@ -434,6 +434,168 @@ func awsRestjson1_deserializeOpDocumentAssociatePackageOutput(v **AssociatePacka return nil } +type awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess struct { +} + +func (*awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorAuthorizeVpcEndpointAccess(response, &metadata) + } + output := &AuthorizeVpcEndpointAccessOutput{} + 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_deserializeOpDocumentAuthorizeVpcEndpointAccessOutput(&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_deserializeOpErrorAuthorizeVpcEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAuthorizeVpcEndpointAccessOutput(v **AuthorizeVpcEndpointAccessOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AuthorizeVpcEndpointAccessOutput + if *v == nil { + sv = &AuthorizeVpcEndpointAccessOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AuthorizedPrincipal": + if err := awsRestjson1_deserializeDocumentAuthorizedPrincipal(&sv.AuthorizedPrincipal, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCancelElasticsearchServiceSoftwareUpdate struct { } @@ -1104,14 +1266,14 @@ func awsRestjson1_deserializeOpDocumentCreatePackageOutput(v **CreatePackageOutp return nil } -type awsRestjson1_deserializeOpDeleteElasticsearchDomain struct { +type awsRestjson1_deserializeOpCreateVpcEndpoint struct { } -func (*awsRestjson1_deserializeOpDeleteElasticsearchDomain) ID() string { +func (*awsRestjson1_deserializeOpCreateVpcEndpoint) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteElasticsearchDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1125,9 +1287,9 @@ func (m *awsRestjson1_deserializeOpDeleteElasticsearchDomain) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateVpcEndpoint(response, &metadata) } - output := &DeleteElasticsearchDomainOutput{} + output := &CreateVpcEndpointOutput{} out.Result = output var buff [1024]byte @@ -1148,7 +1310,7 @@ func (m *awsRestjson1_deserializeOpDeleteElasticsearchDomain) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1161,7 +1323,7 @@ func (m *awsRestjson1_deserializeOpDeleteElasticsearchDomain) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1205,11 +1367,17 @@ func awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response *smithyht case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1224,7 +1392,7 @@ func awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response *smithyht } } -func awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(v **DeleteElasticsearchDomainOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateVpcEndpointOutput(v **CreateVpcEndpointOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1237,17 +1405,17 @@ func awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(v **Delet return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteElasticsearchDomainOutput + var sv *CreateVpcEndpointOutput if *v == nil { - sv = &DeleteElasticsearchDomainOutput{} + sv = &CreateVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainStatus": - if err := awsRestjson1_deserializeDocumentElasticsearchDomainStatus(&sv.DomainStatus, value); err != nil { + case "VpcEndpoint": + if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { return err } @@ -1260,14 +1428,14 @@ func awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(v **Delet return nil } -type awsRestjson1_deserializeOpDeleteElasticsearchServiceRole struct { +type awsRestjson1_deserializeOpDeleteElasticsearchDomain struct { } -func (*awsRestjson1_deserializeOpDeleteElasticsearchServiceRole) ID() string { +func (*awsRestjson1_deserializeOpDeleteElasticsearchDomain) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteElasticsearchServiceRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteElasticsearchDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1281,21 +1449,43 @@ func (m *awsRestjson1_deserializeOpDeleteElasticsearchServiceRole) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response, &metadata) } - output := &DeleteElasticsearchServiceRoleOutput{} + output := &DeleteElasticsearchDomainOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1342,6 +1532,9 @@ func awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response *smi case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1355,14 +1548,50 @@ func awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response *smi } } -type awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection struct { +func awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(v **DeleteElasticsearchDomainOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteElasticsearchDomainOutput + if *v == nil { + sv = &DeleteElasticsearchDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainStatus": + if err := awsRestjson1_deserializeDocumentElasticsearchDomainStatus(&sv.DomainStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection) ID() string { +type awsRestjson1_deserializeOpDeleteElasticsearchServiceRole struct { +} + +func (*awsRestjson1_deserializeOpDeleteElasticsearchServiceRole) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteElasticsearchServiceRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1376,7 +1605,102 @@ func (m *awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection) Ha } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteInboundCrossClusterSearchConnection(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response, &metadata) + } + output := &DeleteElasticsearchServiceRoleOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection struct { +} + +func (*awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteInboundCrossClusterSearchConnection(response, &metadata) } output := &DeleteInboundCrossClusterSearchConnectionOutput{} out.Result = output @@ -1817,6 +2141,162 @@ func awsRestjson1_deserializeOpDocumentDeletePackageOutput(v **DeletePackageOutp return nil } +type awsRestjson1_deserializeOpDeleteVpcEndpoint struct { +} + +func (*awsRestjson1_deserializeOpDeleteVpcEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteVpcEndpoint(response, &metadata) + } + output := &DeleteVpcEndpointOutput{} + 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_deserializeOpDocumentDeleteVpcEndpointOutput(&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_deserializeOpErrorDeleteVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteVpcEndpointOutput(v **DeleteVpcEndpointOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteVpcEndpointOutput + if *v == nil { + sv = &DeleteVpcEndpointOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VpcEndpointSummary": + if err := awsRestjson1_deserializeDocumentVpcEndpointSummary(&sv.VpcEndpointSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDescribeDomainAutoTunes struct { } @@ -3581,14 +4061,14 @@ func awsRestjson1_deserializeOpDocumentDescribeReservedElasticsearchInstancesOut return nil } -type awsRestjson1_deserializeOpDissociatePackage struct { +type awsRestjson1_deserializeOpDescribeVpcEndpoints struct { } -func (*awsRestjson1_deserializeOpDissociatePackage) ID() string { +func (*awsRestjson1_deserializeOpDescribeVpcEndpoints) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeVpcEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3602,9 +4082,9 @@ func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDissociatePackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeVpcEndpoints(response, &metadata) } - output := &DissociatePackageOutput{} + output := &DescribeVpcEndpointsOutput{} out.Result = output var buff [1024]byte @@ -3625,7 +4105,7 @@ func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDissociatePackageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeVpcEndpointsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3638,7 +4118,7 @@ func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDissociatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeVpcEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3679,20 +4159,181 @@ func awsRestjson1_deserializeOpErrorDissociatePackage(response *smithyhttp.Respo } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeVpcEndpointsOutput(v **DescribeVpcEndpointsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeVpcEndpointsOutput + if *v == nil { + sv = &DescribeVpcEndpointsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VpcEndpointErrors": + if err := awsRestjson1_deserializeDocumentVpcEndpointErrorList(&sv.VpcEndpointErrors, value); err != nil { + return err + } + + case "VpcEndpoints": + if err := awsRestjson1_deserializeDocumentVpcEndpoints(&sv.VpcEndpoints, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDissociatePackage struct { +} + +func (*awsRestjson1_deserializeOpDissociatePackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDissociatePackage(response, &metadata) + } + output := &DissociatePackageOutput{} + 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_deserializeOpDocumentDissociatePackageOutput(&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_deserializeOpErrorDissociatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -4416,7 +5057,490 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStat if !ok { return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) } - sv.UpgradeStep = types.UpgradeStep(jtv) + sv.UpgradeStep = types.UpgradeStep(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDomainNames struct { +} + +func (*awsRestjson1_deserializeOpListDomainNames) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListDomainNames(response, &metadata) + } + output := &ListDomainNamesOutput{} + 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_deserializeOpDocumentListDomainNamesOutput(&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_deserializeOpErrorListDomainNames(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNamesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDomainNamesOutput + if *v == nil { + sv = &ListDomainNamesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainNames": + if err := awsRestjson1_deserializeDocumentDomainInfoList(&sv.DomainNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDomainsForPackage struct { +} + +func (*awsRestjson1_deserializeOpListDomainsForPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListDomainsForPackage(response, &metadata) + } + output := &ListDomainsForPackageOutput{} + 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_deserializeOpDocumentListDomainsForPackageOutput(&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_deserializeOpErrorListDomainsForPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomainsForPackageOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDomainsForPackageOutput + if *v == nil { + sv = &ListDomainsForPackageOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainPackageDetailsList": + if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListElasticsearchInstanceTypes struct { +} + +func (*awsRestjson1_deserializeOpListElasticsearchInstanceTypes) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListElasticsearchInstanceTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListElasticsearchInstanceTypes(response, &metadata) + } + output := &ListElasticsearchInstanceTypesOutput{} + 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_deserializeOpDocumentListElasticsearchInstanceTypesOutput(&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_deserializeOpErrorListElasticsearchInstanceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListElasticsearchInstanceTypesOutput(v **ListElasticsearchInstanceTypesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListElasticsearchInstanceTypesOutput + if *v == nil { + sv = &ListElasticsearchInstanceTypesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ElasticsearchInstanceTypes": + if err := awsRestjson1_deserializeDocumentElasticsearchInstanceTypeList(&sv.ElasticsearchInstanceTypes, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) } default: @@ -4428,14 +5552,14 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStat return nil } -type awsRestjson1_deserializeOpListDomainNames struct { +type awsRestjson1_deserializeOpListElasticsearchVersions struct { } -func (*awsRestjson1_deserializeOpListDomainNames) ID() string { +func (*awsRestjson1_deserializeOpListElasticsearchVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListElasticsearchVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4449,9 +5573,9 @@ func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDomainNames(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListElasticsearchVersions(response, &metadata) } - output := &ListDomainNamesOutput{} + output := &ListElasticsearchVersionsOutput{} out.Result = output var buff [1024]byte @@ -4472,7 +5596,7 @@ func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDomainNamesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4485,7 +5609,7 @@ func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDomainNames(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListElasticsearchVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4529,6 +5653,12 @@ func awsRestjson1_deserializeOpErrorListDomainNames(response *smithyhttp.Respons case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -4542,7 +5672,7 @@ func awsRestjson1_deserializeOpErrorListDomainNames(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNamesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(v **ListElasticsearchVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4555,20 +5685,29 @@ func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNames return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDomainNamesOutput + var sv *ListElasticsearchVersionsOutput if *v == nil { - sv = &ListDomainNamesOutput{} + sv = &ListElasticsearchVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainNames": - if err := awsRestjson1_deserializeDocumentDomainInfoList(&sv.DomainNames, value); err != nil { + case "ElasticsearchVersions": + if err := awsRestjson1_deserializeDocumentElasticsearchVersionList(&sv.ElasticsearchVersions, value); err != nil { return err } + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -4578,14 +5717,14 @@ func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNames return nil } -type awsRestjson1_deserializeOpListDomainsForPackage struct { +type awsRestjson1_deserializeOpListPackagesForDomain struct { } -func (*awsRestjson1_deserializeOpListDomainsForPackage) ID() string { +func (*awsRestjson1_deserializeOpListPackagesForDomain) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4599,9 +5738,9 @@ func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDomainsForPackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPackagesForDomain(response, &metadata) } - output := &ListDomainsForPackageOutput{} + output := &ListPackagesForDomainOutput{} out.Result = output var buff [1024]byte @@ -4622,7 +5761,7 @@ func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4635,7 +5774,7 @@ func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDomainsForPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4701,7 +5840,7 @@ func awsRestjson1_deserializeOpErrorListDomainsForPackage(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomainsForPackageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPackagesForDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4714,9 +5853,9 @@ func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDomainsForPackageOutput + var sv *ListPackagesForDomainOutput if *v == nil { - sv = &ListDomainsForPackageOutput{} + sv = &ListPackagesForDomainOutput{} } else { sv = *v } @@ -4746,14 +5885,14 @@ func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomai return nil } -type awsRestjson1_deserializeOpListElasticsearchInstanceTypes struct { +type awsRestjson1_deserializeOpListTags struct { } -func (*awsRestjson1_deserializeOpListElasticsearchInstanceTypes) ID() string { +func (*awsRestjson1_deserializeOpListTags) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListElasticsearchInstanceTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4767,9 +5906,9 @@ func (m *awsRestjson1_deserializeOpListElasticsearchInstanceTypes) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListElasticsearchInstanceTypes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTags(response, &metadata) } - output := &ListElasticsearchInstanceTypesOutput{} + output := &ListTagsOutput{} out.Result = output var buff [1024]byte @@ -4790,7 +5929,7 @@ func (m *awsRestjson1_deserializeOpListElasticsearchInstanceTypes) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListElasticsearchInstanceTypesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4803,7 +5942,7 @@ func (m *awsRestjson1_deserializeOpListElasticsearchInstanceTypes) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorListElasticsearchInstanceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4866,7 +6005,7 @@ func awsRestjson1_deserializeOpErrorListElasticsearchInstanceTypes(response *smi } } -func awsRestjson1_deserializeOpDocumentListElasticsearchInstanceTypesOutput(v **ListElasticsearchInstanceTypesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4879,29 +6018,20 @@ func awsRestjson1_deserializeOpDocumentListElasticsearchInstanceTypesOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListElasticsearchInstanceTypesOutput + var sv *ListTagsOutput if *v == nil { - sv = &ListElasticsearchInstanceTypesOutput{} + sv = &ListTagsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ElasticsearchInstanceTypes": - if err := awsRestjson1_deserializeDocumentElasticsearchInstanceTypeList(&sv.ElasticsearchInstanceTypes, value); err != nil { + case "TagList": + if err := awsRestjson1_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4911,14 +6041,14 @@ func awsRestjson1_deserializeOpDocumentListElasticsearchInstanceTypesOutput(v ** return nil } -type awsRestjson1_deserializeOpListElasticsearchVersions struct { +type awsRestjson1_deserializeOpListVpcEndpointAccess struct { } -func (*awsRestjson1_deserializeOpListElasticsearchVersions) ID() string { +func (*awsRestjson1_deserializeOpListVpcEndpointAccess) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListElasticsearchVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListVpcEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4932,9 +6062,9 @@ func (m *awsRestjson1_deserializeOpListElasticsearchVersions) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListElasticsearchVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListVpcEndpointAccess(response, &metadata) } - output := &ListElasticsearchVersionsOutput{} + output := &ListVpcEndpointAccessOutput{} out.Result = output var buff [1024]byte @@ -4955,7 +6085,7 @@ func (m *awsRestjson1_deserializeOpListElasticsearchVersions) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListVpcEndpointAccessOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4968,7 +6098,7 @@ func (m *awsRestjson1_deserializeOpListElasticsearchVersions) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListElasticsearchVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListVpcEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5012,15 +6142,15 @@ func awsRestjson1_deserializeOpErrorListElasticsearchVersions(response *smithyht case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5031,7 +6161,7 @@ func awsRestjson1_deserializeOpErrorListElasticsearchVersions(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(v **ListElasticsearchVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListVpcEndpointAccessOutput(v **ListVpcEndpointAccessOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5044,17 +6174,17 @@ func awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(v **ListE return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListElasticsearchVersionsOutput + var sv *ListVpcEndpointAccessOutput if *v == nil { - sv = &ListElasticsearchVersionsOutput{} + sv = &ListVpcEndpointAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ElasticsearchVersions": - if err := awsRestjson1_deserializeDocumentElasticsearchVersionList(&sv.ElasticsearchVersions, value); err != nil { + case "AuthorizedPrincipalList": + if err := awsRestjson1_deserializeDocumentAuthorizedPrincipalList(&sv.AuthorizedPrincipalList, value); err != nil { return err } @@ -5076,14 +6206,14 @@ func awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(v **ListE return nil } -type awsRestjson1_deserializeOpListPackagesForDomain struct { +type awsRestjson1_deserializeOpListVpcEndpoints struct { } -func (*awsRestjson1_deserializeOpListPackagesForDomain) ID() string { +func (*awsRestjson1_deserializeOpListVpcEndpoints) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListVpcEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5097,9 +6227,9 @@ func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPackagesForDomain(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListVpcEndpoints(response, &metadata) } - output := &ListPackagesForDomainOutput{} + output := &ListVpcEndpointsOutput{} out.Result = output var buff [1024]byte @@ -5120,7 +6250,7 @@ func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListVpcEndpointsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5133,7 +6263,7 @@ func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListVpcEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5174,21 +6304,15 @@ func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.R } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5199,7 +6323,7 @@ func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPackagesForDomainOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListVpcEndpointsOutput(v **ListVpcEndpointsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5212,29 +6336,29 @@ func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPacka return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPackagesForDomainOutput + var sv *ListVpcEndpointsOutput if *v == nil { - sv = &ListPackagesForDomainOutput{} + sv = &ListVpcEndpointsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainPackageDetailsList": - if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, 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) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } + case "VpcEndpointSummaryList": + if err := awsRestjson1_deserializeDocumentVpcEndpointSummaryList(&sv.VpcEndpointSummaryList, value); err != nil { + return err + } + default: _, _ = key, value @@ -5244,14 +6368,14 @@ func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPacka return nil } -type awsRestjson1_deserializeOpListTags struct { +type awsRestjson1_deserializeOpListVpcEndpointsForDomain struct { } -func (*awsRestjson1_deserializeOpListTags) ID() string { +func (*awsRestjson1_deserializeOpListVpcEndpointsForDomain) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListVpcEndpointsForDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5265,9 +6389,9 @@ func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTags(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListVpcEndpointsForDomain(response, &metadata) } - output := &ListTagsOutput{} + output := &ListVpcEndpointsForDomainOutput{} out.Result = output var buff [1024]byte @@ -5288,7 +6412,7 @@ func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListVpcEndpointsForDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5301,7 +6425,7 @@ func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListVpcEndpointsForDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5345,15 +6469,15 @@ func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, meta case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5364,7 +6488,7 @@ func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListVpcEndpointsForDomainOutput(v **ListVpcEndpointsForDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5377,17 +6501,26 @@ func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsOutput + var sv *ListVpcEndpointsForDomainOutput if *v == nil { - sv = &ListTagsOutput{} + sv = &ListVpcEndpointsForDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "TagList": - if err := awsRestjson1_deserializeDocumentTagList(&sv.TagList, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "VpcEndpointSummaryList": + if err := awsRestjson1_deserializeDocumentVpcEndpointSummaryList(&sv.VpcEndpointSummaryList, value); err != nil { return err } @@ -5716,23 +6849,118 @@ func awsRestjson1_deserializeOpDocumentRejectInboundCrossClusterSearchConnection return err } - default: - _, _ = key, value + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRemoveTags struct { +} + +func (*awsRestjson1_deserializeOpRemoveTags) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRemoveTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorRemoveTags(response, &metadata) + } + output := &RemoveTagsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } - *v = sv - return nil } -type awsRestjson1_deserializeOpRemoveTags struct { +type awsRestjson1_deserializeOpRevokeVpcEndpointAccess struct { } -func (*awsRestjson1_deserializeOpRemoveTags) ID() string { +func (*awsRestjson1_deserializeOpRevokeVpcEndpointAccess) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRemoveTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRevokeVpcEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5746,21 +6974,15 @@ func (m *awsRestjson1_deserializeOpRemoveTags) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRemoveTags(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRevokeVpcEndpointAccess(response, &metadata) } - output := &RemoveTagsOutput{} + output := &RevokeVpcEndpointAccessOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - return out, metadata, err } -func awsRestjson1_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRevokeVpcEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5804,9 +7026,15 @@ func awsRestjson1_deserializeOpErrorRemoveTags(response *smithyhttp.Response, me case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -6305,6 +7533,168 @@ func awsRestjson1_deserializeOpDocumentUpdatePackageOutput(v **UpdatePackageOutp return nil } +type awsRestjson1_deserializeOpUpdateVpcEndpoint struct { +} + +func (*awsRestjson1_deserializeOpUpdateVpcEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateVpcEndpoint(response, &metadata) + } + output := &UpdateVpcEndpointOutput{} + 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_deserializeOpDocumentUpdateVpcEndpointOutput(&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_deserializeOpErrorUpdateVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndpointOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateVpcEndpointOutput + if *v == nil { + sv = &UpdateVpcEndpointOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VpcEndpoint": + if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpUpgradeElasticsearchDomain struct { } @@ -7247,7 +8637,90 @@ func awsRestjson1_deserializeDocumentAdvancedSecurityOptionsStatus(v **types.Adv } } - *v = sv + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizedPrincipal(v **types.AuthorizedPrincipal, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AuthorizedPrincipal + if *v == nil { + sv = &types.AuthorizedPrincipal{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Principal": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Principal = ptr.String(jtv) + } + + case "PrincipalType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PrincipalType to be of type string, got %T instead", value) + } + sv.PrincipalType = types.PrincipalType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizedPrincipalList(v *[]types.AuthorizedPrincipal, 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.AuthorizedPrincipal + if *v == nil { + cv = []types.AuthorizedPrincipal{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuthorizedPrincipal + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuthorizedPrincipal(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } @@ -12652,6 +14125,314 @@ func awsRestjson1_deserializeDocumentVPCDerivedInfoStatus(v **types.VPCDerivedIn return nil } +func awsRestjson1_deserializeDocumentVpcEndpoint(v **types.VpcEndpoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcEndpoint + if *v == nil { + sv = &types.VpcEndpoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "Endpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Endpoint to be of type string, got %T instead", value) + } + sv.Endpoint = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) + } + sv.Status = types.VpcEndpointStatus(jtv) + } + + case "VpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + case "VpcEndpointOwner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AWSAccount to be of type string, got %T instead", value) + } + sv.VpcEndpointOwner = ptr.String(jtv) + } + + case "VpcOptions": + if err := awsRestjson1_deserializeDocumentVPCDerivedInfo(&sv.VpcOptions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointError(v **types.VpcEndpointError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcEndpointError + if *v == nil { + sv = &types.VpcEndpointError{} + } 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 VpcEndpointErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.VpcEndpointErrorCode(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 "VpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointErrorList(v *[]types.VpcEndpointError, 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.VpcEndpointError + if *v == nil { + cv = []types.VpcEndpointError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcEndpointError + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcEndpointError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpoints(v *[]types.VpcEndpoint, 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.VpcEndpoint + if *v == nil { + cv = []types.VpcEndpoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcEndpoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcEndpoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointSummary(v **types.VpcEndpointSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcEndpointSummary + if *v == nil { + sv = &types.VpcEndpointSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) + } + sv.Status = types.VpcEndpointStatus(jtv) + } + + case "VpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + case "VpcEndpointOwner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VpcEndpointOwner = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointSummaryList(v *[]types.VpcEndpointSummary, 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.VpcEndpointSummary + if *v == nil { + cv = []types.VpcEndpointSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcEndpointSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcEndpointSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentZoneAwarenessConfig(v **types.ZoneAwarenessConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/elasticsearchservice/generated.json b/service/elasticsearchservice/generated.json index 41d46ec90c2..c051d2e6193 100644 --- a/service/elasticsearchservice/generated.json +++ b/service/elasticsearchservice/generated.json @@ -11,15 +11,18 @@ "api_op_AcceptInboundCrossClusterSearchConnection.go", "api_op_AddTags.go", "api_op_AssociatePackage.go", + "api_op_AuthorizeVpcEndpointAccess.go", "api_op_CancelElasticsearchServiceSoftwareUpdate.go", "api_op_CreateElasticsearchDomain.go", "api_op_CreateOutboundCrossClusterSearchConnection.go", "api_op_CreatePackage.go", + "api_op_CreateVpcEndpoint.go", "api_op_DeleteElasticsearchDomain.go", "api_op_DeleteElasticsearchServiceRole.go", "api_op_DeleteInboundCrossClusterSearchConnection.go", "api_op_DeleteOutboundCrossClusterSearchConnection.go", "api_op_DeletePackage.go", + "api_op_DeleteVpcEndpoint.go", "api_op_DescribeDomainAutoTunes.go", "api_op_DescribeDomainChangeProgress.go", "api_op_DescribeElasticsearchDomain.go", @@ -31,6 +34,7 @@ "api_op_DescribePackages.go", "api_op_DescribeReservedElasticsearchInstanceOfferings.go", "api_op_DescribeReservedElasticsearchInstances.go", + "api_op_DescribeVpcEndpoints.go", "api_op_DissociatePackage.go", "api_op_GetCompatibleElasticsearchVersions.go", "api_op_GetPackageVersionHistory.go", @@ -42,12 +46,17 @@ "api_op_ListElasticsearchVersions.go", "api_op_ListPackagesForDomain.go", "api_op_ListTags.go", + "api_op_ListVpcEndpointAccess.go", + "api_op_ListVpcEndpoints.go", + "api_op_ListVpcEndpointsForDomain.go", "api_op_PurchaseReservedElasticsearchInstanceOffering.go", "api_op_RejectInboundCrossClusterSearchConnection.go", "api_op_RemoveTags.go", + "api_op_RevokeVpcEndpointAccess.go", "api_op_StartElasticsearchServiceSoftwareUpdate.go", "api_op_UpdateElasticsearchDomainConfig.go", "api_op_UpdatePackage.go", + "api_op_UpdateVpcEndpoint.go", "api_op_UpgradeElasticsearchDomain.go", "deserializers.go", "doc.go", diff --git a/service/elasticsearchservice/internal/endpoints/endpoints.go b/service/elasticsearchservice/internal/endpoints/endpoints.go index b11e7abc325..9da0bfcf48a 100644 --- a/service/elasticsearchservice/internal/endpoints/endpoints.go +++ b/service/elasticsearchservice/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/elasticsearchservice/serializers.go b/service/elasticsearchservice/serializers.go index 424658cb60b..00ec96bc647 100644 --- a/service/elasticsearchservice/serializers.go +++ b/service/elasticsearchservice/serializers.go @@ -215,6 +215,87 @@ func awsRestjson1_serializeOpHttpBindingsAssociatePackageInput(v *AssociatePacka return nil } +type awsRestjson1_serializeOpAuthorizeVpcEndpointAccess struct { +} + +func (*awsRestjson1_serializeOpAuthorizeVpcEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAuthorizeVpcEndpointAccess) 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.(*AuthorizeVpcEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/domain/{DomainName}/authorizeVpcEndpointAccess") + 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_serializeOpHttpBindingsAuthorizeVpcEndpointAccessInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAuthorizeVpcEndpointAccessInput(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_serializeOpHttpBindingsAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Account != nil { + ok := object.Key("Account") + ok.String(*v.Account) + } + + return nil +} + type awsRestjson1_serializeOpCancelElasticsearchServiceSoftwareUpdate struct { } @@ -619,6 +700,86 @@ func awsRestjson1_serializeOpDocumentCreatePackageInput(v *CreatePackageInput, v return nil } +type awsRestjson1_serializeOpCreateVpcEndpoint struct { +} + +func (*awsRestjson1_serializeOpCreateVpcEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateVpcEndpoint) 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.(*CreateVpcEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/vpcEndpoints") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateVpcEndpointInput(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_serializeOpHttpBindingsCreateVpcEndpointInput(v *CreateVpcEndpointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateVpcEndpointInput(v *CreateVpcEndpointInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DomainArn != nil { + ok := object.Key("DomainArn") + ok.String(*v.DomainArn) + } + + if v.VpcOptions != nil { + ok := object.Key("VpcOptions") + if err := awsRestjson1_serializeDocumentVPCOptions(v.VpcOptions, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteElasticsearchDomain struct { } @@ -896,6 +1057,64 @@ func awsRestjson1_serializeOpHttpBindingsDeletePackageInput(v *DeletePackageInpu return nil } +type awsRestjson1_serializeOpDeleteVpcEndpoint struct { +} + +func (*awsRestjson1_serializeOpDeleteVpcEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVpcEndpoint) 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.(*DeleteVpcEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/vpcEndpoints/{VpcEndpointId}") + 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_serializeOpHttpBindingsDeleteVpcEndpointInput(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_serializeOpHttpBindingsDeleteVpcEndpointInput(v *DeleteVpcEndpointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VpcEndpointId == nil || len(*v.VpcEndpointId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VpcEndpointId must not be empty")} + } + if v.VpcEndpointId != nil { + if err := encoder.SetURI("VpcEndpointId").String(*v.VpcEndpointId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeDomainAutoTunes struct { } @@ -1663,6 +1882,76 @@ func awsRestjson1_serializeOpHttpBindingsDescribeReservedElasticsearchInstancesI return nil } +type awsRestjson1_serializeOpDescribeVpcEndpoints struct { +} + +func (*awsRestjson1_serializeOpDescribeVpcEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeVpcEndpoints) 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.(*DescribeVpcEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/vpcEndpoints/describe") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDescribeVpcEndpointsInput(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_serializeOpHttpBindingsDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VpcEndpointIds != nil { + ok := object.Key("VpcEndpointIds") + if err := awsRestjson1_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDissociatePackage struct { } @@ -2338,14 +2627,14 @@ func awsRestjson1_serializeOpHttpBindingsListTagsInput(v *ListTagsInput, encoder return nil } -type awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering struct { +type awsRestjson1_serializeOpListVpcEndpointAccess struct { } -func (*awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering) ID() string { +func (*awsRestjson1_serializeOpListVpcEndpointAccess) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListVpcEndpointAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2353,29 +2642,22 @@ func (m *awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering) return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PurchaseReservedElasticsearchInstanceOfferingInput) + input, ok := in.Parameters.(*ListVpcEndpointAccessInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/purchaseReservedInstanceOffering") + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/domain/{DomainName}/listVpcEndpointAccess") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + 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} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentPurchaseReservedElasticsearchInstanceOfferingInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListVpcEndpointAccessInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2386,13 +2668,197 @@ func (m *awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering) return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsPurchaseReservedElasticsearchInstanceOfferingInput(v *PurchaseReservedElasticsearchInstanceOfferingInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListVpcEndpointAccessInput(v *ListVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListVpcEndpoints struct { +} + +func (*awsRestjson1_serializeOpListVpcEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListVpcEndpoints) 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.(*ListVpcEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/vpcEndpoints") + 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_serializeOpHttpBindingsListVpcEndpointsInput(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_serializeOpHttpBindingsListVpcEndpointsInput(v *ListVpcEndpointsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListVpcEndpointsForDomain struct { +} + +func (*awsRestjson1_serializeOpListVpcEndpointsForDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListVpcEndpointsForDomain) 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.(*ListVpcEndpointsForDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/domain/{DomainName}/vpcEndpoints") + 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_serializeOpHttpBindingsListVpcEndpointsForDomainInput(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_serializeOpHttpBindingsListVpcEndpointsForDomainInput(v *ListVpcEndpointsForDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering struct { +} + +func (*awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPurchaseReservedElasticsearchInstanceOffering) 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.(*PurchaseReservedElasticsearchInstanceOfferingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/purchaseReservedInstanceOffering") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPurchaseReservedElasticsearchInstanceOfferingInput(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_serializeOpHttpBindingsPurchaseReservedElasticsearchInstanceOfferingInput(v *PurchaseReservedElasticsearchInstanceOfferingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} func awsRestjson1_serializeOpDocumentPurchaseReservedElasticsearchInstanceOfferingInput(v *PurchaseReservedElasticsearchInstanceOfferingInput, value smithyjson.Value) error { object := value.Object() @@ -2549,6 +3015,87 @@ func awsRestjson1_serializeOpDocumentRemoveTagsInput(v *RemoveTagsInput, value s return nil } +type awsRestjson1_serializeOpRevokeVpcEndpointAccess struct { +} + +func (*awsRestjson1_serializeOpRevokeVpcEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRevokeVpcEndpointAccess) 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.(*RevokeVpcEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/domain/{DomainName}/revokeVpcEndpointAccess") + 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_serializeOpHttpBindingsRevokeVpcEndpointAccessInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRevokeVpcEndpointAccessInput(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_serializeOpHttpBindingsRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Account != nil { + ok := object.Key("Account") + ok.String(*v.Account) + } + + return nil +} + type awsRestjson1_serializeOpStartElasticsearchServiceSoftwareUpdate struct { } @@ -2872,6 +3419,81 @@ func awsRestjson1_serializeOpDocumentUpdatePackageInput(v *UpdatePackageInput, v return nil } +type awsRestjson1_serializeOpUpdateVpcEndpoint struct { +} + +func (*awsRestjson1_serializeOpUpdateVpcEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateVpcEndpoint) 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.(*UpdateVpcEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2015-01-01/es/vpcEndpoints/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateVpcEndpointInput(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_serializeOpHttpBindingsUpdateVpcEndpointInput(v *UpdateVpcEndpointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateVpcEndpointInput(v *UpdateVpcEndpointInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VpcEndpointId != nil { + ok := object.Key("VpcEndpointId") + ok.String(*v.VpcEndpointId) + } + + if v.VpcOptions != nil { + ok := object.Key("VpcOptions") + if err := awsRestjson1_serializeDocumentVPCOptions(v.VpcOptions, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpgradeElasticsearchDomain struct { } @@ -3595,6 +4217,17 @@ func awsRestjson1_serializeDocumentValueStringList(v []string, value smithyjson. return nil } +func awsRestjson1_serializeDocumentVpcEndpointIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsRestjson1_serializeDocumentVPCOptions(v *types.VPCOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/elasticsearchservice/types/enums.go b/service/elasticsearchservice/types/enums.go index 4949ea9e11a..2da0f6f540b 100644 --- a/service/elasticsearchservice/types/enums.go +++ b/service/elasticsearchservice/types/enums.go @@ -470,6 +470,24 @@ func (PackageType) Values() []PackageType { } } +type PrincipalType string + +// Enum values for PrincipalType +const ( + PrincipalTypeAwsAccount PrincipalType = "AWS_ACCOUNT" + PrincipalTypeAwsService PrincipalType = "AWS_SERVICE" +) + +// Values returns all known values for PrincipalType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PrincipalType) Values() []PrincipalType { + return []PrincipalType{ + "AWS_ACCOUNT", + "AWS_SERVICE", + } +} + type ReservedElasticsearchInstancePaymentOption string // Enum values for ReservedElasticsearchInstancePaymentOption @@ -645,3 +663,49 @@ func (VolumeType) Values() []VolumeType { "gp3", } } + +type VpcEndpointErrorCode string + +// Enum values for VpcEndpointErrorCode +const ( + VpcEndpointErrorCodeEndpointNotFound VpcEndpointErrorCode = "ENDPOINT_NOT_FOUND" + VpcEndpointErrorCodeServerError VpcEndpointErrorCode = "SERVER_ERROR" +) + +// Values returns all known values for VpcEndpointErrorCode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (VpcEndpointErrorCode) Values() []VpcEndpointErrorCode { + return []VpcEndpointErrorCode{ + "ENDPOINT_NOT_FOUND", + "SERVER_ERROR", + } +} + +type VpcEndpointStatus string + +// Enum values for VpcEndpointStatus +const ( + VpcEndpointStatusCreating VpcEndpointStatus = "CREATING" + VpcEndpointStatusCreateFailed VpcEndpointStatus = "CREATE_FAILED" + VpcEndpointStatusActive VpcEndpointStatus = "ACTIVE" + VpcEndpointStatusUpdating VpcEndpointStatus = "UPDATING" + VpcEndpointStatusUpdateFailed VpcEndpointStatus = "UPDATE_FAILED" + VpcEndpointStatusDeleting VpcEndpointStatus = "DELETING" + VpcEndpointStatusDeleteFailed VpcEndpointStatus = "DELETE_FAILED" +) + +// Values returns all known values for VpcEndpointStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (VpcEndpointStatus) Values() []VpcEndpointStatus { + return []VpcEndpointStatus{ + "CREATING", + "CREATE_FAILED", + "ACTIVE", + "UPDATING", + "UPDATE_FAILED", + "DELETING", + "DELETE_FAILED", + } +} diff --git a/service/elasticsearchservice/types/types.go b/service/elasticsearchservice/types/types.go index f4de6c739fa..d4ba739bbc8 100644 --- a/service/elasticsearchservice/types/types.go +++ b/service/elasticsearchservice/types/types.go @@ -152,6 +152,19 @@ type AdvancedSecurityOptionsStatus struct { noSmithyDocumentSerde } +// Information about an account or service that has access to an Amazon OpenSearch +// Service domain through the use of an interface VPC endpoint. +type AuthorizedPrincipal struct { + + // The IAM principal that is allowed access to the domain. + Principal *string + + // The type of principal. + PrincipalType PrincipalType + + noSmithyDocumentSerde +} + // Specifies Auto-Tune type and Auto-Tune action details. type AutoTune struct { @@ -1678,6 +1691,66 @@ type VPCDerivedInfoStatus struct { noSmithyDocumentSerde } +// The connection endpoint for connecting to an Amazon OpenSearch Service domain +// through a proxy. +type VpcEndpoint struct { + + // The Amazon Resource Name (ARN) of the domain associated with the endpoint. + DomainArn *string + + // The connection endpoint ID for connecting to the domain. + Endpoint *string + + // The current status of the endpoint. + Status VpcEndpointStatus + + // The unique identifier of the endpoint. + VpcEndpointId *string + + // The creator of the endpoint. + VpcEndpointOwner *string + + // Options to specify the subnets and security groups for an Amazon OpenSearch + // Service VPC endpoint. + VpcOptions *VPCDerivedInfo + + noSmithyDocumentSerde +} + +// Error information when attempting to describe an Amazon OpenSearch +// Service-managed VPC endpoint. +type VpcEndpointError struct { + + // The code associated with the error. + ErrorCode VpcEndpointErrorCode + + // A message describing the error. + ErrorMessage *string + + // The unique identifier of the endpoint. + VpcEndpointId *string + + noSmithyDocumentSerde +} + +// Summary information for an Amazon OpenSearch Service-managed VPC endpoint. +type VpcEndpointSummary struct { + + // The Amazon Resource Name (ARN) of the domain associated with the endpoint. + DomainArn *string + + // The current status of the endpoint. + Status VpcEndpointStatus + + // The unique identifier of the endpoint. + VpcEndpointId *string + + // The creator of the endpoint. + VpcEndpointOwner *string + + noSmithyDocumentSerde +} + // Options to specify the subnets and security groups for VPC endpoint. For more // information, see VPC Endpoints for Amazon Elasticsearch Service Domains // (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html). diff --git a/service/elasticsearchservice/validators.go b/service/elasticsearchservice/validators.go index 6a2413771da..a42027c563d 100644 --- a/service/elasticsearchservice/validators.go +++ b/service/elasticsearchservice/validators.go @@ -70,6 +70,26 @@ func (m *validateOpAssociatePackage) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpAuthorizeVpcEndpointAccess struct { +} + +func (*validateOpAuthorizeVpcEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAuthorizeVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AuthorizeVpcEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAuthorizeVpcEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCancelElasticsearchServiceSoftwareUpdate struct { } @@ -150,6 +170,26 @@ func (m *validateOpCreatePackage) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpCreateVpcEndpoint struct { +} + +func (*validateOpCreateVpcEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateVpcEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateVpcEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteElasticsearchDomain struct { } @@ -230,6 +270,26 @@ func (m *validateOpDeletePackage) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteVpcEndpoint struct { +} + +func (*validateOpDeleteVpcEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVpcEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVpcEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeDomainAutoTunes struct { } @@ -350,6 +410,26 @@ func (m *validateOpDescribeElasticsearchInstanceTypeLimits) HandleInitialize(ctx return next.HandleInitialize(ctx, in) } +type validateOpDescribeVpcEndpoints struct { +} + +func (*validateOpDescribeVpcEndpoints) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeVpcEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeVpcEndpointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeVpcEndpointsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDissociatePackage struct { } @@ -510,6 +590,46 @@ func (m *validateOpListTags) HandleInitialize(ctx context.Context, in middleware return next.HandleInitialize(ctx, in) } +type validateOpListVpcEndpointAccess struct { +} + +func (*validateOpListVpcEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListVpcEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListVpcEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListVpcEndpointsForDomain struct { +} + +func (*validateOpListVpcEndpointsForDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListVpcEndpointsForDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListVpcEndpointsForDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListVpcEndpointsForDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPurchaseReservedElasticsearchInstanceOffering struct { } @@ -570,6 +690,26 @@ func (m *validateOpRemoveTags) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpRevokeVpcEndpointAccess struct { +} + +func (*validateOpRevokeVpcEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRevokeVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RevokeVpcEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRevokeVpcEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartElasticsearchServiceSoftwareUpdate struct { } @@ -630,6 +770,26 @@ func (m *validateOpUpdatePackage) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateVpcEndpoint struct { +} + +func (*validateOpUpdateVpcEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateVpcEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateVpcEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpgradeElasticsearchDomain struct { } @@ -662,6 +822,10 @@ func addOpAssociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociatePackage{}, middleware.After) } +func addOpAuthorizeVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAuthorizeVpcEndpointAccess{}, middleware.After) +} + func addOpCancelElasticsearchServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelElasticsearchServiceSoftwareUpdate{}, middleware.After) } @@ -678,6 +842,10 @@ func addOpCreatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePackage{}, middleware.After) } +func addOpCreateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateVpcEndpoint{}, middleware.After) +} + func addOpDeleteElasticsearchDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteElasticsearchDomain{}, middleware.After) } @@ -694,6 +862,10 @@ func addOpDeletePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePackage{}, middleware.After) } +func addOpDeleteVpcEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVpcEndpoint{}, middleware.After) +} + func addOpDescribeDomainAutoTunesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomainAutoTunes{}, middleware.After) } @@ -718,6 +890,10 @@ func addOpDescribeElasticsearchInstanceTypeLimitsValidationMiddleware(stack *mid return stack.Initialize.Add(&validateOpDescribeElasticsearchInstanceTypeLimits{}, middleware.After) } +func addOpDescribeVpcEndpointsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeVpcEndpoints{}, middleware.After) +} + func addOpDissociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDissociatePackage{}, middleware.After) } @@ -750,6 +926,14 @@ func addOpListTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTags{}, middleware.After) } +func addOpListVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListVpcEndpointAccess{}, middleware.After) +} + +func addOpListVpcEndpointsForDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListVpcEndpointsForDomain{}, middleware.After) +} + func addOpPurchaseReservedElasticsearchInstanceOfferingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPurchaseReservedElasticsearchInstanceOffering{}, middleware.After) } @@ -762,6 +946,10 @@ func addOpRemoveTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveTags{}, middleware.After) } +func addOpRevokeVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRevokeVpcEndpointAccess{}, middleware.After) +} + func addOpStartElasticsearchServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartElasticsearchServiceSoftwareUpdate{}, middleware.After) } @@ -774,6 +962,10 @@ func addOpUpdatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePackage{}, middleware.After) } +func addOpUpdateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateVpcEndpoint{}, middleware.After) +} + func addOpUpgradeElasticsearchDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpgradeElasticsearchDomain{}, middleware.After) } @@ -967,6 +1159,24 @@ func validateOpAssociatePackageInput(v *AssociatePackageInput) error { } } +func validateOpAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthorizeVpcEndpointAccessInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.Account == nil { + invalidParams.Add(smithy.NewErrParamRequired("Account")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCancelElasticsearchServiceSoftwareUpdateInput(v *CancelElasticsearchServiceSoftwareUpdateInput) error { if v == nil { return nil @@ -1062,6 +1272,24 @@ func validateOpCreatePackageInput(v *CreatePackageInput) error { } } +func validateOpCreateVpcEndpointInput(v *CreateVpcEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateVpcEndpointInput"} + if v.DomainArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainArn")) + } + if v.VpcOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcOptions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteElasticsearchDomainInput(v *DeleteElasticsearchDomainInput) error { if v == nil { return nil @@ -1122,6 +1350,21 @@ func validateOpDeletePackageInput(v *DeletePackageInput) error { } } +func validateOpDeleteVpcEndpointInput(v *DeleteVpcEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcEndpointInput"} + if v.VpcEndpointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeDomainAutoTunesInput(v *DescribeDomainAutoTunesInput) error { if v == nil { return nil @@ -1215,6 +1458,21 @@ func validateOpDescribeElasticsearchInstanceTypeLimitsInput(v *DescribeElasticse } } +func validateOpDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeVpcEndpointsInput"} + if v.VpcEndpointIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDissociatePackageInput(v *DissociatePackageInput) error { if v == nil { return nil @@ -1338,6 +1596,36 @@ func validateOpListTagsInput(v *ListTagsInput) error { } } +func validateOpListVpcEndpointAccessInput(v *ListVpcEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListVpcEndpointAccessInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListVpcEndpointsForDomainInput(v *ListVpcEndpointsForDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListVpcEndpointsForDomainInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPurchaseReservedElasticsearchInstanceOfferingInput(v *PurchaseReservedElasticsearchInstanceOfferingInput) error { if v == nil { return nil @@ -1389,6 +1677,24 @@ func validateOpRemoveTagsInput(v *RemoveTagsInput) error { } } +func validateOpRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RevokeVpcEndpointAccessInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.Account == nil { + invalidParams.Add(smithy.NewErrParamRequired("Account")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartElasticsearchServiceSoftwareUpdateInput(v *StartElasticsearchServiceSoftwareUpdateInput) error { if v == nil { return nil @@ -1447,6 +1753,24 @@ func validateOpUpdatePackageInput(v *UpdatePackageInput) error { } } +func validateOpUpdateVpcEndpointInput(v *UpdateVpcEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateVpcEndpointInput"} + if v.VpcEndpointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointId")) + } + if v.VpcOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcOptions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpgradeElasticsearchDomainInput(v *UpgradeElasticsearchDomainInput) error { if v == nil { return nil diff --git a/service/emr/internal/endpoints/endpoints.go b/service/emr/internal/endpoints/endpoints.go index abed125a184..866e010f36f 100644 --- a/service/emr/internal/endpoints/endpoints.go +++ b/service/emr/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/eventbridge/internal/endpoints/endpoints.go b/service/eventbridge/internal/endpoints/endpoints.go index 2626adabd32..cbee3258af9 100644 --- a/service/eventbridge/internal/endpoints/endpoints.go +++ b/service/eventbridge/internal/endpoints/endpoints.go @@ -170,6 +170,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/kinesis/internal/endpoints/endpoints.go b/service/kinesis/internal/endpoints/endpoints.go index 239727367d6..0c43d2fa40f 100644 --- a/service/kinesis/internal/endpoints/endpoints.go +++ b/service/kinesis/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/kms/internal/endpoints/endpoints.go b/service/kms/internal/endpoints/endpoints.go index cf00f8cd983..77f5f0f3d07 100644 --- a/service/kms/internal/endpoints/endpoints.go +++ b/service/kms/internal/endpoints/endpoints.go @@ -351,6 +351,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "kms-fips.eu-central-2.amazonaws.com", + }, endpoints.EndpointKey{ Region: "eu-central-2-fips", }: endpoints.Endpoint{ diff --git a/service/lambda/internal/endpoints/endpoints.go b/service/lambda/internal/endpoints/endpoints.go index 464852cd852..03aac3c82c4 100644 --- a/service/lambda/internal/endpoints/endpoints.go +++ b/service/lambda/internal/endpoints/endpoints.go @@ -234,6 +234,15 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "lambda.eu-central-1.api.aws", }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "lambda.eu-central-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/marketplacemetering/internal/endpoints/endpoints.go b/service/marketplacemetering/internal/endpoints/endpoints.go index 165106d941d..799a8552610 100644 --- a/service/marketplacemetering/internal/endpoints/endpoints.go +++ b/service/marketplacemetering/internal/endpoints/endpoints.go @@ -180,6 +180,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/neptune/internal/endpoints/endpoints.go b/service/neptune/internal/endpoints/endpoints.go index 7f42a2313ea..e7d9884bd05 100644 --- a/service/neptune/internal/endpoints/endpoints.go +++ b/service/neptune/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/opensearch/internal/endpoints/endpoints.go b/service/opensearch/internal/endpoints/endpoints.go index bd2a81682b7..0002ad23c0c 100644 --- a/service/opensearch/internal/endpoints/endpoints.go +++ b/service/opensearch/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/pi/internal/endpoints/endpoints.go b/service/pi/internal/endpoints/endpoints.go index 1e2f11be728..bac5369020a 100644 --- a/service/pi/internal/endpoints/endpoints.go +++ b/service/pi/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/rbin/internal/endpoints/endpoints.go b/service/rbin/internal/endpoints/endpoints.go index 9b4ba85c036..16e00e4d2e3 100644 --- a/service/rbin/internal/endpoints/endpoints.go +++ b/service/rbin/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/rds/internal/endpoints/endpoints.go b/service/rds/internal/endpoints/endpoints.go index 7430ad6d8ef..0c5169f050a 100644 --- a/service/rds/internal/endpoints/endpoints.go +++ b/service/rds/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/redshift/internal/endpoints/endpoints.go b/service/redshift/internal/endpoints/endpoints.go index ca40d3a89cc..962a7a73622 100644 --- a/service/redshift/internal/endpoints/endpoints.go +++ b/service/redshift/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/resourceexplorer2/api_op_CreateIndex.go b/service/resourceexplorer2/api_op_CreateIndex.go index 820da51a3a1..d84a0f8f46a 100644 --- a/service/resourceexplorer2/api_op_CreateIndex.go +++ b/service/resourceexplorer2/api_op_CreateIndex.go @@ -38,18 +38,18 @@ import ( // * Action: resource-explorer-2:CreateIndex // Resource: The ARN of the index (as it will exist after the operation completes) // in the Amazon Web Services Region and account in which you're trying to create -// the index. Use the wildcard character () at the end of the string to match the +// the index. Use the wildcard character (*) at the end of the string to match the // eventual UUID. For example, the following Resource element restricts the role or // user to creating an index in only the us-east-2 Region of the specified account. -// "Resource": "arn:aws:resource-explorer-2:us-east-2::index/" -// Alternatively, you can use "Resource": "" to allow the role or user to create an -// index in any Region. +// "Resource": "arn:aws:resource-explorer-2:us-west-2::index/*" +// Alternatively, you can use "Resource": "*" to allow the role or user to create +// an index in any Region. // // * Action: iam:CreateServiceLinkedRole Resource: No -// specific resource (). This permission is required only the first time you create -// an index to turn on Resource Explorer in the account. Resource Explorer uses -// this to create the service-linked role needed to index the resources in your -// account +// specific resource (*). This permission is required only the first time you +// create an index to turn on Resource Explorer in the account. Resource Explorer +// uses this to create the service-linked role needed to index the resources in +// your account // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/security_iam_service-linked-roles.html). // Resource Explorer uses the same service-linked role for all additional indexes // you create afterwards. diff --git a/service/resourceexplorer2/doc.go b/service/resourceexplorer2/doc.go index fbca79408b7..d39cf2acec0 100644 --- a/service/resourceexplorer2/doc.go +++ b/service/resourceexplorer2/doc.go @@ -30,15 +30,5 @@ // your account. For more information about Amazon Web Services Resource Explorer, // including how to enable and configure the service, see the Amazon Web Services // Resource Explorer User Guide -// (https://docs.aws.amazon.com/resource-explorer/latest/userguide/). The example -// HTTP query requests and responses in this guide are displayed with the JSON -// (https://json.org) formatted across multiple lines for readability. The actual -// query responses from the Resource Explorer service do not include this extra -// whitespace. We want your feedback about this documentation Our goal is to help -// you get everything you can from Resource Explorer. If this guide helps you to do -// that, then let us know. If the guide isn't helping you, then we want to hear -// from you so we can address the issue. Use the Feedback link that's in the -// upper-right corner of every page. That sends your comments directly to the -// writers of this guide. We review every submission, looking for opportunities to -// improve the documentation. Thank you in advance for your help! +// (https://docs.aws.amazon.com/resource-explorer/latest/userguide/). package resourceexplorer2 diff --git a/service/resourceexplorer2/internal/endpoints/endpoints.go b/service/resourceexplorer2/internal/endpoints/endpoints.go index cda6ffc6e45..4c525052dd3 100644 --- a/service/resourceexplorer2/internal/endpoints/endpoints.go +++ b/service/resourceexplorer2/internal/endpoints/endpoints.go @@ -185,6 +185,11 @@ var defaultPartitions = endpoints.Partitions{ }: endpoints.Endpoint{ Hostname: "resource-explorer-2.eu-central-1.api.aws", }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.eu-central-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{ diff --git a/service/resourcegroups/internal/endpoints/endpoints.go b/service/resourcegroups/internal/endpoints/endpoints.go index a06ea536606..486261b5418 100644 --- a/service/resourcegroups/internal/endpoints/endpoints.go +++ b/service/resourcegroups/internal/endpoints/endpoints.go @@ -219,6 +219,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/resourcegroupstaggingapi/internal/endpoints/endpoints.go b/service/resourcegroupstaggingapi/internal/endpoints/endpoints.go index 64cbe40b7da..37fcf007257 100644 --- a/service/resourcegroupstaggingapi/internal/endpoints/endpoints.go +++ b/service/resourcegroupstaggingapi/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/s3/internal/endpoints/endpoints.go b/service/s3/internal/endpoints/endpoints.go index 4b8457ebfad..3d1aea32fc2 100644 --- a/service/s3/internal/endpoints/endpoints.go +++ b/service/s3/internal/endpoints/endpoints.go @@ -269,6 +269,15 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "s3.dualstack.eu-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "s3.dualstack.eu-central-2.amazonaws.com", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/s3control/internal/endpoints/s3/endpoints.go b/service/s3control/internal/endpoints/s3/endpoints.go index e88d72c9565..5c340750160 100644 --- a/service/s3control/internal/endpoints/s3/endpoints.go +++ b/service/s3control/internal/endpoints/s3/endpoints.go @@ -267,6 +267,15 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "s3.dualstack.eu-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "s3.dualstack.eu-central-2.amazonaws.com", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/scheduler/LICENSE.txt b/service/scheduler/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/scheduler/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/scheduler/api_client.go b/service/scheduler/api_client.go new file mode 100644 index 00000000000..e8d4532b5dc --- /dev/null +++ b/service/scheduler/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "Scheduler" +const ServiceAPIVersion = "2021-06-30" + +// Client provides the API client to make operations call for Amazon EventBridge +// Scheduler. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "scheduler", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/scheduler/api_client_test.go b/service/scheduler/api_client_test.go new file mode 100644 index 00000000000..126562d35a0 --- /dev/null +++ b/service/scheduler/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/scheduler/api_op_CreateSchedule.go b/service/scheduler/api_op_CreateSchedule.go new file mode 100644 index 00000000000..d5534227790 --- /dev/null +++ b/service/scheduler/api_op_CreateSchedule.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates the specified schedule. +func (c *Client) CreateSchedule(ctx context.Context, params *CreateScheduleInput, optFns ...func(*Options)) (*CreateScheduleOutput, error) { + if params == nil { + params = &CreateScheduleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSchedule", params, optFns, c.addOperationCreateScheduleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateScheduleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateScheduleInput struct { + + // Allows you to configure a time window during which EventBridge Scheduler invokes + // the schedule. + // + // This member is required. + FlexibleTimeWindow *types.FlexibleTimeWindow + + // The name of the schedule that you are creating. + // + // This member is required. + Name *string + + // The expression that defines when the schedule runs. The following formats are + // supported. + // + // * at expression - at(yyyy-mm-ddThh:mm:ss) + // + // * rate expression - + // rate(unit value) + // + // * cron expression - cron(fields) + // + // You can use at expressions + // to create one-time schedules that invoke a target once, at the time and in the + // time zone, that you specify. You can use rate and cron expressions to create + // recurring schedules. Rate-based schedules are useful when you want to invoke a + // target at regular intervals, such as every 15 minutes or every five days. + // Cron-based schedules are useful when you want to invoke a target periodically at + // a specific time, such as at 8:00 am (UTC+0) every 1st day of the month. A cron + // expression consists of six fields separated by white spaces: (minutes hours + // day_of_month month day_of_week year). A rate expression consists of a value as a + // positive integer, and a unit with the following options: minute | minutes | hour + // | hours | day | days For more information and examples, see Schedule types on + // EventBridge Scheduler + // (https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html) in + // the EventBridge Scheduler User Guide. + // + // This member is required. + ScheduleExpression *string + + // The schedule's target. + // + // This member is required. + Target *types.Target + + // Unique, case-sensitive identifier you provide to ensure the idempotency of the + // request. If you do not specify a client token, EventBridge Scheduler uses a + // randomly generated token for the request to ensure idempotency. + ClientToken *string + + // The description you specify for the schedule. + Description *string + + // The date, in UTC, before which the schedule can invoke its target. Depending on + // the schedule's recurrence expression, invocations might stop on, or before, the + // EndDate you specify. EventBridge Scheduler ignores EndDate for one-time + // schedules. + EndDate *time.Time + + // The name of the schedule group to associate with this schedule. If you omit + // this, the default schedule group is used. + GroupName *string + + // The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge + // Scheduler will use to encrypt and decrypt your data. + KmsKeyArn *string + + // The timezone in which the scheduling expression is evaluated. + ScheduleExpressionTimezone *string + + // The date, in UTC, after which the schedule can begin invoking its target. + // Depending on the schedule's recurrence expression, invocations might occur on, + // or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for + // one-time schedules. + StartDate *time.Time + + // Specifies whether the schedule is enabled or disabled. + State types.ScheduleState + + noSmithyDocumentSerde +} + +type CreateScheduleOutput struct { + + // The Amazon Resource Name (ARN) of the schedule. + // + // This member is required. + ScheduleArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSchedule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSchedule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateScheduleMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateScheduleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSchedule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateSchedule struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateSchedule) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateScheduleInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateScheduleMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSchedule{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateSchedule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "CreateSchedule", + } +} diff --git a/service/scheduler/api_op_CreateScheduleGroup.go b/service/scheduler/api_op_CreateScheduleGroup.go new file mode 100644 index 00000000000..6db16a76046 --- /dev/null +++ b/service/scheduler/api_op_CreateScheduleGroup.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates the specified schedule group. +func (c *Client) CreateScheduleGroup(ctx context.Context, params *CreateScheduleGroupInput, optFns ...func(*Options)) (*CreateScheduleGroupOutput, error) { + if params == nil { + params = &CreateScheduleGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateScheduleGroup", params, optFns, c.addOperationCreateScheduleGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateScheduleGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateScheduleGroupInput struct { + + // The name of the schedule group that you are creating. + // + // This member is required. + Name *string + + // Unique, case-sensitive identifier you provide to ensure the idempotency of the + // request. If you do not specify a client token, EventBridge Scheduler uses a + // randomly generated token for the request to ensure idempotency. + ClientToken *string + + // The list of tags to associate with the schedule group. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateScheduleGroupOutput struct { + + // The Amazon Resource Name (ARN) of the schedule group. + // + // This member is required. + ScheduleGroupArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateScheduleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateScheduleGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateScheduleGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateScheduleGroupMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateScheduleGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateScheduleGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateScheduleGroup struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateScheduleGroup) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateScheduleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateScheduleGroupInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateScheduleGroupInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateScheduleGroupMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateScheduleGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateScheduleGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "CreateScheduleGroup", + } +} diff --git a/service/scheduler/api_op_DeleteSchedule.go b/service/scheduler/api_op_DeleteSchedule.go new file mode 100644 index 00000000000..dcbf0be2224 --- /dev/null +++ b/service/scheduler/api_op_DeleteSchedule.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified schedule. +func (c *Client) DeleteSchedule(ctx context.Context, params *DeleteScheduleInput, optFns ...func(*Options)) (*DeleteScheduleOutput, error) { + if params == nil { + params = &DeleteScheduleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSchedule", params, optFns, c.addOperationDeleteScheduleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteScheduleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteScheduleInput struct { + + // The name of the schedule to delete. + // + // This member is required. + Name *string + + // Unique, case-sensitive identifier you provide to ensure the idempotency of the + // request. If you do not specify a client token, EventBridge Scheduler uses a + // randomly generated token for the request to ensure idempotency. + ClientToken *string + + // The name of the schedule group associated with this schedule. If you omit this, + // the default schedule group is used. + GroupName *string + + noSmithyDocumentSerde +} + +type DeleteScheduleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSchedule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSchedule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteScheduleMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteScheduleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSchedule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteSchedule struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteSchedule) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*DeleteScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteScheduleInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opDeleteScheduleMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteSchedule{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteSchedule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "DeleteSchedule", + } +} diff --git a/service/scheduler/api_op_DeleteScheduleGroup.go b/service/scheduler/api_op_DeleteScheduleGroup.go new file mode 100644 index 00000000000..bd5051fa3d5 --- /dev/null +++ b/service/scheduler/api_op_DeleteScheduleGroup.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified schedule group. Deleting a schedule group results in +// EventBridge Scheduler deleting all schedules associated with the group. When you +// delete a group, it remains in a DELETING state until all of its associated +// schedules are deleted. Schedules associated with the group that are set to run +// while the schedule group is in the process of being deleted might continue to +// invoke their targets until the schedule group and its associated schedules are +// deleted. This operation is eventually consistent. +func (c *Client) DeleteScheduleGroup(ctx context.Context, params *DeleteScheduleGroupInput, optFns ...func(*Options)) (*DeleteScheduleGroupOutput, error) { + if params == nil { + params = &DeleteScheduleGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteScheduleGroup", params, optFns, c.addOperationDeleteScheduleGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteScheduleGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteScheduleGroupInput struct { + + // The name of the schedule group to delete. + // + // This member is required. + Name *string + + // Unique, case-sensitive identifier you provide to ensure the idempotency of the + // request. If you do not specify a client token, EventBridge Scheduler uses a + // randomly generated token for the request to ensure idempotency. + ClientToken *string + + noSmithyDocumentSerde +} + +type DeleteScheduleGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteScheduleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteScheduleGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteScheduleGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opDeleteScheduleGroupMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteScheduleGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteScheduleGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpDeleteScheduleGroup struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteScheduleGroup) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteScheduleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*DeleteScheduleGroupInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteScheduleGroupInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opDeleteScheduleGroupMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteScheduleGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteScheduleGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "DeleteScheduleGroup", + } +} diff --git a/service/scheduler/api_op_GetSchedule.go b/service/scheduler/api_op_GetSchedule.go new file mode 100644 index 00000000000..8adb512e07d --- /dev/null +++ b/service/scheduler/api_op_GetSchedule.go @@ -0,0 +1,197 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves the specified schedule. +func (c *Client) GetSchedule(ctx context.Context, params *GetScheduleInput, optFns ...func(*Options)) (*GetScheduleOutput, error) { + if params == nil { + params = &GetScheduleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSchedule", params, optFns, c.addOperationGetScheduleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetScheduleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetScheduleInput struct { + + // The name of the schedule to retrieve. + // + // This member is required. + Name *string + + // The name of the schedule group associated with this schedule. If you omit this, + // EventBridge Scheduler assumes that the schedule is associated with the default + // group. + GroupName *string + + noSmithyDocumentSerde +} + +type GetScheduleOutput struct { + + // The Amazon Resource Name (ARN) of the schedule. + Arn *string + + // The time at which the schedule was created. + CreationDate *time.Time + + // The description of the schedule. + Description *string + + // The date, in UTC, before which the schedule can invoke its target. Depending on + // the schedule's recurrence expression, invocations might stop on, or before, the + // EndDate you specify. EventBridge Scheduler ignores EndDate for one-time + // schedules. + EndDate *time.Time + + // Allows you to configure a time window during which EventBridge Scheduler invokes + // the schedule. + FlexibleTimeWindow *types.FlexibleTimeWindow + + // The name of the schedule group associated with this schedule. + GroupName *string + + // The ARN for a customer managed KMS Key that is be used to encrypt and decrypt + // your data. + KmsKeyArn *string + + // The time at which the schedule was last modified. + LastModificationDate *time.Time + + // The name of the schedule. + Name *string + + // The expression that defines when the schedule runs. The following formats are + // supported. + // + // * at expression - at(yyyy-mm-ddThh:mm:ss) + // + // * rate expression - + // rate(unit value) + // + // * cron expression - cron(fields) + // + // You can use at expressions + // to create one-time schedules that invoke a target once, at the time and in the + // time zone, that you specify. You can use rate and cron expressions to create + // recurring schedules. Rate-based schedules are useful when you want to invoke a + // target at regular intervals, such as every 15 minutes or every five days. + // Cron-based schedules are useful when you want to invoke a target periodically at + // a specific time, such as at 8:00 am (UTC+0) every 1st day of the month. A cron + // expression consists of six fields separated by white spaces: (minutes hours + // day_of_month month day_of_week year). A rate expression consists of a value as a + // positive integer, and a unit with the following options: minute | minutes | hour + // | hours | day | days For more information and examples, see Schedule types on + // EventBridge Scheduler + // (https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html) in + // the EventBridge Scheduler User Guide. + ScheduleExpression *string + + // The timezone in which the scheduling expression is evaluated. + ScheduleExpressionTimezone *string + + // The date, in UTC, after which the schedule can begin invoking its target. + // Depending on the schedule's recurrence expression, invocations might occur on, + // or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for + // one-time schedules. + StartDate *time.Time + + // Specifies whether the schedule is enabled or disabled. + State types.ScheduleState + + // The schedule target. + Target *types.Target + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSchedule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSchedule{}, 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 = addOpGetScheduleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSchedule(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_opGetSchedule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "GetSchedule", + } +} diff --git a/service/scheduler/api_op_GetScheduleGroup.go b/service/scheduler/api_op_GetScheduleGroup.go new file mode 100644 index 00000000000..563a8b6ab8e --- /dev/null +++ b/service/scheduler/api_op_GetScheduleGroup.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves the specified schedule group. +func (c *Client) GetScheduleGroup(ctx context.Context, params *GetScheduleGroupInput, optFns ...func(*Options)) (*GetScheduleGroupOutput, error) { + if params == nil { + params = &GetScheduleGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetScheduleGroup", params, optFns, c.addOperationGetScheduleGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetScheduleGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetScheduleGroupInput struct { + + // The name of the schedule group to retrieve. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type GetScheduleGroupOutput struct { + + // The Amazon Resource Name (ARN) of the schedule group. + Arn *string + + // The time at which the schedule group was created. + CreationDate *time.Time + + // The time at which the schedule group was last modified. + LastModificationDate *time.Time + + // The name of the schedule group. + Name *string + + // Specifies the state of the schedule group. + State types.ScheduleGroupState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetScheduleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetScheduleGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetScheduleGroup{}, 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 = addOpGetScheduleGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetScheduleGroup(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_opGetScheduleGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "GetScheduleGroup", + } +} diff --git a/service/scheduler/api_op_ListScheduleGroups.go b/service/scheduler/api_op_ListScheduleGroups.go new file mode 100644 index 00000000000..45fb8560341 --- /dev/null +++ b/service/scheduler/api_op_ListScheduleGroups.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of your schedule groups. +func (c *Client) ListScheduleGroups(ctx context.Context, params *ListScheduleGroupsInput, optFns ...func(*Options)) (*ListScheduleGroupsOutput, error) { + if params == nil { + params = &ListScheduleGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListScheduleGroups", params, optFns, c.addOperationListScheduleGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListScheduleGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListScheduleGroupsInput struct { + + // If specified, limits the number of results returned by this operation. The + // operation also returns a NextToken which you can use in a subsequent operation + // to retrieve the next set of results. + MaxResults *int32 + + // The name prefix that you can use to return a filtered list of your schedule + // groups. + NamePrefix *string + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListScheduleGroupsOutput struct { + + // The schedule groups that match the specified criteria. + // + // This member is required. + ScheduleGroups []types.ScheduleGroupSummary + + // Indicates whether there are additional results to retrieve. If the value is + // null, there are no more results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListScheduleGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListScheduleGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListScheduleGroups{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListScheduleGroups(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 +} + +// ListScheduleGroupsAPIClient is a client that implements the ListScheduleGroups +// operation. +type ListScheduleGroupsAPIClient interface { + ListScheduleGroups(context.Context, *ListScheduleGroupsInput, ...func(*Options)) (*ListScheduleGroupsOutput, error) +} + +var _ ListScheduleGroupsAPIClient = (*Client)(nil) + +// ListScheduleGroupsPaginatorOptions is the paginator options for +// ListScheduleGroups +type ListScheduleGroupsPaginatorOptions struct { + // If specified, limits the number of results returned by this operation. The + // operation also returns a NextToken which you can use in a subsequent operation + // to retrieve the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListScheduleGroupsPaginator is a paginator for ListScheduleGroups +type ListScheduleGroupsPaginator struct { + options ListScheduleGroupsPaginatorOptions + client ListScheduleGroupsAPIClient + params *ListScheduleGroupsInput + nextToken *string + firstPage bool +} + +// NewListScheduleGroupsPaginator returns a new ListScheduleGroupsPaginator +func NewListScheduleGroupsPaginator(client ListScheduleGroupsAPIClient, params *ListScheduleGroupsInput, optFns ...func(*ListScheduleGroupsPaginatorOptions)) *ListScheduleGroupsPaginator { + if params == nil { + params = &ListScheduleGroupsInput{} + } + + options := ListScheduleGroupsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListScheduleGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScheduleGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListScheduleGroups page. +func (p *ListScheduleGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScheduleGroupsOutput, 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.ListScheduleGroups(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_opListScheduleGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "ListScheduleGroups", + } +} diff --git a/service/scheduler/api_op_ListSchedules.go b/service/scheduler/api_op_ListSchedules.go new file mode 100644 index 00000000000..b42a2efe864 --- /dev/null +++ b/service/scheduler/api_op_ListSchedules.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of your EventBridge Scheduler schedules. +func (c *Client) ListSchedules(ctx context.Context, params *ListSchedulesInput, optFns ...func(*Options)) (*ListSchedulesOutput, error) { + if params == nil { + params = &ListSchedulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSchedules", params, optFns, c.addOperationListSchedulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSchedulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSchedulesInput struct { + + // If specified, only lists the schedules whose associated schedule group matches + // the given filter. + GroupName *string + + // If specified, limits the number of results returned by this operation. The + // operation also returns a NextToken which you can use in a subsequent operation + // to retrieve the next set of results. + MaxResults *int32 + + // Schedule name prefix to return the filtered list of resources. + NamePrefix *string + + // The token returned by a previous call to retrieve the next set of results. + NextToken *string + + // If specified, only lists the schedules whose current state matches the given + // filter. + State types.ScheduleState + + noSmithyDocumentSerde +} + +type ListSchedulesOutput struct { + + // The schedules that match the specified criteria. + // + // This member is required. + Schedules []types.ScheduleSummary + + // Indicates whether there are additional results to retrieve. If the value is + // null, there are no more results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSchedulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSchedules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSchedules{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSchedules(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 +} + +// ListSchedulesAPIClient is a client that implements the ListSchedules operation. +type ListSchedulesAPIClient interface { + ListSchedules(context.Context, *ListSchedulesInput, ...func(*Options)) (*ListSchedulesOutput, error) +} + +var _ ListSchedulesAPIClient = (*Client)(nil) + +// ListSchedulesPaginatorOptions is the paginator options for ListSchedules +type ListSchedulesPaginatorOptions struct { + // If specified, limits the number of results returned by this operation. The + // operation also returns a NextToken which you can use in a subsequent operation + // to retrieve the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSchedulesPaginator is a paginator for ListSchedules +type ListSchedulesPaginator struct { + options ListSchedulesPaginatorOptions + client ListSchedulesAPIClient + params *ListSchedulesInput + nextToken *string + firstPage bool +} + +// NewListSchedulesPaginator returns a new ListSchedulesPaginator +func NewListSchedulesPaginator(client ListSchedulesAPIClient, params *ListSchedulesInput, optFns ...func(*ListSchedulesPaginatorOptions)) *ListSchedulesPaginator { + if params == nil { + params = &ListSchedulesInput{} + } + + options := ListSchedulesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSchedulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchedulesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSchedules page. +func (p *ListSchedulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchedulesOutput, 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.ListSchedules(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_opListSchedules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "ListSchedules", + } +} diff --git a/service/scheduler/api_op_ListTagsForResource.go b/service/scheduler/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..f7448d440f6 --- /dev/null +++ b/service/scheduler/api_op_ListTagsForResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags associated with the Scheduler resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the EventBridge Scheduler resource for which you want to view tags. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The list of tags associated with the specified resource. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = 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 = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(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_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "ListTagsForResource", + } +} diff --git a/service/scheduler/api_op_TagResource.go b/service/scheduler/api_op_TagResource.go new file mode 100644 index 00000000000..2e5bcf17772 --- /dev/null +++ b/service/scheduler/api_op_TagResource.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Assigns one or more tags (key-value pairs) to the specified EventBridge +// Scheduler resource. You can only assign tags to schedule groups. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the schedule group that you are adding tags + // to. + // + // This member is required. + ResourceArn *string + + // The list of tags to associate with the schedule group. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = 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 = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(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_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "TagResource", + } +} diff --git a/service/scheduler/api_op_UntagResource.go b/service/scheduler/api_op_UntagResource.go new file mode 100644 index 00000000000..47cecff4cc5 --- /dev/null +++ b/service/scheduler/api_op_UntagResource.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes one or more tags from the specified EventBridge Scheduler schedule +// group. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the schedule group from which you are removing + // tags. + // + // This member is required. + ResourceArn *string + + // The list of tag keys to remove from the resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = 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 = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(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_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "UntagResource", + } +} diff --git a/service/scheduler/api_op_UpdateSchedule.go b/service/scheduler/api_op_UpdateSchedule.go new file mode 100644 index 00000000000..a57d84d7be4 --- /dev/null +++ b/service/scheduler/api_op_UpdateSchedule.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +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/scheduler/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates the specified schedule. When you call UpdateSchedule, EventBridge +// Scheduler uses all values, including empty values, specified in the request and +// overrides the existing schedule. This is by design. This means that if you do +// not set an optional field in your request, that field will be set to its +// system-default value after the update. Before calling this operation, we +// recommend that you call the GetSchedule API operation and make a note of all +// optional parameters for your UpdateSchedule call. +func (c *Client) UpdateSchedule(ctx context.Context, params *UpdateScheduleInput, optFns ...func(*Options)) (*UpdateScheduleOutput, error) { + if params == nil { + params = &UpdateScheduleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSchedule", params, optFns, c.addOperationUpdateScheduleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateScheduleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateScheduleInput struct { + + // Allows you to configure a time window during which EventBridge Scheduler invokes + // the schedule. + // + // This member is required. + FlexibleTimeWindow *types.FlexibleTimeWindow + + // The name of the schedule that you are updating. + // + // This member is required. + Name *string + + // The expression that defines when the schedule runs. The following formats are + // supported. + // + // * at expression - at(yyyy-mm-ddThh:mm:ss) + // + // * rate expression - + // rate(unit value) + // + // * cron expression - cron(fields) + // + // You can use at expressions + // to create one-time schedules that invoke a target once, at the time and in the + // time zone, that you specify. You can use rate and cron expressions to create + // recurring schedules. Rate-based schedules are useful when you want to invoke a + // target at regular intervals, such as every 15 minutes or every five days. + // Cron-based schedules are useful when you want to invoke a target periodically at + // a specific time, such as at 8:00 am (UTC+0) every 1st day of the month. A cron + // expression consists of six fields separated by white spaces: (minutes hours + // day_of_month month day_of_week year). A rate expression consists of a value as a + // positive integer, and a unit with the following options: minute | minutes | hour + // | hours | day | days For more information and examples, see Schedule types on + // EventBridge Scheduler + // (https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html) in + // the EventBridge Scheduler User Guide. + // + // This member is required. + ScheduleExpression *string + + // The schedule target. You can use this operation to change the target that your + // schedule invokes. + // + // This member is required. + Target *types.Target + + // Unique, case-sensitive identifier you provide to ensure the idempotency of the + // request. If you do not specify a client token, EventBridge Scheduler uses a + // randomly generated token for the request to ensure idempotency. + ClientToken *string + + // The description you specify for the schedule. + Description *string + + // The date, in UTC, before which the schedule can invoke its target. Depending on + // the schedule's recurrence expression, invocations might stop on, or before, the + // EndDate you specify. EventBridge Scheduler ignores EndDate for one-time + // schedules. + EndDate *time.Time + + // The name of the schedule group with which the schedule is associated. You must + // provide this value in order for EventBridge Scheduler to find the schedule you + // want to update. If you omit this value, EventBridge Scheduler assumes the group + // is associated to the default group. + GroupName *string + + // The ARN for the customer managed KMS key that that you want EventBridge + // Scheduler to use to encrypt and decrypt your data. + KmsKeyArn *string + + // The timezone in which the scheduling expression is evaluated. + ScheduleExpressionTimezone *string + + // The date, in UTC, after which the schedule can begin invoking its target. + // Depending on the schedule's recurrence expression, invocations might occur on, + // or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for + // one-time schedules. + StartDate *time.Time + + // Specifies whether the schedule is enabled or disabled. + State types.ScheduleState + + noSmithyDocumentSerde +} + +type UpdateScheduleOutput struct { + + // The Amazon Resource Name (ARN) of the schedule that you updated. + // + // This member is required. + ScheduleArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSchedule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSchedule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opUpdateScheduleMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateScheduleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSchedule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpUpdateSchedule struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateSchedule) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*UpdateScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateScheduleInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opUpdateScheduleMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateSchedule{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateSchedule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "scheduler", + OperationName: "UpdateSchedule", + } +} diff --git a/service/scheduler/deserializers.go b/service/scheduler/deserializers.go new file mode 100644 index 00000000000..3acf4d7943e --- /dev/null +++ b/service/scheduler/deserializers.go @@ -0,0 +1,3847 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/scheduler/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsRestjson1_deserializeOpCreateSchedule struct { +} + +func (*awsRestjson1_deserializeOpCreateSchedule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSchedule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateSchedule(response, &metadata) + } + output := &CreateScheduleOutput{} + 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_deserializeOpDocumentCreateScheduleOutput(&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_deserializeOpErrorCreateSchedule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpDocumentCreateScheduleOutput(v **CreateScheduleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateScheduleOutput + if *v == nil { + sv = &CreateScheduleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ScheduleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleArn to be of type string, got %T instead", value) + } + sv.ScheduleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateScheduleGroup struct { +} + +func (*awsRestjson1_deserializeOpCreateScheduleGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateScheduleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateScheduleGroup(response, &metadata) + } + output := &CreateScheduleGroupOutput{} + 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_deserializeOpDocumentCreateScheduleGroupOutput(&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_deserializeOpErrorCreateScheduleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateScheduleGroupOutput(v **CreateScheduleGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateScheduleGroupOutput + if *v == nil { + sv = &CreateScheduleGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ScheduleGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleGroupArn to be of type string, got %T instead", value) + } + sv.ScheduleGroupArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteSchedule struct { +} + +func (*awsRestjson1_deserializeOpDeleteSchedule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSchedule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteSchedule(response, &metadata) + } + output := &DeleteScheduleOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSchedule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpDeleteScheduleGroup struct { +} + +func (*awsRestjson1_deserializeOpDeleteScheduleGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteScheduleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteScheduleGroup(response, &metadata) + } + output := &DeleteScheduleGroupOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteScheduleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpGetSchedule struct { +} + +func (*awsRestjson1_deserializeOpGetSchedule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSchedule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetSchedule(response, &metadata) + } + output := &GetScheduleOutput{} + 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_deserializeOpDocumentGetScheduleOutput(&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_deserializeOpErrorGetSchedule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpDocumentGetScheduleOutput(v **GetScheduleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetScheduleOutput + if *v == nil { + sv = &GetScheduleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EndDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected EndDate to be a JSON Number, got %T instead", value) + + } + } + + case "FlexibleTimeWindow": + if err := awsRestjson1_deserializeDocumentFlexibleTimeWindow(&sv.FlexibleTimeWindow, value); err != nil { + return err + } + + case "GroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleGroupName to be of type string, got %T instead", value) + } + sv.GroupName = ptr.String(jtv) + } + + case "KmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + + case "LastModificationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModificationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastModificationDate to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ScheduleExpression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleExpression to be of type string, got %T instead", value) + } + sv.ScheduleExpression = ptr.String(jtv) + } + + case "ScheduleExpressionTimezone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleExpressionTimezone to be of type string, got %T instead", value) + } + sv.ScheduleExpressionTimezone = ptr.String(jtv) + } + + case "StartDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected StartDate to be a JSON Number, got %T instead", value) + + } + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleState to be of type string, got %T instead", value) + } + sv.State = types.ScheduleState(jtv) + } + + case "Target": + if err := awsRestjson1_deserializeDocumentTarget(&sv.Target, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetScheduleGroup struct { +} + +func (*awsRestjson1_deserializeOpGetScheduleGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetScheduleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetScheduleGroup(response, &metadata) + } + output := &GetScheduleGroupOutput{} + 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_deserializeOpDocumentGetScheduleGroupOutput(&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_deserializeOpErrorGetScheduleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpDocumentGetScheduleGroupOutput(v **GetScheduleGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetScheduleGroupOutput + if *v == nil { + sv = &GetScheduleGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleGroupArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) + + } + } + + case "LastModificationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModificationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastModificationDate to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleGroupName 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 ScheduleGroupState to be of type string, got %T instead", value) + } + sv.State = types.ScheduleGroupState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListScheduleGroups struct { +} + +func (*awsRestjson1_deserializeOpListScheduleGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListScheduleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListScheduleGroups(response, &metadata) + } + output := &ListScheduleGroupsOutput{} + 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_deserializeOpDocumentListScheduleGroupsOutput(&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_deserializeOpErrorListScheduleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpDocumentListScheduleGroupsOutput(v **ListScheduleGroupsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListScheduleGroupsOutput + if *v == nil { + sv = &ListScheduleGroupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ScheduleGroups": + if err := awsRestjson1_deserializeDocumentScheduleGroupList(&sv.ScheduleGroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSchedules struct { +} + +func (*awsRestjson1_deserializeOpListSchedules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSchedules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListSchedules(response, &metadata) + } + output := &ListSchedulesOutput{} + 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_deserializeOpDocumentListSchedulesOutput(&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_deserializeOpErrorListSchedules(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("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_deserializeOpDocumentListSchedulesOutput(v **ListSchedulesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSchedulesOutput + if *v == nil { + sv = &ListSchedulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Schedules": + if err := awsRestjson1_deserializeDocumentScheduleList(&sv.Schedules, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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("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_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("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_deserializeOpUpdateSchedule struct { +} + +func (*awsRestjson1_deserializeOpUpdateSchedule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSchedule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateSchedule(response, &metadata) + } + output := &UpdateScheduleOutput{} + 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_deserializeOpDocumentUpdateScheduleOutput(&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_deserializeOpErrorUpdateSchedule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateScheduleOutput(v **UpdateScheduleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateScheduleOutput + if *v == nil { + sv = &UpdateScheduleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ScheduleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleArn to be of type string, got %T instead", value) + } + sv.ScheduleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAwsVpcConfiguration(v **types.AwsVpcConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsVpcConfiguration + if *v == nil { + sv = &types.AwsVpcConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssignPublicIp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssignPublicIp to be of type string, got %T instead", value) + } + sv.AssignPublicIp = types.AssignPublicIp(jtv) + } + + case "SecurityGroups": + if err := awsRestjson1_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil { + return err + } + + case "Subnets": + if err := awsRestjson1_deserializeDocumentSubnets(&sv.Subnets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCapacityProviderStrategy(v *[]types.CapacityProviderStrategyItem, 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.CapacityProviderStrategyItem + if *v == nil { + cv = []types.CapacityProviderStrategyItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CapacityProviderStrategyItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentCapacityProviderStrategyItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCapacityProviderStrategyItem(v **types.CapacityProviderStrategyItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CapacityProviderStrategyItem + if *v == nil { + sv = &types.CapacityProviderStrategyItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "base": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CapacityProviderStrategyItemBase to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Base = int32(i64) + } + + case "capacityProvider": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CapacityProvider to be of type string, got %T instead", value) + } + sv.CapacityProvider = ptr.String(jtv) + } + + case "weight": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CapacityProviderStrategyItemWeight to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Weight = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeadLetterConfig(v **types.DeadLetterConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeadLetterConfig + if *v == nil { + sv = &types.DeadLetterConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEcsParameters(v **types.EcsParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EcsParameters + if *v == nil { + sv = &types.EcsParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CapacityProviderStrategy": + if err := awsRestjson1_deserializeDocumentCapacityProviderStrategy(&sv.CapacityProviderStrategy, value); err != nil { + return err + } + + case "EnableECSManagedTags": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected EnableECSManagedTags to be of type *bool, got %T instead", value) + } + sv.EnableECSManagedTags = ptr.Bool(jtv) + } + + case "EnableExecuteCommand": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected EnableExecuteCommand to be of type *bool, got %T instead", value) + } + sv.EnableExecuteCommand = ptr.Bool(jtv) + } + + case "Group": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Group to be of type string, got %T instead", value) + } + sv.Group = ptr.String(jtv) + } + + case "LaunchType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LaunchType to be of type string, got %T instead", value) + } + sv.LaunchType = types.LaunchType(jtv) + } + + case "NetworkConfiguration": + if err := awsRestjson1_deserializeDocumentNetworkConfiguration(&sv.NetworkConfiguration, value); err != nil { + return err + } + + case "PlacementConstraints": + if err := awsRestjson1_deserializeDocumentPlacementConstraints(&sv.PlacementConstraints, value); err != nil { + return err + } + + case "PlacementStrategy": + if err := awsRestjson1_deserializeDocumentPlacementStrategies(&sv.PlacementStrategy, value); err != nil { + return err + } + + case "PlatformVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlatformVersion to be of type string, got %T instead", value) + } + sv.PlatformVersion = ptr.String(jtv) + } + + case "PropagateTags": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PropagateTags to be of type string, got %T instead", value) + } + sv.PropagateTags = types.PropagateTags(jtv) + } + + case "ReferenceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReferenceId to be of type string, got %T instead", value) + } + sv.ReferenceId = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "TaskCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TaskCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TaskCount = ptr.Int32(int32(i64)) + } + + case "TaskDefinitionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskDefinitionArn to be of type string, got %T instead", value) + } + sv.TaskDefinitionArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventBridgeParameters(v **types.EventBridgeParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EventBridgeParameters + if *v == nil { + sv = &types.EventBridgeParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DetailType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DetailType to be of type string, got %T instead", value) + } + sv.DetailType = ptr.String(jtv) + } + + case "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlexibleTimeWindow(v **types.FlexibleTimeWindow, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FlexibleTimeWindow + if *v == nil { + sv = &types.FlexibleTimeWindow{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MaximumWindowInMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumWindowInMinutes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumWindowInMinutes = ptr.Int32(int32(i64)) + } + + case "Mode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlexibleTimeWindowMode to be of type string, got %T instead", value) + } + sv.Mode = types.FlexibleTimeWindowMode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "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_deserializeDocumentKinesisParameters(v **types.KinesisParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KinesisParameters + if *v == nil { + sv = &types.KinesisParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PartitionKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetPartitionKey to be of type string, got %T instead", value) + } + sv.PartitionKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNetworkConfiguration(v **types.NetworkConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.NetworkConfiguration + if *v == nil { + sv = &types.NetworkConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "awsvpcConfiguration": + if err := awsRestjson1_deserializeDocumentAwsVpcConfiguration(&sv.AwsvpcConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementConstraint(v **types.PlacementConstraint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PlacementConstraint + if *v == nil { + sv = &types.PlacementConstraint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementConstraintExpression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementConstraintType to be of type string, got %T instead", value) + } + sv.Type = types.PlacementConstraintType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementConstraints(v *[]types.PlacementConstraint, 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.PlacementConstraint + if *v == nil { + cv = []types.PlacementConstraint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PlacementConstraint + destAddr := &col + if err := awsRestjson1_deserializeDocumentPlacementConstraint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementStrategies(v *[]types.PlacementStrategy, 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.PlacementStrategy + if *v == nil { + cv = []types.PlacementStrategy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PlacementStrategy + destAddr := &col + if err := awsRestjson1_deserializeDocumentPlacementStrategy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPlacementStrategy(v **types.PlacementStrategy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PlacementStrategy + if *v == nil { + sv = &types.PlacementStrategy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "field": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementStrategyField to be of type string, got %T instead", value) + } + sv.Field = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlacementStrategyType to be of type string, got %T instead", value) + } + sv.Type = types.PlacementStrategyType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + 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_deserializeDocumentRetryPolicy(v **types.RetryPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RetryPolicy + if *v == nil { + sv = &types.RetryPolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MaximumEventAgeInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumEventAgeInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumEventAgeInSeconds = ptr.Int32(int32(i64)) + } + + case "MaximumRetryAttempts": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaximumRetryAttempts to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSageMakerPipelineParameter(v **types.SageMakerPipelineParameter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SageMakerPipelineParameter + if *v == nil { + sv = &types.SageMakerPipelineParameter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SageMakerPipelineParameterName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SageMakerPipelineParameterValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSageMakerPipelineParameterList(v *[]types.SageMakerPipelineParameter, 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.SageMakerPipelineParameter + if *v == nil { + cv = []types.SageMakerPipelineParameter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SageMakerPipelineParameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentSageMakerPipelineParameter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSageMakerPipelineParameters(v **types.SageMakerPipelineParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SageMakerPipelineParameters + if *v == nil { + sv = &types.SageMakerPipelineParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PipelineParameterList": + if err := awsRestjson1_deserializeDocumentSageMakerPipelineParameterList(&sv.PipelineParameterList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentScheduleGroupList(v *[]types.ScheduleGroupSummary, 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.ScheduleGroupSummary + if *v == nil { + cv = []types.ScheduleGroupSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ScheduleGroupSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentScheduleGroupSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentScheduleGroupSummary(v **types.ScheduleGroupSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ScheduleGroupSummary + if *v == nil { + sv = &types.ScheduleGroupSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleGroupArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) + + } + } + + case "LastModificationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModificationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastModificationDate to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleGroupName 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 ScheduleGroupState to be of type string, got %T instead", value) + } + sv.State = types.ScheduleGroupState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentScheduleList(v *[]types.ScheduleSummary, 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.ScheduleSummary + if *v == nil { + cv = []types.ScheduleSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ScheduleSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentScheduleSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentScheduleSummary(v **types.ScheduleSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ScheduleSummary + if *v == nil { + sv = &types.ScheduleSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) + + } + } + + case "GroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleGroupName to be of type string, got %T instead", value) + } + sv.GroupName = ptr.String(jtv) + } + + case "LastModificationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModificationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastModificationDate to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleState to be of type string, got %T instead", value) + } + sv.State = types.ScheduleState(jtv) + } + + case "Target": + if err := awsRestjson1_deserializeDocumentTargetSummary(&sv.Target, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSecurityGroups(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityGroup to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + 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_deserializeDocumentSqsParameters(v **types.SqsParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SqsParameters + if *v == nil { + sv = &types.SqsParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MessageGroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MessageGroupId to be of type string, got %T instead", value) + } + sv.MessageGroupId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSubnets(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Subnet to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTags(v *[]map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []map[string]string + if *v == nil { + cv = []map[string]string{} + } else { + cv = *v + } + + for _, value := range shape { + var col map[string]string + if err := awsRestjson1_deserializeDocumentTagMap(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTarget(v **types.Target, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Target + if *v == nil { + sv = &types.Target{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "DeadLetterConfig": + if err := awsRestjson1_deserializeDocumentDeadLetterConfig(&sv.DeadLetterConfig, value); err != nil { + return err + } + + case "EcsParameters": + if err := awsRestjson1_deserializeDocumentEcsParameters(&sv.EcsParameters, value); err != nil { + return err + } + + case "EventBridgeParameters": + if err := awsRestjson1_deserializeDocumentEventBridgeParameters(&sv.EventBridgeParameters, value); err != nil { + return err + } + + case "Input": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetInput to be of type string, got %T instead", value) + } + sv.Input = ptr.String(jtv) + } + + case "KinesisParameters": + if err := awsRestjson1_deserializeDocumentKinesisParameters(&sv.KinesisParameters, value); err != nil { + return err + } + + case "RetryPolicy": + if err := awsRestjson1_deserializeDocumentRetryPolicy(&sv.RetryPolicy, value); err != nil { + return err + } + + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "SageMakerPipelineParameters": + if err := awsRestjson1_deserializeDocumentSageMakerPipelineParameters(&sv.SageMakerPipelineParameters, value); err != nil { + return err + } + + case "SqsParameters": + if err := awsRestjson1_deserializeDocumentSqsParameters(&sv.SqsParameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTargetSummary(v **types.TargetSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TargetSummary + if *v == nil { + sv = &types.TargetSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/scheduler/doc.go b/service/scheduler/doc.go new file mode 100644 index 00000000000..a7217610ef5 --- /dev/null +++ b/service/scheduler/doc.go @@ -0,0 +1,12 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package scheduler provides the API client, operations, and parameter types for +// Amazon EventBridge Scheduler. +// +// Amazon EventBridge Scheduler is a serverless scheduler that allows you to +// create, run, and manage tasks from one central, managed service. EventBridge +// Scheduler delivers your tasks reliably, with built-in mechanisms that adjust +// your schedules based on the availability of downstream targets. The following +// reference lists the available API actions, and data types for EventBridge +// Scheduler. +package scheduler diff --git a/service/scheduler/endpoints.go b/service/scheduler/endpoints.go new file mode 100644 index 00000000000..ab1716ead28 --- /dev/null +++ b/service/scheduler/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/scheduler/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "scheduler" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/scheduler/generated.json b/service/scheduler/generated.json new file mode 100644 index 00000000000..b5e50c1b80a --- /dev/null +++ b/service/scheduler/generated.json @@ -0,0 +1,39 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CreateSchedule.go", + "api_op_CreateScheduleGroup.go", + "api_op_DeleteSchedule.go", + "api_op_DeleteScheduleGroup.go", + "api_op_GetSchedule.go", + "api_op_GetScheduleGroup.go", + "api_op_ListScheduleGroups.go", + "api_op_ListSchedules.go", + "api_op_ListTagsForResource.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateSchedule.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/scheduler", + "unstable": false +} diff --git a/service/scheduler/go.mod b/service/scheduler/go.mod new file mode 100644 index 00000000000..9d520606bfe --- /dev/null +++ b/service/scheduler/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/scheduler + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 + github.com/aws/smithy-go v1.13.4 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/scheduler/go.sum b/service/scheduler/go.sum new file mode 100644 index 00000000000..b5b882cefe7 --- /dev/null +++ b/service/scheduler/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk= +github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/scheduler/go_module_metadata.go b/service/scheduler/go_module_metadata.go new file mode 100644 index 00000000000..67198d0ce21 --- /dev/null +++ b/service/scheduler/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package scheduler + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/scheduler/internal/endpoints/endpoints.go b/service/scheduler/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..a10c6b6f600 --- /dev/null +++ b/service/scheduler/internal/endpoints/endpoints.go @@ -0,0 +1,250 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Scheduler endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "scheduler.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "scheduler-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "scheduler-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "scheduler.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "scheduler.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "scheduler-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "scheduler-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "scheduler.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "scheduler-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "scheduler.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "scheduler-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "scheduler.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "scheduler.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "scheduler-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "scheduler-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "scheduler.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/scheduler/internal/endpoints/endpoints_test.go b/service/scheduler/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/scheduler/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/scheduler/protocol_test.go b/service/scheduler/protocol_test.go new file mode 100644 index 00000000000..afc4f805694 --- /dev/null +++ b/service/scheduler/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler diff --git a/service/scheduler/serializers.go b/service/scheduler/serializers.go new file mode 100644 index 00000000000..c8fc9e67c95 --- /dev/null +++ b/service/scheduler/serializers.go @@ -0,0 +1,1460 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/scheduler/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateSchedule struct { +} + +func (*awsRestjson1_serializeOpCreateSchedule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSchedule) 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.(*CreateScheduleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedules/{Name}") + 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_serializeOpHttpBindingsCreateScheduleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateScheduleInput(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_serializeOpHttpBindingsCreateScheduleInput(v *CreateScheduleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateScheduleInput(v *CreateScheduleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.EndDate != nil { + ok := object.Key("EndDate") + ok.Double(smithytime.FormatEpochSeconds(*v.EndDate)) + } + + if v.FlexibleTimeWindow != nil { + ok := object.Key("FlexibleTimeWindow") + if err := awsRestjson1_serializeDocumentFlexibleTimeWindow(v.FlexibleTimeWindow, ok); err != nil { + return err + } + } + + if v.GroupName != nil { + ok := object.Key("GroupName") + ok.String(*v.GroupName) + } + + if v.KmsKeyArn != nil { + ok := object.Key("KmsKeyArn") + ok.String(*v.KmsKeyArn) + } + + if v.ScheduleExpression != nil { + ok := object.Key("ScheduleExpression") + ok.String(*v.ScheduleExpression) + } + + if v.ScheduleExpressionTimezone != nil { + ok := object.Key("ScheduleExpressionTimezone") + ok.String(*v.ScheduleExpressionTimezone) + } + + if v.StartDate != nil { + ok := object.Key("StartDate") + ok.Double(smithytime.FormatEpochSeconds(*v.StartDate)) + } + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + if v.Target != nil { + ok := object.Key("Target") + if err := awsRestjson1_serializeDocumentTarget(v.Target, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateScheduleGroup struct { +} + +func (*awsRestjson1_serializeOpCreateScheduleGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateScheduleGroup) 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.(*CreateScheduleGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedule-groups/{Name}") + 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_serializeOpHttpBindingsCreateScheduleGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateScheduleGroupInput(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_serializeOpHttpBindingsCreateScheduleGroupInput(v *CreateScheduleGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateScheduleGroupInput(v *CreateScheduleGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSchedule struct { +} + +func (*awsRestjson1_serializeOpDeleteSchedule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSchedule) 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.(*DeleteScheduleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedules/{Name}") + 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_serializeOpHttpBindingsDeleteScheduleInput(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_serializeOpHttpBindingsDeleteScheduleInput(v *DeleteScheduleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + if v.GroupName != nil { + encoder.SetQuery("groupName").String(*v.GroupName) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteScheduleGroup struct { +} + +func (*awsRestjson1_serializeOpDeleteScheduleGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteScheduleGroup) 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.(*DeleteScheduleGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedule-groups/{Name}") + 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_serializeOpHttpBindingsDeleteScheduleGroupInput(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_serializeOpHttpBindingsDeleteScheduleGroupInput(v *DeleteScheduleGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSchedule struct { +} + +func (*awsRestjson1_serializeOpGetSchedule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSchedule) 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.(*GetScheduleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedules/{Name}") + 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_serializeOpHttpBindingsGetScheduleInput(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_serializeOpHttpBindingsGetScheduleInput(v *GetScheduleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.GroupName != nil { + encoder.SetQuery("groupName").String(*v.GroupName) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetScheduleGroup struct { +} + +func (*awsRestjson1_serializeOpGetScheduleGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetScheduleGroup) 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.(*GetScheduleGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedule-groups/{Name}") + 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_serializeOpHttpBindingsGetScheduleGroupInput(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_serializeOpHttpBindingsGetScheduleGroupInput(v *GetScheduleGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListScheduleGroups struct { +} + +func (*awsRestjson1_serializeOpListScheduleGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListScheduleGroups) 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.(*ListScheduleGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedule-groups") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListScheduleGroupsInput(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_serializeOpHttpBindingsListScheduleGroupsInput(v *ListScheduleGroupsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) + } + + if v.NamePrefix != nil { + encoder.SetQuery("NamePrefix").String(*v.NamePrefix) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSchedules struct { +} + +func (*awsRestjson1_serializeOpListSchedules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSchedules) 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.(*ListSchedulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedules") + 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_serializeOpHttpBindingsListSchedulesInput(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_serializeOpHttpBindingsListSchedulesInput(v *ListSchedulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.GroupName != nil { + encoder.SetQuery("ScheduleGroup").String(*v.GroupName) + } + + if v.MaxResults != nil { + encoder.SetQuery("MaxResults").Integer(*v.MaxResults) + } + + if v.NamePrefix != nil { + encoder.SetQuery("NamePrefix").String(*v.NamePrefix) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if len(v.State) > 0 { + encoder.SetQuery("State").String(string(v.State)) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") + 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_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") + 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_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") + 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_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("TagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSchedule struct { +} + +func (*awsRestjson1_serializeOpUpdateSchedule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSchedule) 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.(*UpdateScheduleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/schedules/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateScheduleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateScheduleInput(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_serializeOpHttpBindingsUpdateScheduleInput(v *UpdateScheduleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateScheduleInput(v *UpdateScheduleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.EndDate != nil { + ok := object.Key("EndDate") + ok.Double(smithytime.FormatEpochSeconds(*v.EndDate)) + } + + if v.FlexibleTimeWindow != nil { + ok := object.Key("FlexibleTimeWindow") + if err := awsRestjson1_serializeDocumentFlexibleTimeWindow(v.FlexibleTimeWindow, ok); err != nil { + return err + } + } + + if v.GroupName != nil { + ok := object.Key("GroupName") + ok.String(*v.GroupName) + } + + if v.KmsKeyArn != nil { + ok := object.Key("KmsKeyArn") + ok.String(*v.KmsKeyArn) + } + + if v.ScheduleExpression != nil { + ok := object.Key("ScheduleExpression") + ok.String(*v.ScheduleExpression) + } + + if v.ScheduleExpressionTimezone != nil { + ok := object.Key("ScheduleExpressionTimezone") + ok.String(*v.ScheduleExpressionTimezone) + } + + if v.StartDate != nil { + ok := object.Key("StartDate") + ok.Double(smithytime.FormatEpochSeconds(*v.StartDate)) + } + + if len(v.State) > 0 { + ok := object.Key("State") + ok.String(string(v.State)) + } + + if v.Target != nil { + ok := object.Key("Target") + if err := awsRestjson1_serializeDocumentTarget(v.Target, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsVpcConfiguration(v *types.AwsVpcConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AssignPublicIp) > 0 { + ok := object.Key("AssignPublicIp") + ok.String(string(v.AssignPublicIp)) + } + + if v.SecurityGroups != nil { + ok := object.Key("SecurityGroups") + if err := awsRestjson1_serializeDocumentSecurityGroups(v.SecurityGroups, ok); err != nil { + return err + } + } + + if v.Subnets != nil { + ok := object.Key("Subnets") + if err := awsRestjson1_serializeDocumentSubnets(v.Subnets, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCapacityProviderStrategy(v []types.CapacityProviderStrategyItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCapacityProviderStrategyItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCapacityProviderStrategyItem(v *types.CapacityProviderStrategyItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Base != 0 { + ok := object.Key("base") + ok.Integer(v.Base) + } + + if v.CapacityProvider != nil { + ok := object.Key("capacityProvider") + ok.String(*v.CapacityProvider) + } + + if v.Weight != 0 { + ok := object.Key("weight") + ok.Integer(v.Weight) + } + + return nil +} + +func awsRestjson1_serializeDocumentDeadLetterConfig(v *types.DeadLetterConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + return nil +} + +func awsRestjson1_serializeDocumentEcsParameters(v *types.EcsParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CapacityProviderStrategy != nil { + ok := object.Key("CapacityProviderStrategy") + if err := awsRestjson1_serializeDocumentCapacityProviderStrategy(v.CapacityProviderStrategy, ok); err != nil { + return err + } + } + + if v.EnableECSManagedTags != nil { + ok := object.Key("EnableECSManagedTags") + ok.Boolean(*v.EnableECSManagedTags) + } + + if v.EnableExecuteCommand != nil { + ok := object.Key("EnableExecuteCommand") + ok.Boolean(*v.EnableExecuteCommand) + } + + if v.Group != nil { + ok := object.Key("Group") + ok.String(*v.Group) + } + + if len(v.LaunchType) > 0 { + ok := object.Key("LaunchType") + ok.String(string(v.LaunchType)) + } + + if v.NetworkConfiguration != nil { + ok := object.Key("NetworkConfiguration") + if err := awsRestjson1_serializeDocumentNetworkConfiguration(v.NetworkConfiguration, ok); err != nil { + return err + } + } + + if v.PlacementConstraints != nil { + ok := object.Key("PlacementConstraints") + if err := awsRestjson1_serializeDocumentPlacementConstraints(v.PlacementConstraints, ok); err != nil { + return err + } + } + + if v.PlacementStrategy != nil { + ok := object.Key("PlacementStrategy") + if err := awsRestjson1_serializeDocumentPlacementStrategies(v.PlacementStrategy, ok); err != nil { + return err + } + } + + if v.PlatformVersion != nil { + ok := object.Key("PlatformVersion") + ok.String(*v.PlatformVersion) + } + + if len(v.PropagateTags) > 0 { + ok := object.Key("PropagateTags") + ok.String(string(v.PropagateTags)) + } + + if v.ReferenceId != nil { + ok := object.Key("ReferenceId") + ok.String(*v.ReferenceId) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + if v.TaskCount != nil { + ok := object.Key("TaskCount") + ok.Integer(*v.TaskCount) + } + + if v.TaskDefinitionArn != nil { + ok := object.Key("TaskDefinitionArn") + ok.String(*v.TaskDefinitionArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentEventBridgeParameters(v *types.EventBridgeParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DetailType != nil { + ok := object.Key("DetailType") + ok.String(*v.DetailType) + } + + if v.Source != nil { + ok := object.Key("Source") + ok.String(*v.Source) + } + + return nil +} + +func awsRestjson1_serializeDocumentFlexibleTimeWindow(v *types.FlexibleTimeWindow, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaximumWindowInMinutes != nil { + ok := object.Key("MaximumWindowInMinutes") + ok.Integer(*v.MaximumWindowInMinutes) + } + + if len(v.Mode) > 0 { + ok := object.Key("Mode") + ok.String(string(v.Mode)) + } + + return nil +} + +func awsRestjson1_serializeDocumentKinesisParameters(v *types.KinesisParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PartitionKey != nil { + ok := object.Key("PartitionKey") + ok.String(*v.PartitionKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentNetworkConfiguration(v *types.NetworkConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsvpcConfiguration != nil { + ok := object.Key("awsvpcConfiguration") + if err := awsRestjson1_serializeDocumentAwsVpcConfiguration(v.AwsvpcConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPlacementConstraint(v *types.PlacementConstraint, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Expression != nil { + ok := object.Key("expression") + ok.String(*v.Expression) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentPlacementConstraints(v []types.PlacementConstraint, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPlacementConstraint(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPlacementStrategies(v []types.PlacementStrategy, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPlacementStrategy(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPlacementStrategy(v *types.PlacementStrategy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Field != nil { + ok := object.Key("field") + ok.String(*v.Field) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRetryPolicy(v *types.RetryPolicy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaximumEventAgeInSeconds != nil { + ok := object.Key("MaximumEventAgeInSeconds") + ok.Integer(*v.MaximumEventAgeInSeconds) + } + + if v.MaximumRetryAttempts != nil { + ok := object.Key("MaximumRetryAttempts") + ok.Integer(*v.MaximumRetryAttempts) + } + + return nil +} + +func awsRestjson1_serializeDocumentSageMakerPipelineParameter(v *types.SageMakerPipelineParameter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentSageMakerPipelineParameterList(v []types.SageMakerPipelineParameter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSageMakerPipelineParameter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSageMakerPipelineParameters(v *types.SageMakerPipelineParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PipelineParameterList != nil { + ok := object.Key("PipelineParameterList") + if err := awsRestjson1_serializeDocumentSageMakerPipelineParameterList(v.PipelineParameterList, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSecurityGroups(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentSqsParameters(v *types.SqsParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MessageGroupId != nil { + ok := object.Key("MessageGroupId") + ok.String(*v.MessageGroupId) + } + + return nil +} + +func awsRestjson1_serializeDocumentSubnets(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentTags(v []map[string]string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentTagMap(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTarget(v *types.Target, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + if v.DeadLetterConfig != nil { + ok := object.Key("DeadLetterConfig") + if err := awsRestjson1_serializeDocumentDeadLetterConfig(v.DeadLetterConfig, ok); err != nil { + return err + } + } + + if v.EcsParameters != nil { + ok := object.Key("EcsParameters") + if err := awsRestjson1_serializeDocumentEcsParameters(v.EcsParameters, ok); err != nil { + return err + } + } + + if v.EventBridgeParameters != nil { + ok := object.Key("EventBridgeParameters") + if err := awsRestjson1_serializeDocumentEventBridgeParameters(v.EventBridgeParameters, ok); err != nil { + return err + } + } + + if v.Input != nil { + ok := object.Key("Input") + ok.String(*v.Input) + } + + if v.KinesisParameters != nil { + ok := object.Key("KinesisParameters") + if err := awsRestjson1_serializeDocumentKinesisParameters(v.KinesisParameters, ok); err != nil { + return err + } + } + + if v.RetryPolicy != nil { + ok := object.Key("RetryPolicy") + if err := awsRestjson1_serializeDocumentRetryPolicy(v.RetryPolicy, ok); err != nil { + return err + } + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.SageMakerPipelineParameters != nil { + ok := object.Key("SageMakerPipelineParameters") + if err := awsRestjson1_serializeDocumentSageMakerPipelineParameters(v.SageMakerPipelineParameters, ok); err != nil { + return err + } + } + + if v.SqsParameters != nil { + ok := object.Key("SqsParameters") + if err := awsRestjson1_serializeDocumentSqsParameters(v.SqsParameters, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/scheduler/types/enums.go b/service/scheduler/types/enums.go new file mode 100644 index 00000000000..8fa88ac1b3f --- /dev/null +++ b/service/scheduler/types/enums.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AssignPublicIp string + +// Enum values for AssignPublicIp +const ( + AssignPublicIpEnabled AssignPublicIp = "ENABLED" + AssignPublicIpDisabled AssignPublicIp = "DISABLED" +) + +// Values returns all known values for AssignPublicIp. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (AssignPublicIp) Values() []AssignPublicIp { + return []AssignPublicIp{ + "ENABLED", + "DISABLED", + } +} + +type FlexibleTimeWindowMode string + +// Enum values for FlexibleTimeWindowMode +const ( + FlexibleTimeWindowModeOff FlexibleTimeWindowMode = "OFF" + FlexibleTimeWindowModeFlexible FlexibleTimeWindowMode = "FLEXIBLE" +) + +// Values returns all known values for FlexibleTimeWindowMode. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (FlexibleTimeWindowMode) Values() []FlexibleTimeWindowMode { + return []FlexibleTimeWindowMode{ + "OFF", + "FLEXIBLE", + } +} + +type LaunchType string + +// Enum values for LaunchType +const ( + LaunchTypeEc2 LaunchType = "EC2" + LaunchTypeFargate LaunchType = "FARGATE" + LaunchTypeExternal LaunchType = "EXTERNAL" +) + +// Values returns all known values for LaunchType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (LaunchType) Values() []LaunchType { + return []LaunchType{ + "EC2", + "FARGATE", + "EXTERNAL", + } +} + +type PlacementConstraintType string + +// Enum values for PlacementConstraintType +const ( + PlacementConstraintTypeDistinctInstance PlacementConstraintType = "distinctInstance" + PlacementConstraintTypeMemberOf PlacementConstraintType = "memberOf" +) + +// Values returns all known values for PlacementConstraintType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PlacementConstraintType) Values() []PlacementConstraintType { + return []PlacementConstraintType{ + "distinctInstance", + "memberOf", + } +} + +type PlacementStrategyType string + +// Enum values for PlacementStrategyType +const ( + PlacementStrategyTypeRandom PlacementStrategyType = "random" + PlacementStrategyTypeSpread PlacementStrategyType = "spread" + PlacementStrategyTypeBinpack PlacementStrategyType = "binpack" +) + +// Values returns all known values for PlacementStrategyType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PlacementStrategyType) Values() []PlacementStrategyType { + return []PlacementStrategyType{ + "random", + "spread", + "binpack", + } +} + +type PropagateTags string + +// Enum values for PropagateTags +const ( + PropagateTagsTaskDefinition PropagateTags = "TASK_DEFINITION" +) + +// Values returns all known values for PropagateTags. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PropagateTags) Values() []PropagateTags { + return []PropagateTags{ + "TASK_DEFINITION", + } +} + +type ScheduleGroupState string + +// Enum values for ScheduleGroupState +const ( + ScheduleGroupStateActive ScheduleGroupState = "ACTIVE" + ScheduleGroupStateDeleting ScheduleGroupState = "DELETING" +) + +// Values returns all known values for ScheduleGroupState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ScheduleGroupState) Values() []ScheduleGroupState { + return []ScheduleGroupState{ + "ACTIVE", + "DELETING", + } +} + +type ScheduleState string + +// Enum values for ScheduleState +const ( + ScheduleStateEnabled ScheduleState = "ENABLED" + ScheduleStateDisabled ScheduleState = "DISABLED" +) + +// Values returns all known values for ScheduleState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ScheduleState) Values() []ScheduleState { + return []ScheduleState{ + "ENABLED", + "DISABLED", + } +} diff --git a/service/scheduler/types/errors.go b/service/scheduler/types/errors.go new file mode 100644 index 00000000000..e192d2a8876 --- /dev/null +++ b/service/scheduler/types/errors.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Updating or deleting the resource can cause an inconsistent state. +type ConflictException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Unexpected error encountered while processing the request. +type InternalServerException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request references a resource which does not exist. +type ResourceNotFoundException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request exceeds a service quota. +type ServiceQuotaExceededException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/scheduler/types/types.go b/service/scheduler/types/types.go new file mode 100644 index 00000000000..72f6170ce41 --- /dev/null +++ b/service/scheduler/types/types.go @@ -0,0 +1,449 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// This structure specifies the VPC subnets and security groups for the task, and +// whether a public IP address is to be used. This structure is relevant only for +// ECS tasks that use the awsvpc network mode. +type AwsVpcConfiguration struct { + + // Specifies the subnets associated with the task. These subnets must all be in the + // same VPC. You can specify as many as 16 subnets. + // + // This member is required. + Subnets []string + + // Specifies whether the task's elastic network interface receives a public IP + // address. You can specify ENABLED only when LaunchType in EcsParameters is set to + // FARGATE. + AssignPublicIp AssignPublicIp + + // Specifies the security groups associated with the task. These security groups + // must all be in the same VPC. You can specify as many as five security groups. If + // you do not specify a security group, the default security group for the VPC is + // used. + SecurityGroups []string + + noSmithyDocumentSerde +} + +// The details of a capacity provider strategy. +type CapacityProviderStrategyItem struct { + + // The short name of the capacity provider. + // + // This member is required. + CapacityProvider *string + + // The base value designates how many tasks, at a minimum, to run on the specified + // capacity provider. Only one capacity provider in a capacity provider strategy + // can have a base defined. If no value is specified, the default value of 0 is + // used. + Base int32 + + // The weight value designates the relative percentage of the total number of tasks + // launched that should use the specified capacity provider. The weight value is + // taken into consideration after the base value, if defined, is satisfied. + Weight int32 + + noSmithyDocumentSerde +} + +// An object that contains information about an Amazon SQS queue that EventBridge +// Scheduler uses as a dead-letter queue for your schedule. If specified, +// EventBridge Scheduler delivers failed events that could not be successfully +// delivered to a target to the queue. +type DeadLetterConfig struct { + + // The Amazon Resource Name (ARN) of the SQS queue specified as the destination for + // the dead-letter queue. + Arn *string + + noSmithyDocumentSerde +} + +// The templated target type for the Amazon ECS RunTask +// (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) API +// operation. +type EcsParameters struct { + + // The Amazon Resource Name (ARN) of the task definition to use if the event target + // is an Amazon ECS task. + // + // This member is required. + TaskDefinitionArn *string + + // The capacity provider strategy to use for the task. + CapacityProviderStrategy []CapacityProviderStrategyItem + + // Specifies whether to enable Amazon ECS managed tags for the task. For more + // information, see Tagging Your Amazon ECS Resources + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) + // in the Amazon ECS Developer Guide. + EnableECSManagedTags *bool + + // Whether or not to enable the execute command functionality for the containers in + // this task. If true, this enables execute command functionality on all containers + // in the task. + EnableExecuteCommand *bool + + // Specifies an ECS task group for the task. The maximum length is 255 characters. + Group *string + + // Specifies the launch type on which your task is running. The launch type that + // you specify here must match one of the launch type (compatibilities) of the + // target task. The FARGATE value is supported only in the Regions where Fargate + // with Amazon ECS is supported. For more information, see AWS Fargate on Amazon + // ECS + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) + // in the Amazon ECS Developer Guide. + LaunchType LaunchType + + // This structure specifies the network configuration for an ECS task. + NetworkConfiguration *NetworkConfiguration + + // An array of placement constraint objects to use for the task. You can specify up + // to 10 constraints per task (including constraints in the task definition and + // those specified at runtime). + PlacementConstraints []PlacementConstraint + + // The task placement strategy for a task or service. + PlacementStrategy []PlacementStrategy + + // Specifies the platform version for the task. Specify only the numeric portion of + // the platform version, such as 1.1.0. + PlatformVersion *string + + // Specifies whether to propagate the tags from the task definition to the task. If + // no value is specified, the tags are not propagated. Tags can only be propagated + // to the task during task creation. To add tags to a task after task creation, use + // Amazon ECS's TagResource + // (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html) + // API action. + PropagateTags PropagateTags + + // The reference ID to use for the task. + ReferenceId *string + + // The metadata that you apply to the task to help you categorize and organize + // them. Each tag consists of a key and an optional value, both of which you + // define. For more information, see RunTask + // (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) in + // the Amazon ECS API Reference. + Tags []map[string]string + + // The number of tasks to create based on TaskDefinition. The default is 1. + TaskCount *int32 + + noSmithyDocumentSerde +} + +// The templated target type for the EventBridge PutEvents +// (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) +// API operation. +type EventBridgeParameters struct { + + // A free-form string, with a maximum of 128 characters, used to decide what fields + // to expect in the event detail. + // + // This member is required. + DetailType *string + + // The source of the event. + // + // This member is required. + Source *string + + noSmithyDocumentSerde +} + +// Allows you to configure a time window during which EventBridge Scheduler invokes +// the schedule. +type FlexibleTimeWindow struct { + + // Determines whether the schedule is invoked within a flexible time window. + // + // This member is required. + Mode FlexibleTimeWindowMode + + // The maximum time window during which a schedule can be invoked. + MaximumWindowInMinutes *int32 + + noSmithyDocumentSerde +} + +// The templated target type for the Amazon Kinesis PutRecord API operation. +type KinesisParameters struct { + + // Specifies the shard to which EventBridge Scheduler sends the event. For more + // information, see Amazon Kinesis Data Streams terminology and concepts + // (https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html) in the Amazon + // Kinesis Streams Developer Guide. + // + // This member is required. + PartitionKey *string + + noSmithyDocumentSerde +} + +// Specifies the network configuration for an ECS task. +type NetworkConfiguration struct { + + // Specifies the Amazon VPC subnets and security groups for the task, and whether a + // public IP address is to be used. This structure is relevant only for ECS tasks + // that use the awsvpc network mode. + AwsvpcConfiguration *AwsVpcConfiguration + + noSmithyDocumentSerde +} + +// An object representing a constraint on task placement. +type PlacementConstraint struct { + + // A cluster query language expression to apply to the constraint. You cannot + // specify an expression if the constraint type is distinctInstance. For more + // information, see Cluster query language + // (https://docs.aws.amazon.com/latest/developerguide/cluster-query-language.html) + // in the Amazon ECS Developer Guide. + Expression *string + + // The type of constraint. Use distinctInstance to ensure that each task in a + // particular group is running on a different container instance. Use memberOf to + // restrict the selection to a group of valid candidates. + Type PlacementConstraintType + + noSmithyDocumentSerde +} + +// The task placement strategy for a task or service. +type PlacementStrategy struct { + + // The field to apply the placement strategy against. For the spread placement + // strategy, valid values are instanceId (or instanceId, which has the same + // effect), or any platform or custom attribute that is applied to a container + // instance, such as attribute:ecs.availability-zone. For the binpack placement + // strategy, valid values are cpu and memory. For the random placement strategy, + // this field is not used. + Field *string + + // The type of placement strategy. The random placement strategy randomly places + // tasks on available candidates. The spread placement strategy spreads placement + // across available candidates evenly based on the field parameter. The binpack + // strategy places tasks on available candidates that have the least available + // amount of the resource that is specified with the field parameter. For example, + // if you binpack on memory, a task is placed on the instance with the least amount + // of remaining memory (but still enough to run the task). + Type PlacementStrategyType + + noSmithyDocumentSerde +} + +// A RetryPolicy object that includes information about the retry policy settings, +// including the maximum age of an event, and the maximum number of times +// EventBridge Scheduler will try to deliver the event to a target. +type RetryPolicy struct { + + // The maximum amount of time, in seconds, to continue to make retry attempts. + MaximumEventAgeInSeconds *int32 + + // The maximum number of retry attempts to make before the request fails. Retry + // attempts with exponential backoff continue until either the maximum number of + // attempts is made or until the duration of the MaximumEventAgeInSeconds is + // reached. + MaximumRetryAttempts *int32 + + noSmithyDocumentSerde +} + +// The name and value pair of a parameter to use to start execution of a SageMaker +// Model Building Pipeline. +type SageMakerPipelineParameter struct { + + // Name of parameter to start execution of a SageMaker Model Building Pipeline. + // + // This member is required. + Name *string + + // Value of parameter to start execution of a SageMaker Model Building Pipeline. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The templated target type for the Amazon SageMaker StartPipelineExecution +// (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html) +// API operation. +type SageMakerPipelineParameters struct { + + // List of parameter names and values to use when executing the SageMaker Model + // Building Pipeline. + PipelineParameterList []SageMakerPipelineParameter + + noSmithyDocumentSerde +} + +// The details of a schedule group. +type ScheduleGroupSummary struct { + + // The Amazon Resource Name (ARN) of the schedule group. + Arn *string + + // The time at which the schedule group was created. + CreationDate *time.Time + + // The time at which the schedule group was last modified. + LastModificationDate *time.Time + + // The name of the schedule group. + Name *string + + // Specifies the state of the schedule group. + State ScheduleGroupState + + noSmithyDocumentSerde +} + +// The details of a schedule. +type ScheduleSummary struct { + + // The Amazon Resource Name (ARN) of the schedule. + Arn *string + + // The time at which the schedule was created. + CreationDate *time.Time + + // The name of the schedule group associated with this schedule. + GroupName *string + + // The time at which the schedule was last modified. + LastModificationDate *time.Time + + // The name of the schedule. + Name *string + + // Specifies whether the schedule is enabled or disabled. + State ScheduleState + + // The schedule's target details. + Target *TargetSummary + + noSmithyDocumentSerde +} + +// The templated target type for the Amazon SQS SendMessage +// (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) +// API operation. Contains the message group ID to use when the target is a FIFO +// queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have +// content-based deduplication enabled. For more information, see Using the Amazon +// SQS message deduplication ID +// (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) +// in the Amazon SQS Developer Guide. +type SqsParameters struct { + + // The FIFO message group ID to use as the target. + MessageGroupId *string + + noSmithyDocumentSerde +} + +// Tag to associate with a schedule group. +type Tag struct { + + // The key for the tag. + // + // This member is required. + Key *string + + // The value for the tag. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The schedule's target. EventBridge Scheduler supports templated target that +// invoke common API operations, as well as universal targets that you can +// customize to invoke over 6,000 API operations across more than 270 services. You +// can only specify one templated or universal target for a schedule. +type Target struct { + + // The Amazon Resource Name (ARN) of the target. + // + // This member is required. + Arn *string + + // The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will + // use for this target when the schedule is invoked. + // + // This member is required. + RoleArn *string + + // An object that contains information about an Amazon SQS queue that EventBridge + // Scheduler uses as a dead-letter queue for your schedule. If specified, + // EventBridge Scheduler delivers failed events that could not be successfully + // delivered to a target to the queue. + DeadLetterConfig *DeadLetterConfig + + // The templated target type for the Amazon ECS RunTask + // (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) API + // operation. + EcsParameters *EcsParameters + + // The templated target type for the EventBridge PutEvents + // (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) + // API operation. + EventBridgeParameters *EventBridgeParameters + + // The text, or well-formed JSON, passed to the target. If you are configuring a + // templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input + // must be a well-formed JSON. For all other target types, a JSON is not required. + // If you do not specify anything for this field, EventBridge Scheduler delivers a + // default notification to the target. + Input *string + + // The templated target type for the Amazon Kinesis PutRecord API operation. + KinesisParameters *KinesisParameters + + // A RetryPolicy object that includes information about the retry policy settings, + // including the maximum age of an event, and the maximum number of times + // EventBridge Scheduler will try to deliver the event to a target. + RetryPolicy *RetryPolicy + + // The templated target type for the Amazon SageMaker StartPipelineExecution + // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html) + // API operation. + SageMakerPipelineParameters *SageMakerPipelineParameters + + // The templated target type for the Amazon SQS SendMessage + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) + // API operation. Contains the message group ID to use when the target is a FIFO + // queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have + // content-based deduplication enabled. For more information, see Using the Amazon + // SQS message deduplication ID + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + // in the Amazon SQS Developer Guide. + SqsParameters *SqsParameters + + noSmithyDocumentSerde +} + +// The details of a target. +type TargetSummary struct { + + // The Amazon Resource Name (ARN) of the target. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/scheduler/validators.go b/service/scheduler/validators.go new file mode 100644 index 00000000000..cd417e06bf1 --- /dev/null +++ b/service/scheduler/validators.go @@ -0,0 +1,712 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/scheduler/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateScheduleGroup struct { +} + +func (*validateOpCreateScheduleGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateScheduleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateScheduleGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateScheduleGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSchedule struct { +} + +func (*validateOpCreateSchedule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateScheduleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteScheduleGroup struct { +} + +func (*validateOpDeleteScheduleGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteScheduleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteScheduleGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteScheduleGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSchedule struct { +} + +func (*validateOpDeleteSchedule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteScheduleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetScheduleGroup struct { +} + +func (*validateOpGetScheduleGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetScheduleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetScheduleGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetScheduleGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSchedule struct { +} + +func (*validateOpGetSchedule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetScheduleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSchedule struct { +} + +func (*validateOpUpdateSchedule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateScheduleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateScheduleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateScheduleGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateScheduleGroup{}, middleware.After) +} + +func addOpCreateScheduleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSchedule{}, middleware.After) +} + +func addOpDeleteScheduleGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteScheduleGroup{}, middleware.After) +} + +func addOpDeleteScheduleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSchedule{}, middleware.After) +} + +func addOpGetScheduleGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetScheduleGroup{}, middleware.After) +} + +func addOpGetScheduleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSchedule{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateScheduleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSchedule{}, middleware.After) +} + +func validateAwsVpcConfiguration(v *types.AwsVpcConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AwsVpcConfiguration"} + if v.Subnets == nil { + invalidParams.Add(smithy.NewErrParamRequired("Subnets")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCapacityProviderStrategy(v []types.CapacityProviderStrategyItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CapacityProviderStrategy"} + for i := range v { + if err := validateCapacityProviderStrategyItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCapacityProviderStrategyItem(v *types.CapacityProviderStrategyItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CapacityProviderStrategyItem"} + if v.CapacityProvider == nil { + invalidParams.Add(smithy.NewErrParamRequired("CapacityProvider")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEcsParameters(v *types.EcsParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EcsParameters"} + if v.TaskDefinitionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaskDefinitionArn")) + } + if v.NetworkConfiguration != nil { + if err := validateNetworkConfiguration(v.NetworkConfiguration); err != nil { + invalidParams.AddNested("NetworkConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.CapacityProviderStrategy != nil { + if err := validateCapacityProviderStrategy(v.CapacityProviderStrategy); err != nil { + invalidParams.AddNested("CapacityProviderStrategy", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEventBridgeParameters(v *types.EventBridgeParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventBridgeParameters"} + if v.DetailType == nil { + invalidParams.Add(smithy.NewErrParamRequired("DetailType")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFlexibleTimeWindow(v *types.FlexibleTimeWindow) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FlexibleTimeWindow"} + if len(v.Mode) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Mode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKinesisParameters(v *types.KinesisParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KinesisParameters"} + if v.PartitionKey == nil { + invalidParams.Add(smithy.NewErrParamRequired("PartitionKey")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNetworkConfiguration(v *types.NetworkConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NetworkConfiguration"} + if v.AwsvpcConfiguration != nil { + if err := validateAwsVpcConfiguration(v.AwsvpcConfiguration); err != nil { + invalidParams.AddNested("AwsvpcConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSageMakerPipelineParameter(v *types.SageMakerPipelineParameter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SageMakerPipelineParameter"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSageMakerPipelineParameterList(v []types.SageMakerPipelineParameter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SageMakerPipelineParameterList"} + for i := range v { + if err := validateSageMakerPipelineParameter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSageMakerPipelineParameters(v *types.SageMakerPipelineParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SageMakerPipelineParameters"} + if v.PipelineParameterList != nil { + if err := validateSageMakerPipelineParameterList(v.PipelineParameterList); err != nil { + invalidParams.AddNested("PipelineParameterList", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTarget(v *types.Target) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Target"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.EcsParameters != nil { + if err := validateEcsParameters(v.EcsParameters); err != nil { + invalidParams.AddNested("EcsParameters", err.(smithy.InvalidParamsError)) + } + } + if v.EventBridgeParameters != nil { + if err := validateEventBridgeParameters(v.EventBridgeParameters); err != nil { + invalidParams.AddNested("EventBridgeParameters", err.(smithy.InvalidParamsError)) + } + } + if v.KinesisParameters != nil { + if err := validateKinesisParameters(v.KinesisParameters); err != nil { + invalidParams.AddNested("KinesisParameters", err.(smithy.InvalidParamsError)) + } + } + if v.SageMakerPipelineParameters != nil { + if err := validateSageMakerPipelineParameters(v.SageMakerPipelineParameters); err != nil { + invalidParams.AddNested("SageMakerPipelineParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateScheduleGroupInput(v *CreateScheduleGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateScheduleGroupInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateScheduleInput(v *CreateScheduleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateScheduleInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ScheduleExpression == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScheduleExpression")) + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } else if v.Target != nil { + if err := validateTarget(v.Target); err != nil { + invalidParams.AddNested("Target", err.(smithy.InvalidParamsError)) + } + } + if v.FlexibleTimeWindow == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlexibleTimeWindow")) + } else if v.FlexibleTimeWindow != nil { + if err := validateFlexibleTimeWindow(v.FlexibleTimeWindow); err != nil { + invalidParams.AddNested("FlexibleTimeWindow", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteScheduleGroupInput(v *DeleteScheduleGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteScheduleGroupInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteScheduleInput(v *DeleteScheduleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteScheduleInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetScheduleGroupInput(v *GetScheduleGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetScheduleGroupInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetScheduleInput(v *GetScheduleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetScheduleInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } else if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateScheduleInput(v *UpdateScheduleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateScheduleInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ScheduleExpression == nil { + invalidParams.Add(smithy.NewErrParamRequired("ScheduleExpression")) + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } else if v.Target != nil { + if err := validateTarget(v.Target); err != nil { + invalidParams.AddNested("Target", err.(smithy.InvalidParamsError)) + } + } + if v.FlexibleTimeWindow == nil { + invalidParams.Add(smithy.NewErrParamRequired("FlexibleTimeWindow")) + } else if v.FlexibleTimeWindow != nil { + if err := validateFlexibleTimeWindow(v.FlexibleTimeWindow); err != nil { + invalidParams.AddNested("FlexibleTimeWindow", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/secretsmanager/internal/endpoints/endpoints.go b/service/secretsmanager/internal/endpoints/endpoints.go index 6f8471503fd..8792df89183 100644 --- a/service/secretsmanager/internal/endpoints/endpoints.go +++ b/service/secretsmanager/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/sfn/internal/endpoints/endpoints.go b/service/sfn/internal/endpoints/endpoints.go index 92972225c3c..0f5fbf443a1 100644 --- a/service/sfn/internal/endpoints/endpoints.go +++ b/service/sfn/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/sns/internal/endpoints/endpoints.go b/service/sns/internal/endpoints/endpoints.go index cd3b4105f24..addfbf1583d 100644 --- a/service/sns/internal/endpoints/endpoints.go +++ b/service/sns/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/sqs/internal/endpoints/endpoints.go b/service/sqs/internal/endpoints/endpoints.go index 1edbb35ac5a..bdc0259e912 100644 --- a/service/sqs/internal/endpoints/endpoints.go +++ b/service/sqs/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/ssm/internal/endpoints/endpoints.go b/service/ssm/internal/endpoints/endpoints.go index 300475bee4d..2fe4d160c8e 100644 --- a/service/ssm/internal/endpoints/endpoints.go +++ b/service/ssm/internal/endpoints/endpoints.go @@ -174,6 +174,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/storagegateway/internal/endpoints/endpoints.go b/service/storagegateway/internal/endpoints/endpoints.go index 6fb082ce712..6d6fce7170d 100644 --- a/service/storagegateway/internal/endpoints/endpoints.go +++ b/service/storagegateway/internal/endpoints/endpoints.go @@ -207,6 +207,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/sts/internal/endpoints/endpoints.go b/service/sts/internal/endpoints/endpoints.go index d061a4e9926..1b4c8cc99c1 100644 --- a/service/sts/internal/endpoints/endpoints.go +++ b/service/sts/internal/endpoints/endpoints.go @@ -176,6 +176,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/swf/internal/endpoints/endpoints.go b/service/swf/internal/endpoints/endpoints.go index 8b3e623291d..685d2530ca5 100644 --- a/service/swf/internal/endpoints/endpoints.go +++ b/service/swf/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/synthetics/internal/endpoints/endpoints.go b/service/synthetics/internal/endpoints/endpoints.go index fa5dde09074..09f30bde4d1 100644 --- a/service/synthetics/internal/endpoints/endpoints.go +++ b/service/synthetics/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, diff --git a/service/xray/internal/endpoints/endpoints.go b/service/xray/internal/endpoints/endpoints.go index f2fc86ba0e4..54219b059e9 100644 --- a/service/xray/internal/endpoints/endpoints.go +++ b/service/xray/internal/endpoints/endpoints.go @@ -168,6 +168,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{},