diff --git a/.changelog/03b221e712d342fabe82a9de64ab12bb.json b/.changelog/03b221e712d342fabe82a9de64ab12bb.json new file mode 100644 index 00000000000..4f27eac5871 --- /dev/null +++ b/.changelog/03b221e712d342fabe82a9de64ab12bb.json @@ -0,0 +1,8 @@ +{ + "id": "03b221e7-12d3-42fa-be82-a9de64ab12bb", + "type": "feature", + "description": "This feature allows Batch on EKS to support configuration of Pod Labels through Metadata for Batch on EKS Jobs.", + "modules": [ + "service/batch" + ] +} \ No newline at end of file diff --git a/.changelog/1cf9ad3559ee4c31bda2e19def8c1a22.json b/.changelog/1cf9ad3559ee4c31bda2e19def8c1a22.json new file mode 100644 index 00000000000..60d31a69f6a --- /dev/null +++ b/.changelog/1cf9ad3559ee4c31bda2e19def8c1a22.json @@ -0,0 +1,8 @@ +{ + "id": "1cf9ad35-59ee-4c31-bda2-e19def8c1a22", + "type": "feature", + "description": "AWS Network Firewall added TLS inspection configurations to allow TLS traffic inspection.", + "modules": [ + "service/networkfirewall" + ] +} \ No newline at end of file diff --git a/.changelog/3168e383fbfa485bab6a3dde73f2f8aa.json b/.changelog/3168e383fbfa485bab6a3dde73f2f8aa.json new file mode 100644 index 00000000000..501758fbbe8 --- /dev/null +++ b/.changelog/3168e383fbfa485bab6a3dde73f2f8aa.json @@ -0,0 +1,8 @@ +{ + "id": "3168e383-fbfa-485b-ab6a-3dde73f2f8aa", + "type": "feature", + "description": "Amazon SageMaker geospatial capabilities now supports server-side encryption with customer managed KMS key and SageMaker notebooks with a SageMaker geospatial image in a Amazon SageMaker Domain with VPC only mode.", + "modules": [ + "service/sagemakergeospatial" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..d88405fdcfb --- /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/vpclattice" + ] +} \ No newline at end of file diff --git a/.changelog/63e1502424aa440996a594228d0d4a43.json b/.changelog/63e1502424aa440996a594228d0d4a43.json new file mode 100644 index 00000000000..2cbcf27b908 --- /dev/null +++ b/.changelog/63e1502424aa440996a594228d0d4a43.json @@ -0,0 +1,8 @@ +{ + "id": "63e15024-24aa-4409-96a5-94228d0d4a43", + "type": "feature", + "description": "Amazon EC2 Auto Scaling now supports Elastic Load Balancing traffic sources with the AttachTrafficSources, DetachTrafficSources, and DescribeTrafficSources APIs. This release also introduces a new activity status, \"WaitingForConnectionDraining\", for VPC Lattice to the DescribeScalingActivities API.", + "modules": [ + "service/autoscaling" + ] +} \ No newline at end of file diff --git a/.changelog/67a0f5170414490cb37eaf534a144443.json b/.changelog/67a0f5170414490cb37eaf534a144443.json new file mode 100644 index 00000000000..3c0c1c6abd1 --- /dev/null +++ b/.changelog/67a0f5170414490cb37eaf534a144443.json @@ -0,0 +1,8 @@ +{ + "id": "67a0f517-0414-490c-b37e-af534a144443", + "type": "feature", + "description": "Added EKS Runtime Monitoring feature support to existing detector, finding APIs and introducing new Coverage APIs", + "modules": [ + "service/guardduty" + ] +} \ No newline at end of file diff --git a/.changelog/9184a9a69d984e73b36d7912cb3d545a.json b/.changelog/9184a9a69d984e73b36d7912cb3d545a.json new file mode 100644 index 00000000000..4445a1084be --- /dev/null +++ b/.changelog/9184a9a69d984e73b36d7912cb3d545a.json @@ -0,0 +1,8 @@ +{ + "id": "9184a9a6-9d98-4e73-b36d-7912cb3d545a", + "type": "feature", + "description": "This release adds support for Tunnel Endpoint Lifecycle control, a new feature that provides Site-to-Site VPN customers with better visibility and control of their VPN tunnel maintenance updates.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/a088c1310a1044b3a0437365e369a1d1.json b/.changelog/a088c1310a1044b3a0437365e369a1d1.json new file mode 100644 index 00000000000..c09e199a99a --- /dev/null +++ b/.changelog/a088c1310a1044b3a0437365e369a1d1.json @@ -0,0 +1,8 @@ +{ + "id": "a088c131-0a10-44b3-a043-7365e369a1d1", + "type": "feature", + "description": "Adding a field to the replication configuration APIs to support the auto replicate new disks feature. We also deprecated RetryDataReplication.", + "modules": [ + "service/drs" + ] +} \ No newline at end of file diff --git a/.changelog/a9220b14c49e485ead1a05ec9df1993b.json b/.changelog/a9220b14c49e485ead1a05ec9df1993b.json new file mode 100644 index 00000000000..d409ae1dbdb --- /dev/null +++ b/.changelog/a9220b14c49e485ead1a05ec9df1993b.json @@ -0,0 +1,8 @@ +{ + "id": "a9220b14-c49e-485e-ad1a-05ec9df1993b", + "type": "feature", + "description": "Updated DescribeCluster and ListClusters API responses to include ErrorDetail that specifies error code, programmatically accessible error data,and an error message. ErrorDetail provides the underlying reason for cluster failure and recommends actions to simplify troubleshooting of EMR clusters.", + "modules": [ + "service/emr" + ] +} \ No newline at end of file diff --git a/.changelog/a93ea7c54549477b997e3892f61c3e08.json b/.changelog/a93ea7c54549477b997e3892f61c3e08.json new file mode 100644 index 00000000000..0c53a09d14a --- /dev/null +++ b/.changelog/a93ea7c54549477b997e3892f61c3e08.json @@ -0,0 +1,8 @@ +{ + "id": "a93ea7c5-4549-477b-997e-3892f61c3e08", + "type": "feature", + "description": "Adds support for new image workflow details and image vulnerability detection.", + "modules": [ + "service/imagebuilder" + ] +} \ No newline at end of file diff --git a/.changelog/c9eb72433190436cad713141628e101a.json b/.changelog/c9eb72433190436cad713141628e101a.json new file mode 100644 index 00000000000..5c32fe4b527 --- /dev/null +++ b/.changelog/c9eb72433190436cad713141628e101a.json @@ -0,0 +1,8 @@ +{ + "id": "c9eb7243-3190-436c-ad71-3141628e101a", + "type": "feature", + "description": "AWS Kendra now supports featured results for a query.", + "modules": [ + "service/kendra" + ] +} \ No newline at end of file diff --git a/.changelog/d819496edddb4a75ba88d33d7afd40ce.json b/.changelog/d819496edddb4a75ba88d33d7afd40ce.json new file mode 100644 index 00000000000..01405351b1e --- /dev/null +++ b/.changelog/d819496edddb4a75ba88d33d7afd40ce.json @@ -0,0 +1,8 @@ +{ + "id": "d819496e-dddb-4a75-ba88-d33d7afd40ce", + "type": "feature", + "description": "Make DefaultExecutorDpuSize and CoordinatorDpuSize fields optional in StartSession", + "modules": [ + "service/athena" + ] +} \ No newline at end of file diff --git a/.changelog/da0f8d72026742f59ec28678de8f9fe3.json b/.changelog/da0f8d72026742f59ec28678de8f9fe3.json new file mode 100644 index 00000000000..436d7746cfa --- /dev/null +++ b/.changelog/da0f8d72026742f59ec28678de8f9fe3.json @@ -0,0 +1,8 @@ +{ + "id": "da0f8d72-0267-42f5-9ec2-8678de8f9fe3", + "type": "feature", + "description": "This release adds support for AWS Glue Data Quality, which helps you evaluate and monitor the quality of your data and includes the API for creating, deleting, or updating data quality rulesets, runs and evaluations.", + "modules": [ + "service/glue" + ] +} \ No newline at end of file diff --git a/.changelog/dab601f5bd674b45ab25e8f29e5dc207.json b/.changelog/dab601f5bd674b45ab25e8f29e5dc207.json new file mode 100644 index 00000000000..e340a346f24 --- /dev/null +++ b/.changelog/dab601f5bd674b45ab25e8f29e5dc207.json @@ -0,0 +1,8 @@ +{ + "id": "dab601f5-bd67-4b45-ab25-e8f29e5dc207", + "type": "feature", + "description": "General Availability (GA) release of Amazon VPC Lattice", + "modules": [ + "service/vpclattice" + ] +} \ No newline at end of file diff --git a/.changelog/dea77d29b8fd42a38ef0bf38554982d0.json b/.changelog/dea77d29b8fd42a38ef0bf38554982d0.json new file mode 100644 index 00000000000..6b508c8cb74 --- /dev/null +++ b/.changelog/dea77d29b8fd42a38ef0bf38554982d0.json @@ -0,0 +1,8 @@ +{ + "id": "dea77d29-b8fd-42a3-8ef0-bf38554982d0", + "type": "feature", + "description": "Amazon Interactive Video Service (IVS) now offers customers the ability to configure IVS channels to allow insecure RTMP ingest.", + "modules": [ + "service/ivs" + ] +} \ No newline at end of file diff --git a/.changelog/e8c53697b5464424b49ac62f092d7ccc.json b/.changelog/e8c53697b5464424b49ac62f092d7ccc.json new file mode 100644 index 00000000000..7f16a137527 --- /dev/null +++ b/.changelog/e8c53697b5464424b49ac62f092d7ccc.json @@ -0,0 +1,8 @@ +{ + "id": "e8c53697-b546-4424-b49a-c62f092d7ccc", + "type": "feature", + "description": "This release adds support for HDD EBS volume types and io2 Block Express. We are also adding support for 61 new instance types and instances that have non consecutive runtime.", + "modules": [ + "service/computeoptimizer" + ] +} \ No newline at end of file diff --git a/.changelog/eb5db98a451540f98c471d470c48699b.json b/.changelog/eb5db98a451540f98c471d470c48699b.json new file mode 100644 index 00000000000..4d94b3e4b79 --- /dev/null +++ b/.changelog/eb5db98a451540f98c471d470c48699b.json @@ -0,0 +1,8 @@ +{ + "id": "eb5db98a-4515-40f9-8c47-1d470c48699b", + "type": "feature", + "description": "AWS Well-Architected SDK now supports getting consolidated report metrics and generating a consolidated report PDF.", + "modules": [ + "service/wellarchitected" + ] +} \ No newline at end of file diff --git a/service/athena/deserializers.go b/service/athena/deserializers.go index 561b84d871c..18295732310 100644 --- a/service/athena/deserializers.go +++ b/service/athena/deserializers.go @@ -8352,7 +8352,7 @@ func awsAwsjson11_deserializeDocumentEngineConfiguration(v **types.EngineConfigu if err != nil { return err } - sv.CoordinatorDpuSize = int32(i64) + sv.CoordinatorDpuSize = ptr.Int32(int32(i64)) } case "DefaultExecutorDpuSize": @@ -8365,7 +8365,7 @@ func awsAwsjson11_deserializeDocumentEngineConfiguration(v **types.EngineConfigu if err != nil { return err } - sv.DefaultExecutorDpuSize = int32(i64) + sv.DefaultExecutorDpuSize = ptr.Int32(int32(i64)) } case "MaxConcurrentDpus": diff --git a/service/athena/serializers.go b/service/athena/serializers.go index f72c86278ce..726291cdab2 100644 --- a/service/athena/serializers.go +++ b/service/athena/serializers.go @@ -3378,14 +3378,14 @@ func awsAwsjson11_serializeDocumentEngineConfiguration(v *types.EngineConfigurat } } - if v.CoordinatorDpuSize != 0 { + if v.CoordinatorDpuSize != nil { ok := object.Key("CoordinatorDpuSize") - ok.Integer(v.CoordinatorDpuSize) + ok.Integer(*v.CoordinatorDpuSize) } - if v.DefaultExecutorDpuSize != 0 { + if v.DefaultExecutorDpuSize != nil { ok := object.Key("DefaultExecutorDpuSize") - ok.Integer(v.DefaultExecutorDpuSize) + ok.Integer(*v.DefaultExecutorDpuSize) } { diff --git a/service/athena/types/types.go b/service/athena/types/types.go index 324a0c9e491..24fef0e285f 100644 --- a/service/athena/types/types.go +++ b/service/athena/types/types.go @@ -358,11 +358,11 @@ type EngineConfiguration struct { // The number of DPUs to use for the coordinator. A coordinator is a special // executor that orchestrates processing work and manages other executors in a // notebook session. - CoordinatorDpuSize int32 + CoordinatorDpuSize *int32 // The default number of DPUs to use for executors. An executor is the smallest // unit of compute that a notebook session can request from Athena. - DefaultExecutorDpuSize int32 + DefaultExecutorDpuSize *int32 noSmithyDocumentSerde } diff --git a/service/autoscaling/api_op_AttachLoadBalancerTargetGroups.go b/service/autoscaling/api_op_AttachLoadBalancerTargetGroups.go index 400a9f9c0e1..2d25356d547 100644 --- a/service/autoscaling/api_op_AttachLoadBalancerTargetGroups.go +++ b/service/autoscaling/api_op_AttachLoadBalancerTargetGroups.go @@ -10,6 +10,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API call has been replaced with a new "traffic sources" API call +// (AttachTrafficSources) that can attach multiple traffic sources types. While we +// continue to support AttachLoadBalancerTargetGroups, and you can use both the +// original AttachLoadBalancerTargetGroups API call and the new +// AttachTrafficSources API call on the same Auto Scaling group, we recommend using +// the new "traffic sources" API call to simplify how you manage traffic sources. // Attaches one or more target groups to the specified Auto Scaling group. This // operation is used with the following load balancer types: // diff --git a/service/autoscaling/api_op_AttachLoadBalancers.go b/service/autoscaling/api_op_AttachLoadBalancers.go index e84d6d13068..44b9c611d5c 100644 --- a/service/autoscaling/api_op_AttachLoadBalancers.go +++ b/service/autoscaling/api_op_AttachLoadBalancers.go @@ -10,16 +10,20 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// To attach an Application Load Balancer, Network Load Balancer, or Gateway Load -// Balancer, use the AttachLoadBalancerTargetGroups API operation instead. Attaches -// one or more Classic Load Balancers to the specified Auto Scaling group. Amazon -// EC2 Auto Scaling registers the running instances with these Classic Load -// Balancers. To describe the load balancers for an Auto Scaling group, call the -// DescribeLoadBalancers API. To detach a load balancer from the Auto Scaling -// group, call the DetachLoadBalancers API. This operation is additive and does not -// detach existing Classic Load Balancers or target groups from the Auto Scaling -// group. For more information, see Use Elastic Load Balancing to distribute -// traffic across the instances in your Auto Scaling group +// This API call has been replaced with a new "traffic sources" API call +// (AttachTrafficSources) that can attach multiple traffic sources types. While we +// continue to support AttachLoadBalancers, and you can use both the original +// AttachLoadBalancers API call and the new AttachTrafficSources API call on the +// same Auto Scaling group, we recommend using the new "traffic sources" API call +// to simplify how you manage traffic sources. Attaches one or more Classic Load +// Balancers to the specified Auto Scaling group. Amazon EC2 Auto Scaling registers +// the running instances with these Classic Load Balancers. To describe the load +// balancers for an Auto Scaling group, call the DescribeLoadBalancers API. To +// detach a load balancer from the Auto Scaling group, call the DetachLoadBalancers +// API. This operation is additive and does not detach existing Classic Load +// Balancers or target groups from the Auto Scaling group. For more information, +// see Use Elastic Load Balancing to distribute traffic across the instances in +// your Auto Scaling group // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) // in the Amazon EC2 Auto Scaling User Guide. func (c *Client) AttachLoadBalancers(ctx context.Context, params *AttachLoadBalancersInput, optFns ...func(*Options)) (*AttachLoadBalancersOutput, error) { diff --git a/service/autoscaling/api_op_AttachTrafficSources.go b/service/autoscaling/api_op_AttachTrafficSources.go index d74c487983c..3496ae4f69a 100644 --- a/service/autoscaling/api_op_AttachTrafficSources.go +++ b/service/autoscaling/api_op_AttachTrafficSources.go @@ -11,13 +11,27 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Reserved for use with Amazon VPC Lattice, which is in preview and subject to -// change. Do not use this API for production workloads. This API is also subject -// to change. Attaches one or more traffic sources to the specified Auto Scaling -// group. To describe the traffic sources for an Auto Scaling group, call the -// DescribeTrafficSources API. To detach a traffic source from the Auto Scaling -// group, call the DetachTrafficSources API. This operation is additive and does -// not detach existing traffic sources from the Auto Scaling group. +// Attaches one or more traffic sources to the specified Auto Scaling group. You +// can use any of the following as traffic sources for an Auto Scaling group: +// +// * +// Application Load Balancer +// +// * Classic Load Balancer +// +// * Network Load Balancer +// +// * +// Gateway Load Balancer +// +// * VPC Lattice +// +// This operation is additive and does not +// detach existing traffic sources from the Auto Scaling group. After the operation +// completes, use the DescribeTrafficSources API to return details about the state +// of the attachments between traffic sources and your Auto Scaling group. To +// detach a traffic source from the Auto Scaling group, call the +// DetachTrafficSources API. func (c *Client) AttachTrafficSources(ctx context.Context, params *AttachTrafficSourcesInput, optFns ...func(*Options)) (*AttachTrafficSourcesOutput, error) { if params == nil { params = &AttachTrafficSourcesInput{} @@ -41,10 +55,7 @@ type AttachTrafficSourcesInput struct { AutoScalingGroupName *string // The unique identifiers of one or more traffic sources. You can specify up to 10 - // traffic sources. Currently, you must specify an Amazon Resource Name (ARN) for - // an existing VPC Lattice target group. Amazon EC2 Auto Scaling registers the - // running instances with the attached target groups. The target groups receive - // incoming traffic and route requests to one or more registered targets. + // traffic sources. // // This member is required. TrafficSources []types.TrafficSourceIdentifier diff --git a/service/autoscaling/api_op_CreateAutoScalingGroup.go b/service/autoscaling/api_op_CreateAutoScalingGroup.go index 407bff94c92..5d0e397a3d8 100644 --- a/service/autoscaling/api_op_CreateAutoScalingGroup.go +++ b/service/autoscaling/api_op_CreateAutoScalingGroup.go @@ -144,13 +144,11 @@ type CreateAutoScalingGroupInput struct { // in the Amazon EC2 Auto Scaling User Guide. Default: 0 seconds HealthCheckGracePeriod *int32 - // Determines whether any additional health checks are performed on the instances - // in this group. Amazon EC2 health checks are always on. For more information, see - // Health checks for Auto Scaling instances + // A comma-separated list of one or more health check types. The valid values are + // EC2, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be + // disabled. For more information, see Health checks for Auto Scaling instances // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) in the - // Amazon EC2 Auto Scaling User Guide. The valid values are EC2 (default), ELB, and - // VPC_LATTICE. The VPC_LATTICE health check type is reserved for use with VPC - // Lattice, which is in preview release and is subject to change. + // Amazon EC2 Auto Scaling User Guide. HealthCheckType *string // The ID of the instance used to base the launch configuration on. If specified, @@ -185,7 +183,7 @@ type CreateAutoScalingGroupInput struct { LifecycleHookSpecificationList []types.LifecycleHookSpecification // A list of Classic Load Balancers associated with this Auto Scaling group. For - // Application Load Balancers, Network Load Balancers, and Gateway Load Balancer, + // Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, // specify the TargetGroupARNs property instead. LoadBalancerNames []string @@ -257,13 +255,10 @@ type CreateAutoScalingGroupInput struct { // arn:aws:lambda:region:account-id:function:my-function:my-alias TerminationPolicies []string - // Reserved for use with Amazon VPC Lattice, which is in preview release and is - // subject to change. Do not use this parameter for production workloads. It is - // also subject to change. The unique identifiers of one or more traffic sources. - // Currently, you must specify an Amazon Resource Name (ARN) for an existing VPC - // Lattice target group. Amazon EC2 Auto Scaling registers the running instances - // with the attached target groups. The target groups receive incoming traffic and - // route requests to one or more registered targets. + // The list of traffic sources to attach to this Auto Scaling group. You can use + // any of the following as traffic sources for an Auto Scaling group: Classic Load + // Balancer, Application Load Balancer, Gateway Load Balancer, Network Load + // Balancer, and VPC Lattice. TrafficSources []types.TrafficSourceIdentifier // A comma-separated list of subnet IDs for a virtual private cloud (VPC) where diff --git a/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go b/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go index 91bb81adee3..82f1aaa6a6d 100644 --- a/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go +++ b/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go @@ -11,7 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets information about the Elastic Load Balancing target groups for the +// This API call has been replaced with a new "traffic sources" API call +// (DescribeTrafficSources) that can describe multiple traffic sources types. While +// we continue to support DescribeLoadBalancerTargetGroups, and you can use both +// the original DescribeLoadBalancerTargetGroups API call and the new +// DescribeTrafficSources API call on the same Auto Scaling group, we recommend +// using the new "traffic sources" API call to simplify how you manage traffic +// sources. Gets information about the Elastic Load Balancing target groups for the // specified Auto Scaling group. To determine the attachment status of the target // group, use the State element in the response. When you attach a target group to // an Auto Scaling group, the initial State value is Adding. The state transitions diff --git a/service/autoscaling/api_op_DescribeLoadBalancers.go b/service/autoscaling/api_op_DescribeLoadBalancers.go index b82dc7771ba..4496b0b3955 100644 --- a/service/autoscaling/api_op_DescribeLoadBalancers.go +++ b/service/autoscaling/api_op_DescribeLoadBalancers.go @@ -11,24 +11,30 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets information about the load balancers for the specified Auto Scaling group. -// This operation describes only Classic Load Balancers. If you have Application -// Load Balancers, Network Load Balancers, or Gateway Load Balancer, use the -// DescribeLoadBalancerTargetGroups API instead. To determine the attachment status -// of the load balancer, use the State element in the response. When you attach a -// load balancer to an Auto Scaling group, the initial State value is Adding. The -// state transitions to Added after all Auto Scaling instances are registered with -// the load balancer. If Elastic Load Balancing health checks are enabled for the -// Auto Scaling group, the state transitions to InService after at least one Auto -// Scaling instance passes the health check. When the load balancer is in the -// InService state, Amazon EC2 Auto Scaling can terminate and replace any instances -// that are reported as unhealthy. If no registered instances pass the health -// checks, the load balancer doesn't enter the InService state. Load balancers also -// have an InService state if you attach them in the CreateAutoScalingGroup API -// call. If your load balancer state is InService, but it is not working properly, -// check the scaling activities by calling DescribeScalingActivities and take any -// corrective actions necessary. For help with failed health checks, see -// Troubleshooting Amazon EC2 Auto Scaling: Health checks +// This API call has been replaced with a new "traffic sources" API call +// (DescribeTrafficSources) that can describe multiple traffic sources types. While +// we continue to support DescribeLoadBalancers, and you can use both the original +// DescribeLoadBalancers API call and the new DescribeTrafficSources API call on +// the same Auto Scaling group, we recommend using the new "traffic sources" API +// call to simplify how you manage traffic sources. Gets information about the load +// balancers for the specified Auto Scaling group. This operation describes only +// Classic Load Balancers. If you have Application Load Balancers, Network Load +// Balancers, or Gateway Load Balancers, use the DescribeLoadBalancerTargetGroups +// API instead. To determine the attachment status of the load balancer, use the +// State element in the response. When you attach a load balancer to an Auto +// Scaling group, the initial State value is Adding. The state transitions to Added +// after all Auto Scaling instances are registered with the load balancer. If +// Elastic Load Balancing health checks are enabled for the Auto Scaling group, the +// state transitions to InService after at least one Auto Scaling instance passes +// the health check. When the load balancer is in the InService state, Amazon EC2 +// Auto Scaling can terminate and replace any instances that are reported as +// unhealthy. If no registered instances pass the health checks, the load balancer +// doesn't enter the InService state. Load balancers also have an InService state +// if you attach them in the CreateAutoScalingGroup API call. If your load balancer +// state is InService, but it is not working properly, check the scaling activities +// by calling DescribeScalingActivities and take any corrective actions necessary. +// For help with failed health checks, see Troubleshooting Amazon EC2 Auto Scaling: +// Health checks // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ts-as-healthchecks.html) // in the Amazon EC2 Auto Scaling User Guide. For more information, see Use Elastic // Load Balancing to distribute traffic across the instances in your Auto Scaling diff --git a/service/autoscaling/api_op_DescribeTrafficSources.go b/service/autoscaling/api_op_DescribeTrafficSources.go index 909eb5ddde7..cf64b756854 100644 --- a/service/autoscaling/api_op_DescribeTrafficSources.go +++ b/service/autoscaling/api_op_DescribeTrafficSources.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -11,10 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Reserved for use with Amazon VPC Lattice, which is in preview and subject to -// change. Do not use this API for production workloads. This API is also subject -// to change. Gets information about the traffic sources for the specified Auto -// Scaling group. +// Gets information about the traffic sources for the specified Auto Scaling group. +// You can optionally provide a traffic source type. If you provide a traffic +// source type, then the results only include that traffic source type. If you do +// not provide a traffic source type, then the results include all the traffic +// sources for the specified Auto Scaling group. func (c *Client) DescribeTrafficSources(ctx context.Context, params *DescribeTrafficSourcesInput, optFns ...func(*Options)) (*DescribeTrafficSourcesOutput, error) { if params == nil { params = &DescribeTrafficSourcesInput{} @@ -37,12 +39,6 @@ type DescribeTrafficSourcesInput struct { // This member is required. AutoScalingGroupName *string - // The type of traffic source you are describing. Currently, the only valid value - // is vpc-lattice. - // - // This member is required. - TrafficSourceType *string - // The maximum number of items to return with this call. The maximum value is 50. MaxRecords *int32 @@ -50,6 +46,18 @@ type DescribeTrafficSourcesInput struct { // previous call.) NextToken *string + // The traffic source type that you want to describe. The following lists the valid + // values: + // + // * elb if the traffic source is a Classic Load Balancer. + // + // * elbv2 if the + // traffic source is a Application Load Balancer, Gateway Load Balancer, or Network + // Load Balancer. + // + // * vpc-lattice if the traffic source is VPC Lattice. + TrafficSourceType *string + noSmithyDocumentSerde } @@ -133,6 +141,97 @@ func (c *Client) addOperationDescribeTrafficSourcesMiddlewares(stack *middleware return nil } +// DescribeTrafficSourcesAPIClient is a client that implements the +// DescribeTrafficSources operation. +type DescribeTrafficSourcesAPIClient interface { + DescribeTrafficSources(context.Context, *DescribeTrafficSourcesInput, ...func(*Options)) (*DescribeTrafficSourcesOutput, error) +} + +var _ DescribeTrafficSourcesAPIClient = (*Client)(nil) + +// DescribeTrafficSourcesPaginatorOptions is the paginator options for +// DescribeTrafficSources +type DescribeTrafficSourcesPaginatorOptions struct { + // The maximum number of items to return with this call. The maximum value is 50. + 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 +} + +// DescribeTrafficSourcesPaginator is a paginator for DescribeTrafficSources +type DescribeTrafficSourcesPaginator struct { + options DescribeTrafficSourcesPaginatorOptions + client DescribeTrafficSourcesAPIClient + params *DescribeTrafficSourcesInput + nextToken *string + firstPage bool +} + +// NewDescribeTrafficSourcesPaginator returns a new DescribeTrafficSourcesPaginator +func NewDescribeTrafficSourcesPaginator(client DescribeTrafficSourcesAPIClient, params *DescribeTrafficSourcesInput, optFns ...func(*DescribeTrafficSourcesPaginatorOptions)) *DescribeTrafficSourcesPaginator { + if params == nil { + params = &DescribeTrafficSourcesInput{} + } + + options := DescribeTrafficSourcesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeTrafficSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrafficSourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeTrafficSources page. +func (p *DescribeTrafficSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficSourcesOutput, 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.MaxRecords = limit + + result, err := p.client.DescribeTrafficSources(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_opDescribeTrafficSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DetachLoadBalancerTargetGroups.go b/service/autoscaling/api_op_DetachLoadBalancerTargetGroups.go index 3688a9dd461..a95d95aebb9 100644 --- a/service/autoscaling/api_op_DetachLoadBalancerTargetGroups.go +++ b/service/autoscaling/api_op_DetachLoadBalancerTargetGroups.go @@ -10,6 +10,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API call has been replaced with a new "traffic sources" API call +// (DetachTrafficSources) that can detach multiple traffic sources types. While we +// continue to support DetachLoadBalancerTargetGroups, and you can use both the +// original DetachLoadBalancerTargetGroups API call and the new +// DetachTrafficSources API call on the same Auto Scaling group, we recommend using +// the new "traffic sources" API call to simplify how you manage traffic sources. // Detaches one or more target groups from the specified Auto Scaling group. When // you detach a target group, it enters the Removing state while deregistering the // instances in the group. When all instances are deregistered, then you can no diff --git a/service/autoscaling/api_op_DetachLoadBalancers.go b/service/autoscaling/api_op_DetachLoadBalancers.go index f13d72e8e76..ed4f8779ea8 100644 --- a/service/autoscaling/api_op_DetachLoadBalancers.go +++ b/service/autoscaling/api_op_DetachLoadBalancers.go @@ -10,14 +10,19 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Detaches one or more Classic Load Balancers from the specified Auto Scaling -// group. This operation detaches only Classic Load Balancers. If you have -// Application Load Balancers, Network Load Balancers, or Gateway Load Balancer, -// use the DetachLoadBalancerTargetGroups API instead. When you detach a load -// balancer, it enters the Removing state while deregistering the instances in the -// group. When all instances are deregistered, then you can no longer describe the -// load balancer using the DescribeLoadBalancers API call. The instances remain -// running. +// This API call has been replaced with a new "traffic sources" API call +// (DetachTrafficSources) that can detach multiple traffic sources types. While we +// continue to support DetachLoadBalancers, and you can use both the original +// DetachLoadBalancers API call and the new DetachTrafficSources API call on the +// same Auto Scaling group, we recommend using the new "traffic sources" API call +// to simplify how you manage traffic sources. Detaches one or more Classic Load +// Balancers from the specified Auto Scaling group. This operation detaches only +// Classic Load Balancers. If you have Application Load Balancers, Network Load +// Balancers, or Gateway Load Balancers, use the DetachLoadBalancerTargetGroups API +// instead. When you detach a load balancer, it enters the Removing state while +// deregistering the instances in the group. When all instances are deregistered, +// then you can no longer describe the load balancer using the +// DescribeLoadBalancers API call. The instances remain running. func (c *Client) DetachLoadBalancers(ctx context.Context, params *DetachLoadBalancersInput, optFns ...func(*Options)) (*DetachLoadBalancersOutput, error) { if params == nil { params = &DetachLoadBalancersInput{} diff --git a/service/autoscaling/api_op_DetachTrafficSources.go b/service/autoscaling/api_op_DetachTrafficSources.go index 01c6271edc7..d6e94cea9c2 100644 --- a/service/autoscaling/api_op_DetachTrafficSources.go +++ b/service/autoscaling/api_op_DetachTrafficSources.go @@ -11,10 +11,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Reserved for use with Amazon VPC Lattice, which is in preview and subject to -// change. Do not use this API for production workloads. This API is also subject -// to change. Detaches one or more traffic sources from the specified Auto Scaling -// group. +// Detaches one or more traffic sources from the specified Auto Scaling group. When +// you detach a taffic, it enters the Removing state while deregistering the +// instances in the group. When all instances are deregistered, then you can no +// longer describe the traffic source using the DescribeTrafficSources API call. +// The instances continue to run. func (c *Client) DetachTrafficSources(ctx context.Context, params *DetachTrafficSourcesInput, optFns ...func(*Options)) (*DetachTrafficSourcesOutput, error) { if params == nil { params = &DetachTrafficSourcesInput{} @@ -38,12 +39,7 @@ type DetachTrafficSourcesInput struct { AutoScalingGroupName *string // The unique identifiers of one or more traffic sources you are detaching. You can - // specify up to 10 traffic sources. Currently, you must specify an Amazon Resource - // Name (ARN) for an existing VPC Lattice target group. When you detach a target - // group, it enters the Removing state while deregistering the instances in the - // group. When all instances are deregistered, then you can no longer describe the - // target group using the DescribeTrafficSources API call. The instances continue - // to run. + // specify up to 10 traffic sources. // // This member is required. TrafficSources []types.TrafficSourceIdentifier diff --git a/service/autoscaling/api_op_UpdateAutoScalingGroup.go b/service/autoscaling/api_op_UpdateAutoScalingGroup.go index ef6f3e01a42..8add64f0e5c 100644 --- a/service/autoscaling/api_op_UpdateAutoScalingGroup.go +++ b/service/autoscaling/api_op_UpdateAutoScalingGroup.go @@ -135,10 +135,11 @@ type UpdateAutoScalingGroupInput struct { // in the Amazon EC2 Auto Scaling User Guide. HealthCheckGracePeriod *int32 - // Determines whether any additional health checks are performed on the instances - // in this group. Amazon EC2 health checks are always on. The valid values are EC2 - // (default), ELB, and VPC_LATTICE. The VPC_LATTICE health check type is reserved - // for use with VPC Lattice, which is in preview release and is subject to change. + // A comma-separated list of one or more health check types. The valid values are + // EC2, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be + // disabled. For more information, see Health checks for Auto Scaling instances + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) in the + // Amazon EC2 Auto Scaling User Guide. HealthCheckType *string // The name of the launch configuration. If you specify LaunchConfigurationName in diff --git a/service/autoscaling/deserializers.go b/service/autoscaling/deserializers.go index bf4bcee160e..8ea1fab30d6 100644 --- a/service/autoscaling/deserializers.go +++ b/service/autoscaling/deserializers.go @@ -17152,6 +17152,19 @@ func awsAwsquery_deserializeDocumentTrafficSourceIdentifier(v **types.TrafficSou sv.Identifier = ptr.String(xtv) } + case strings.EqualFold("Type", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Type = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -17256,6 +17269,19 @@ func awsAwsquery_deserializeDocumentTrafficSourceState(v **types.TrafficSourceSt originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("Identifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Identifier = ptr.String(xtv) + } + case strings.EqualFold("State", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -17282,6 +17308,19 @@ func awsAwsquery_deserializeDocumentTrafficSourceState(v **types.TrafficSourceSt sv.TrafficSource = ptr.String(xtv) } + case strings.EqualFold("Type", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Type = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() diff --git a/service/autoscaling/serializers.go b/service/autoscaling/serializers.go index 2f288607a88..ee6003f88fa 100644 --- a/service/autoscaling/serializers.go +++ b/service/autoscaling/serializers.go @@ -5889,6 +5889,11 @@ func awsAwsquery_serializeDocumentTrafficSourceIdentifier(v *types.TrafficSource objectKey.String(*v.Identifier) } + if v.Type != nil { + objectKey := object.Key("Type") + objectKey.String(*v.Type) + } + return nil } diff --git a/service/autoscaling/types/enums.go b/service/autoscaling/types/enums.go index 4241fbc10e9..af3895ca2bc 100644 --- a/service/autoscaling/types/enums.go +++ b/service/autoscaling/types/enums.go @@ -519,6 +519,7 @@ const ( ScalingActivityStatusCodeSuccessful ScalingActivityStatusCode = "Successful" ScalingActivityStatusCodeFailed ScalingActivityStatusCode = "Failed" ScalingActivityStatusCodeCancelled ScalingActivityStatusCode = "Cancelled" + ScalingActivityStatusCodeWaitingForConnectionDraining ScalingActivityStatusCode = "WaitingForConnectionDraining" ) // Values returns all known values for ScalingActivityStatusCode. Note that this @@ -538,6 +539,7 @@ func (ScalingActivityStatusCode) Values() []ScalingActivityStatusCode { "Successful", "Failed", "Cancelled", + "WaitingForConnectionDraining", } } diff --git a/service/autoscaling/types/types.go b/service/autoscaling/types/types.go index 75d6ff64289..b3f0ba9f8ed 100644 --- a/service/autoscaling/types/types.go +++ b/service/autoscaling/types/types.go @@ -137,10 +137,7 @@ type AutoScalingGroup struct { // This member is required. DesiredCapacity *int32 - // Determines whether any additional health checks are performed on the instances - // in this group. Amazon EC2 health checks are always on. The valid values are EC2 - // (default), ELB, and VPC_LATTICE. The VPC_LATTICE health check type is reserved - // for use with VPC Lattice, which is in preview release and is subject to change. + // A comma-separated list of one or more health check types. // // This member is required. HealthCheckType *string @@ -227,9 +224,7 @@ type AutoScalingGroup struct { // The termination policies for the group. TerminationPolicies []string - // Reserved for use with Amazon VPC Lattice, which is in preview release and is - // subject to change. Do not use this parameter for production workloads. It is - // also subject to change. The unique identifiers of the traffic sources. + // The traffic sources associated with this Auto Scaling group. TrafficSources []TrafficSourceIdentifier // One or more subnet IDs, if applicable, separated by commas. @@ -257,8 +252,8 @@ type AutoScalingInstanceDetails struct { // This member is required. AvailabilityZone *string - // The last reported health status of this instance. "Healthy" means that the - // instance is healthy and should remain in service. "Unhealthy" means that the + // The last reported health status of this instance. Healthy means that the + // instance is healthy and should remain in service. Unhealthy means that the // instance is unhealthy and Amazon EC2 Auto Scaling should terminate and replace // it. // @@ -671,10 +666,9 @@ type Instance struct { // This member is required. AvailabilityZone *string - // The last reported health status of the instance. "Healthy" means that the - // instance is healthy and should remain in service. "Unhealthy" means that the - // instance is unhealthy and that Amazon EC2 Auto Scaling should terminate and - // replace it. + // The last reported health status of the instance. Healthy means that the instance + // is healthy and should remain in service. Unhealthy means that the instance is + // unhealthy and that Amazon EC2 Auto Scaling should terminate and replace it. // // This member is required. HealthStatus *string @@ -783,7 +777,7 @@ type InstanceRefresh struct { // during a rollback. PercentageComplete *int32 - // Describes the preferences for an instance refresh. + // The preferences for an instance refresh. Preferences *RefreshPreferences // Additional progress details for an Auto Scaling group that has a warm pool. @@ -2789,14 +2783,14 @@ type TargetTrackingMetricDataQuery struct { noSmithyDocumentSerde } -// This structure defines the CloudWatch metric to return, along with the -// statistic, period, and unit. For more information about the CloudWatch -// terminology below, see Amazon CloudWatch concepts +// This structure defines the CloudWatch metric to return, along with the statistic +// and unit. For more information about the CloudWatch terminology below, see +// Amazon CloudWatch concepts // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html) // in the Amazon CloudWatch User Guide. type TargetTrackingMetricStat struct { - // Represents a specific metric. + // The metric to use. // // This member is required. Metric *Metric @@ -2804,8 +2798,8 @@ type TargetTrackingMetricStat struct { // The statistic to return. It can include any CloudWatch statistic or extended // statistic. For a list of valid values, see the table in Statistics // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) - // in the Amazon CloudWatch User Guide. The most commonly used metrics for scaling - // is Average + // in the Amazon CloudWatch User Guide. The most commonly used metric for scaling + // is Average. // // This member is required. Stat *string @@ -2832,43 +2826,109 @@ type TotalLocalStorageGBRequest struct { noSmithyDocumentSerde } -// Describes the identifier of a traffic source. Currently, you must specify an -// Amazon Resource Name (ARN) for an existing VPC Lattice target group. +// Identifying information for a traffic source. type TrafficSourceIdentifier struct { - // The unique identifier of the traffic source. + // Identifies the traffic source. For Application Load Balancers, Gateway Load + // Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon + // Resource Name (ARN) for a target group in this account and Region. For Classic + // Load Balancers, this will be the name of the Classic Load Balancer in this + // account and Region. For example: + // + // * Application Load Balancer ARN: + // arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/1234567890123456 + // + // * + // Classic Load Balancer name: my-classic-load-balancer + // + // * VPC Lattice ARN: + // arn:aws:vpc-lattice:us-west-2:123456789012:targetgroup/tg-1234567890123456 + // + // To + // get the ARN of a target group for a Application Load Balancer, Gateway Load + // Balancer, or Network Load Balancer, or the name of a Classic Load Balancer, use + // the Elastic Load Balancing DescribeTargetGroups + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) + // and DescribeLoadBalancers + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) + // API operations. To get the ARN of a target group for VPC Lattice, use the VPC + // Lattice GetTargetGroup + // (https://docs.aws.amazon.com/vpc-lattice/latest/APIReference/API_GetTargetGroup.html) + // API operation. + // + // This member is required. Identifier *string + // Provides additional context for the value of Identifier. The following lists the + // valid values: + // + // * elb if Identifier is the name of a Classic Load Balancer. + // + // * + // elbv2 if Identifier is the ARN of an Application Load Balancer, Gateway Load + // Balancer, or Network Load Balancer target group. + // + // * vpc-lattice if Identifier is + // the ARN of a VPC Lattice target group. + // + // Required if the identifier is the name + // of a Classic Load Balancer. + Type *string + noSmithyDocumentSerde } // Describes the state of a traffic source. type TrafficSourceState struct { - // The following are the possible states for a VPC Lattice target group: + // The unique identifier of the traffic source. + Identifier *string + + // Describes the current state of a traffic source. The state values are as + // follows: // - // * Adding - // - The Auto Scaling instances are being registered with the target group. + // * Adding - The Auto Scaling instances are being registered with the + // load balancer or target group. // - // * - // Added - All Auto Scaling instances are registered with the target group. + // * Added - All Auto Scaling instances are + // registered with the load balancer or target group. // - // * - // InService - At least one Auto Scaling instance passed the VPC_LATTICE health - // check. + // * InService - For an Elastic + // Load Balancing load balancer or target group, at least one Auto Scaling instance + // passed an ELB health check. For VPC Lattice, at least one Auto Scaling instance + // passed an VPC_LATTICE health check. // - // * Removing - The Auto Scaling instances are being deregistered from the - // target group. If connection draining is enabled, VPC Lattice waits for in-flight - // requests to complete before deregistering the instances. + // * Removing - The Auto Scaling instances are + // being deregistered from the load balancer or target group. If connection + // draining (deregistration delay) is enabled, Elastic Load Balancing or VPC + // Lattice waits for in-flight requests to complete before deregistering the + // instances. // - // * Removed - All Auto - // Scaling instances are deregistered from the target group. + // * Removed - All Auto Scaling instances are deregistered from the + // load balancer or target group. State *string - // The unique identifier of the traffic source. Currently, this is the Amazon - // Resource Name (ARN) for a VPC Lattice target group. + // This is replaced by Identifier. + // + // Deprecated: TrafficSource has been replaced by Identifier TrafficSource *string + // Provides additional context for the value of Identifier. The following lists the + // valid values: + // + // * elb if Identifier is the name of a Classic Load Balancer. + // + // * + // elbv2 if Identifier is the ARN of an Application Load Balancer, Gateway Load + // Balancer, or Network Load Balancer target group. + // + // * vpc-lattice if Identifier is + // the ARN of a VPC Lattice target group. + // + // Required if the identifier is the name + // of a Classic Load Balancer. + Type *string + noSmithyDocumentSerde } diff --git a/service/autoscaling/validators.go b/service/autoscaling/validators.go index 31daa6ef11d..a782cedc5ea 100644 --- a/service/autoscaling/validators.go +++ b/service/autoscaling/validators.go @@ -1896,6 +1896,38 @@ func validateTargetTrackingMetricStat(v *types.TargetTrackingMetricStat) error { } } +func validateTrafficSourceIdentifier(v *types.TrafficSourceIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TrafficSourceIdentifier"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTrafficSources(v []types.TrafficSourceIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TrafficSources"} + for i := range v { + if err := validateTrafficSourceIdentifier(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateVCpuCountRequest(v *types.VCpuCountRequest) error { if v == nil { return nil @@ -1972,6 +2004,10 @@ func validateOpAttachTrafficSourcesInput(v *AttachTrafficSourcesInput) error { } if v.TrafficSources == nil { invalidParams.Add(smithy.NewErrParamRequired("TrafficSources")) + } else if v.TrafficSources != nil { + if err := validateTrafficSources(v.TrafficSources); err != nil { + invalidParams.AddNested("TrafficSources", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -2085,6 +2121,11 @@ func validateOpCreateAutoScalingGroupInput(v *CreateAutoScalingGroupInput) error invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.TrafficSources != nil { + if err := validateTrafficSources(v.TrafficSources); err != nil { + invalidParams.AddNested("TrafficSources", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2332,9 +2373,6 @@ func validateOpDescribeTrafficSourcesInput(v *DescribeTrafficSourcesInput) error if v.AutoScalingGroupName == nil { invalidParams.Add(smithy.NewErrParamRequired("AutoScalingGroupName")) } - if v.TrafficSourceType == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrafficSourceType")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2421,6 +2459,10 @@ func validateOpDetachTrafficSourcesInput(v *DetachTrafficSourcesInput) error { } if v.TrafficSources == nil { invalidParams.Add(smithy.NewErrParamRequired("TrafficSources")) + } else if v.TrafficSources != nil { + if err := validateTrafficSources(v.TrafficSources); err != nil { + invalidParams.AddNested("TrafficSources", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams diff --git a/service/batch/deserializers.go b/service/batch/deserializers.go index 015394e8fa1..dccdb802fe0 100644 --- a/service/batch/deserializers.go +++ b/service/batch/deserializers.go @@ -6061,6 +6061,11 @@ func awsRestjson1_deserializeDocumentEksPodPropertiesDetail(v **types.EksPodProp sv.HostNetwork = ptr.Bool(jtv) } + case "metadata": + if err := awsRestjson1_deserializeDocumentEksMetadata(&sv.Metadata, value); err != nil { + return err + } + case "nodeName": if value != nil { jtv, ok := value.(string) diff --git a/service/batch/types/types.go b/service/batch/types/types.go index a10c1747837..30f92742578 100644 --- a/service/batch/types/types.go +++ b/service/batch/types/types.go @@ -714,7 +714,7 @@ type ContainerDetail struct { // Batch sets. Environment []KeyValuePair - // The amount of ephemeral storage to allocate for the task. This parameter is used + // The amount of ephemeral storage allocated for the task. This parameter is used // to expand the total amount of ephemeral storage available, beyond the default // amount, for tasks hosted on Fargate. EphemeralStorage *EphemeralStorage @@ -1729,7 +1729,17 @@ type EksHostPath struct { noSmithyDocumentSerde } +// Describes and uniquely identifies Kubernetes resources. For example, the compute +// environment that a pod runs in or the jobID for a job running in the pod. For +// more information, see Understanding Kubernetes Objects +// (https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) +// in the Kubernetes documentation. type EksMetadata struct { + + // Key-value pairs used to identify, sort, and organize cube resources. Can contain + // up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), and + // underscores (_). Labels can be added or modified at any time. Each resource can + // have multiple labels, but each key must be unique for a given object. Labels map[string]string noSmithyDocumentSerde @@ -1761,6 +1771,10 @@ type EksPodProperties struct { // Kubernetes documentation. HostNetwork *bool + // Metadata about the Kubernetes pod. For more information, see Understanding + // Kubernetes Objects + // (https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) + // in the Kubernetes documentation. Metadata *EksMetadata // The name of the service account that's used to run the pod. For more @@ -1814,6 +1828,13 @@ type EksPodPropertiesDetail struct { // Kubernetes documentation. HostNetwork *bool + // Describes and uniquely identifies Kubernetes resources. For example, the compute + // environment that a pod runs in or the jobID for a job running in the pod. For + // more information, see Understanding Kubernetes Objects + // (https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) + // in the Kubernetes documentation. + Metadata *EksMetadata + // The name of the node for this job. NodeName *string @@ -1842,6 +1863,8 @@ type EksPodPropertiesOverride struct { // The overrides for the container that's used on the Amazon EKS pod. Containers []EksContainerOverride + // Metadata about the overrides for the container that's used on the Amazon EKS + // pod. Metadata *EksMetadata noSmithyDocumentSerde diff --git a/service/computeoptimizer/deserializers.go b/service/computeoptimizer/deserializers.go index 0657f80e4ea..4f81edfafb6 100644 --- a/service/computeoptimizer/deserializers.go +++ b/service/computeoptimizer/deserializers.go @@ -5258,6 +5258,15 @@ func awsAwsjson10_deserializeDocumentInstanceRecommendation(v **types.InstanceRe sv.InstanceName = ptr.String(jtv) } + case "instanceState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceState to be of type string, got %T instead", value) + } + sv.InstanceState = types.InstanceState(jtv) + } + case "lastRefreshTimestamp": if value != nil { switch jtv := value.(type) { @@ -7884,6 +7893,15 @@ func awsAwsjson10_deserializeDocumentVolumeConfiguration(v **types.VolumeConfigu for key, value := range shape { switch key { + case "rootVolume": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected RootVolume to be of type *bool, got %T instead", value) + } + sv.RootVolume = ptr.Bool(jtv) + } + case "volumeBaselineIOPS": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/computeoptimizer/types/enums.go b/service/computeoptimizer/types/enums.go index d21f9151c2d..b7d1af8a7b4 100644 --- a/service/computeoptimizer/types/enums.go +++ b/service/computeoptimizer/types/enums.go @@ -526,6 +526,7 @@ const ( ExportableInstanceFieldInferredWorkloadTypes ExportableInstanceField = "InferredWorkloadTypes" ExportableInstanceFieldRecommendationOptionsMigrationEffort ExportableInstanceField = "RecommendationOptionsMigrationEffort" ExportableInstanceFieldEffectiveRecommendationPreferencesExternalMetricsSource ExportableInstanceField = "EffectiveRecommendationPreferencesExternalMetricsSource" + ExportableInstanceFieldInstanceState ExportableInstanceField = "InstanceState" ) // Values returns all known values for ExportableInstanceField. Note that this can @@ -586,6 +587,7 @@ func (ExportableInstanceField) Values() []ExportableInstanceField { "InferredWorkloadTypes", "RecommendationOptionsMigrationEffort", "EffectiveRecommendationPreferencesExternalMetricsSource", + "InstanceState", } } @@ -688,6 +690,7 @@ const ( ExportableVolumeFieldRecommendationOptionsSavingsOpportunityPercentage ExportableVolumeField = "RecommendationOptionsSavingsOpportunityPercentage" ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsCurrency ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsCurrency" ExportableVolumeFieldRecommendationOptionsEstimatedMonthlySavingsValue ExportableVolumeField = "RecommendationOptionsEstimatedMonthlySavingsValue" + ExportableVolumeFieldRootVolume ExportableVolumeField = "RootVolume" ) // Values returns all known values for ExportableVolumeField. Note that this can be @@ -723,6 +726,7 @@ func (ExportableVolumeField) Values() []ExportableVolumeField { "RecommendationOptionsSavingsOpportunityPercentage", "RecommendationOptionsEstimatedMonthlySavingsCurrency", "RecommendationOptionsEstimatedMonthlySavingsValue", + "RootVolume", } } @@ -920,6 +924,32 @@ func (InstanceRecommendationFindingReasonCode) Values() []InstanceRecommendation } } +type InstanceState string + +// Enum values for InstanceState +const ( + InstanceStatePending InstanceState = "pending" + InstanceStateRunning InstanceState = "running" + InstanceStateShuttingDown InstanceState = "shutting-down" + InstanceStateTerminated InstanceState = "terminated" + InstanceStateStopping InstanceState = "stopping" + InstanceStateStopped InstanceState = "stopped" +) + +// Values returns all known values for InstanceState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (InstanceState) Values() []InstanceState { + return []InstanceState{ + "pending", + "running", + "shutting-down", + "terminated", + "stopping", + "stopped", + } +} + type JobFilterName string // Enum values for JobFilterName diff --git a/service/computeoptimizer/types/types.go b/service/computeoptimizer/types/types.go index a49420a4fab..d132840096f 100644 --- a/service/computeoptimizer/types/types.go +++ b/service/computeoptimizer/types/types.go @@ -859,34 +859,34 @@ type InstanceRecommendation struct { // // * EBSThroughputOverprovisioned — The instance’s EBS // throughput configuration can be sized down while still meeting the performance - // requirements of your workload. This is identified by analyzing the VolumeReadOps - // and VolumeWriteOps metrics of EBS volumes attached to the current instance - // during the look-back period. - // - // * EBSThroughputUnderprovisioned — The instance’s - // EBS throughput configuration doesn't meet the performance requirements of your - // workload and there is an alternative instance type that provides better EBS - // throughput performance. This is identified by analyzing the VolumeReadOps and - // VolumeWriteOps metrics of EBS volumes attached to the current instance during - // the look-back period. - // - // * EBSIOPSOverprovisioned — The instance’s EBS IOPS - // configuration can be sized down while still meeting the performance requirements - // of your workload. This is identified by analyzing the VolumeReadBytes and - // VolumeWriteBytes metric of EBS volumes attached to the current instance during - // the look-back period. - // - // * EBSIOPSUnderprovisioned — The instance’s EBS IOPS - // configuration doesn't meet the performance requirements of your workload and - // there is an alternative instance type that provides better EBS IOPS performance. - // This is identified by analyzing the VolumeReadBytes and VolumeWriteBytes metric - // of EBS volumes attached to the current instance during the look-back period. + // requirements of your workload. This is identified by analyzing the + // VolumeReadBytes and VolumeWriteBytes metrics of EBS volumes attached to the + // current instance during the look-back period. // - // * - // NetworkBandwidthOverprovisioned — The instance’s network bandwidth configuration - // can be sized down while still meeting the performance requirements of your - // workload. This is identified by analyzing the NetworkIn and NetworkOut metrics - // of the current instance during the look-back period. + // * EBSThroughputUnderprovisioned — + // The instance’s EBS throughput configuration doesn't meet the performance + // requirements of your workload and there is an alternative instance type that + // provides better EBS throughput performance. This is identified by analyzing the + // VolumeReadBytes and VolumeWriteBytes> metrics of EBS volumes attached to the + // current instance during the look-back period. + // + // * EBSIOPSOverprovisioned — The + // instance’s EBS IOPS configuration can be sized down while still meeting the + // performance requirements of your workload. This is identified by analyzing the + // VolumeReadOps and VolumeWriteOps metric of EBS volumes attached to the current + // instance during the look-back period. + // + // * EBSIOPSUnderprovisioned — The + // instance’s EBS IOPS configuration doesn't meet the performance requirements of + // your workload and there is an alternative instance type that provides better EBS + // IOPS performance. This is identified by analyzing the VolumeReadOps and + // VolumeWriteOps metric of EBS volumes attached to the current instance during the + // look-back period. + // + // * NetworkBandwidthOverprovisioned — The instance’s network + // bandwidth configuration can be sized down while still meeting the performance + // requirements of your workload. This is identified by analyzing the NetworkIn and + // NetworkOut metrics of the current instance during the look-back period. // // * // NetworkBandwidthUnderprovisioned — The instance’s network bandwidth @@ -977,6 +977,9 @@ type InstanceRecommendation struct { // The name of the current instance. InstanceName *string + // The state of the instance when the recommendation was generated. + InstanceState InstanceState + // The timestamp of when the instance recommendation was last generated. LastRefreshTimestamp *time.Time @@ -1858,6 +1861,9 @@ type UtilizationMetric struct { // volume. type VolumeConfiguration struct { + // Contains the image used to boot the instance during launch. + RootVolume *bool + // The baseline IOPS of the volume. VolumeBaselineIOPS int32 diff --git a/service/drs/api_op_CreateReplicationConfigurationTemplate.go b/service/drs/api_op_CreateReplicationConfigurationTemplate.go index 5dee7bbdf9e..8d676b7397a 100644 --- a/service/drs/api_op_CreateReplicationConfigurationTemplate.go +++ b/service/drs/api_op_CreateReplicationConfigurationTemplate.go @@ -92,6 +92,10 @@ type CreateReplicationConfigurationTemplateInput struct { // This member is required. UseDedicatedReplicationServer *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // The ARN of the EBS encryption key to be used during replication. EbsEncryptionKeyArn *string @@ -116,6 +120,10 @@ type CreateReplicationConfigurationTemplateOutput struct { // the Replication Configuration Template. AssociateDefaultSecurityGroup *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // Configure bandwidth throttling for the outbound data transfer rate of the Source // Server in Mbps. BandwidthThrottling int64 diff --git a/service/drs/api_op_GetReplicationConfiguration.go b/service/drs/api_op_GetReplicationConfiguration.go index 4b5df0be889..63a6230eab1 100644 --- a/service/drs/api_op_GetReplicationConfiguration.go +++ b/service/drs/api_op_GetReplicationConfiguration.go @@ -43,6 +43,10 @@ type GetReplicationConfigurationOutput struct { // the Replication Configuration. AssociateDefaultSecurityGroup *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // Configure bandwidth throttling for the outbound data transfer rate of the Source // Server in Mbps. BandwidthThrottling int64 diff --git a/service/drs/api_op_RetryDataReplication.go b/service/drs/api_op_RetryDataReplication.go index 8459d926f86..1a7209b1721 100644 --- a/service/drs/api_op_RetryDataReplication.go +++ b/service/drs/api_op_RetryDataReplication.go @@ -11,10 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Causes the data replication initiation sequence to begin immediately upon next -// Handshake for the specified Source Server ID, regardless of when the previous -// initiation started. This command will work only if the Source Server is stalled -// or is in a DISCONNECTED or STOPPED state. +// WARNING: RetryDataReplication is deprecated. Causes the data replication +// initiation sequence to begin immediately upon next Handshake for the specified +// Source Server ID, regardless of when the previous initiation started. This +// command will work only if the Source Server is stalled or is in a DISCONNECTED +// or STOPPED state. +// +// Deprecated: WARNING: RetryDataReplication is deprecated func (c *Client) RetryDataReplication(ctx context.Context, params *RetryDataReplicationInput, optFns ...func(*Options)) (*RetryDataReplicationOutput, error) { if params == nil { params = &RetryDataReplicationInput{} diff --git a/service/drs/api_op_UpdateReplicationConfiguration.go b/service/drs/api_op_UpdateReplicationConfiguration.go index 08a77723ea7..592c7b3d293 100644 --- a/service/drs/api_op_UpdateReplicationConfiguration.go +++ b/service/drs/api_op_UpdateReplicationConfiguration.go @@ -38,6 +38,10 @@ type UpdateReplicationConfigurationInput struct { // the Replication Configuration. AssociateDefaultSecurityGroup *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // Configure bandwidth throttling for the outbound data transfer rate of the Source // Server in Mbps. BandwidthThrottling int64 @@ -91,6 +95,10 @@ type UpdateReplicationConfigurationOutput struct { // the Replication Configuration. AssociateDefaultSecurityGroup *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // Configure bandwidth throttling for the outbound data transfer rate of the Source // Server in Mbps. BandwidthThrottling int64 diff --git a/service/drs/api_op_UpdateReplicationConfigurationTemplate.go b/service/drs/api_op_UpdateReplicationConfigurationTemplate.go index c83517b9f5a..e6665fc141c 100644 --- a/service/drs/api_op_UpdateReplicationConfigurationTemplate.go +++ b/service/drs/api_op_UpdateReplicationConfigurationTemplate.go @@ -41,6 +41,10 @@ type UpdateReplicationConfigurationTemplateInput struct { // the Replication Configuration Template. AssociateDefaultSecurityGroup *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // Configure bandwidth throttling for the outbound data transfer rate of the Source // Server in Mbps. BandwidthThrottling int64 @@ -96,6 +100,10 @@ type UpdateReplicationConfigurationTemplateOutput struct { // the Replication Configuration Template. AssociateDefaultSecurityGroup *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // Configure bandwidth throttling for the outbound data transfer rate of the Source // Server in Mbps. BandwidthThrottling int64 diff --git a/service/drs/deserializers.go b/service/drs/deserializers.go index 83c87a85127..2d3e2c93953 100644 --- a/service/drs/deserializers.go +++ b/service/drs/deserializers.go @@ -351,6 +351,15 @@ func awsRestjson1_deserializeOpDocumentCreateReplicationConfigurationTemplateOut sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } + case "autoReplicateNewDisks": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoReplicateNewDisks = ptr.Bool(jtv) + } + case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) @@ -2762,6 +2771,15 @@ func awsRestjson1_deserializeOpDocumentGetReplicationConfigurationOutput(v **Get sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } + case "autoReplicateNewDisks": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoReplicateNewDisks = ptr.Bool(jtv) + } + case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) @@ -5472,6 +5490,15 @@ func awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationOutput(v ** sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } + case "autoReplicateNewDisks": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoReplicateNewDisks = ptr.Bool(jtv) + } + case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) @@ -5770,6 +5797,15 @@ func awsRestjson1_deserializeOpDocumentUpdateReplicationConfigurationTemplateOut sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } + case "autoReplicateNewDisks": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoReplicateNewDisks = ptr.Bool(jtv) + } + case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) @@ -6432,7 +6468,7 @@ func awsRestjson1_deserializeDocumentConversionMap(v *map[string]string, value i if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ebsSnapshot to be of type string, got %T instead", value) + return fmt.Errorf("expected EbsSnapshot to be of type string, got %T instead", value) } parsedVal = jtv } @@ -7138,7 +7174,7 @@ func awsRestjson1_deserializeDocumentEbsSnapshotsList(v *[]string, value interfa if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ebsSnapshot to be of type string, got %T instead", value) + return fmt.Errorf("expected EbsSnapshot to be of type string, got %T instead", value) } col = jtv } @@ -9254,6 +9290,15 @@ func awsRestjson1_deserializeDocumentReplicationConfigurationTemplate(v **types. sv.AssociateDefaultSecurityGroup = ptr.Bool(jtv) } + case "autoReplicateNewDisks": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoReplicateNewDisks = ptr.Bool(jtv) + } + case "bandwidthThrottling": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/drs/serializers.go b/service/drs/serializers.go index 1c22df49400..02e27803965 100644 --- a/service/drs/serializers.go +++ b/service/drs/serializers.go @@ -154,6 +154,11 @@ func awsRestjson1_serializeOpDocumentCreateReplicationConfigurationTemplateInput ok.Boolean(*v.AssociateDefaultSecurityGroup) } + if v.AutoReplicateNewDisks != nil { + ok := object.Key("autoReplicateNewDisks") + ok.Boolean(*v.AutoReplicateNewDisks) + } + { ok := object.Key("bandwidthThrottling") ok.Long(v.BandwidthThrottling) @@ -2532,6 +2537,11 @@ func awsRestjson1_serializeOpDocumentUpdateReplicationConfigurationInput(v *Upda ok.Boolean(*v.AssociateDefaultSecurityGroup) } + if v.AutoReplicateNewDisks != nil { + ok := object.Key("autoReplicateNewDisks") + ok.Boolean(*v.AutoReplicateNewDisks) + } + if v.BandwidthThrottling != 0 { ok := object.Key("bandwidthThrottling") ok.Long(v.BandwidthThrottling) @@ -2688,6 +2698,11 @@ func awsRestjson1_serializeOpDocumentUpdateReplicationConfigurationTemplateInput ok.Boolean(*v.AssociateDefaultSecurityGroup) } + if v.AutoReplicateNewDisks != nil { + ok := object.Key("autoReplicateNewDisks") + ok.Boolean(*v.AutoReplicateNewDisks) + } + if v.BandwidthThrottling != 0 { ok := object.Key("bandwidthThrottling") ok.Long(v.BandwidthThrottling) diff --git a/service/drs/types/types.go b/service/drs/types/types.go index 4bce7f445ba..4ec17d81f0b 100644 --- a/service/drs/types/types.go +++ b/service/drs/types/types.go @@ -706,6 +706,10 @@ type ReplicationConfigurationTemplate struct { // the Replication Configuration Template. AssociateDefaultSecurityGroup *bool + // Whether to allow the AWS replication agent to automatically replicate newly + // added disks. + AutoReplicateNewDisks *bool + // Configure bandwidth throttling for the outbound data transfer rate of the Source // Server in Mbps. BandwidthThrottling int64 diff --git a/service/ec2/api_op_GetVpnTunnelReplacementStatus.go b/service/ec2/api_op_GetVpnTunnelReplacementStatus.go new file mode 100644 index 00000000000..1b0e0d9e06f --- /dev/null +++ b/service/ec2/api_op_GetVpnTunnelReplacementStatus.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get details of available tunnel endpoint maintenance. +func (c *Client) GetVpnTunnelReplacementStatus(ctx context.Context, params *GetVpnTunnelReplacementStatusInput, optFns ...func(*Options)) (*GetVpnTunnelReplacementStatusOutput, error) { + if params == nil { + params = &GetVpnTunnelReplacementStatusInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVpnTunnelReplacementStatus", params, optFns, c.addOperationGetVpnTunnelReplacementStatusMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVpnTunnelReplacementStatusOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVpnTunnelReplacementStatusInput struct { + + // The ID of the Site-to-Site VPN connection. + // + // This member is required. + VpnConnectionId *string + + // The external IP address of the VPN tunnel. + // + // This member is required. + VpnTunnelOutsideIpAddress *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation. Otherwise, it is + // UnauthorizedOperation. + DryRun *bool + + noSmithyDocumentSerde +} + +type GetVpnTunnelReplacementStatusOutput struct { + + // The ID of the customer gateway. + CustomerGatewayId *string + + // Get details of pending tunnel endpoint maintenance. + MaintenanceDetails *types.MaintenanceDetails + + // The ID of the transit gateway associated with the VPN connection. + TransitGatewayId *string + + // The ID of the Site-to-Site VPN connection. + VpnConnectionId *string + + // The ID of the virtual private gateway. + VpnGatewayId *string + + // The external IP address of the VPN tunnel. + VpnTunnelOutsideIpAddress *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVpnTunnelReplacementStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpGetVpnTunnelReplacementStatus{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetVpnTunnelReplacementStatus{}, middleware.After) + if err != nil { + return err + } + if err = 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 = addOpGetVpnTunnelReplacementStatusValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVpnTunnelReplacementStatus(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_opGetVpnTunnelReplacementStatus(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "GetVpnTunnelReplacementStatus", + } +} diff --git a/service/ec2/api_op_ModifyVpnTunnelOptions.go b/service/ec2/api_op_ModifyVpnTunnelOptions.go index d536e5adf4c..e96dcb986da 100644 --- a/service/ec2/api_op_ModifyVpnTunnelOptions.go +++ b/service/ec2/api_op_ModifyVpnTunnelOptions.go @@ -55,6 +55,10 @@ type ModifyVpnTunnelOptionsInput struct { // UnauthorizedOperation. DryRun *bool + // Choose whether or not to trigger immediate tunnel replacement. Valid values: + // True | False + SkipTunnelReplacement *bool + noSmithyDocumentSerde } diff --git a/service/ec2/api_op_ReplaceVpnTunnel.go b/service/ec2/api_op_ReplaceVpnTunnel.go new file mode 100644 index 00000000000..f026f1b73fd --- /dev/null +++ b/service/ec2/api_op_ReplaceVpnTunnel.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +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" +) + +// Trigger replacement of specified VPN tunnel. +func (c *Client) ReplaceVpnTunnel(ctx context.Context, params *ReplaceVpnTunnelInput, optFns ...func(*Options)) (*ReplaceVpnTunnelOutput, error) { + if params == nil { + params = &ReplaceVpnTunnelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ReplaceVpnTunnel", params, optFns, c.addOperationReplaceVpnTunnelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ReplaceVpnTunnelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ReplaceVpnTunnelInput struct { + + // The ID of the Site-to-Site VPN connection. + // + // This member is required. + VpnConnectionId *string + + // The external IP address of the VPN tunnel. + // + // This member is required. + VpnTunnelOutsideIpAddress *string + + // Trigger pending tunnel endpoint maintenance. + ApplyPendingMaintenance *bool + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation. Otherwise, it is + // UnauthorizedOperation. + DryRun *bool + + noSmithyDocumentSerde +} + +type ReplaceVpnTunnelOutput struct { + + // Confirmation of replace tunnel operation. + Return *bool + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationReplaceVpnTunnelMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpReplaceVpnTunnel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpReplaceVpnTunnel{}, middleware.After) + if err != nil { + return err + } + if err = 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 = addOpReplaceVpnTunnelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplaceVpnTunnel(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_opReplaceVpnTunnel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "ReplaceVpnTunnel", + } +} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index f41d8f39657..acfe4432370 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -40237,6 +40237,97 @@ func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(response *smithyh } } +type awsEc2query_deserializeOpGetVpnTunnelReplacementStatus struct { +} + +func (*awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(response, &metadata) + } + output := &GetVpnTunnelReplacementStatusOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentGetVpnTunnelReplacementStatusOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList struct { } @@ -49038,6 +49129,97 @@ func awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(response *smithyht } } +type awsEc2query_deserializeOpReplaceVpnTunnel struct { +} + +func (*awsEc2query_deserializeOpReplaceVpnTunnel) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpReplaceVpnTunnel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorReplaceVpnTunnel(response, &metadata) + } + output := &ReplaceVpnTunnelOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentReplaceVpnTunnelOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorReplaceVpnTunnel(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpReportInstanceStatus struct { } @@ -93757,6 +93939,89 @@ func awsEc2query_deserializeDocumentLocalStorageTypeSetUnwrapped(v *[]types.Loca *v = sv return nil } +func awsEc2query_deserializeDocumentMaintenanceDetails(v **types.MaintenanceDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MaintenanceDetails + if *v == nil { + sv = &types.MaintenanceDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("lastMaintenanceApplied", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LastMaintenanceApplied = ptr.Time(t) + } + + case strings.EqualFold("maintenanceAutoAppliedAfter", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.MaintenanceAutoAppliedAfter = ptr.Time(t) + } + + case strings.EqualFold("pendingMaintenance", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PendingMaintenance = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentManagedPrefixList(v **types.ManagedPrefixList, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -123838,6 +124103,22 @@ func awsEc2query_deserializeDocumentTunnelOption(v **types.TunnelOption, decoder sv.DpdTimeoutSeconds = ptr.Int32(int32(i64)) } + case strings.EqualFold("enableTunnelLifecycleControl", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.EnableTunnelLifecycleControl = ptr.Bool(xtv) + } + case strings.EqualFold("ikeVersionSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentIKEVersionsList(&sv.IkeVersions, nodeDecoder); err != nil { @@ -154315,6 +154596,113 @@ func awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceTypesOutput(v **GetV return nil } +func awsEc2query_deserializeOpDocumentGetVpnTunnelReplacementStatusOutput(v **GetVpnTunnelReplacementStatusOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetVpnTunnelReplacementStatusOutput + if *v == nil { + sv = &GetVpnTunnelReplacementStatusOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("customerGatewayId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomerGatewayId = ptr.String(xtv) + } + + case strings.EqualFold("maintenanceDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentMaintenanceDetails(&sv.MaintenanceDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("transitGatewayId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TransitGatewayId = ptr.String(xtv) + } + + case strings.EqualFold("vpnConnectionId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpnConnectionId = ptr.String(xtv) + } + + case strings.EqualFold("vpnGatewayId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpnGatewayId = ptr.String(xtv) + } + + case strings.EqualFold("vpnTunnelOutsideIpAddress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpnTunnelOutsideIpAddress = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentImportClientVpnClientCertificateRevocationListOutput(v **ImportClientVpnClientCertificateRevocationListOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -158706,6 +159094,58 @@ func awsEc2query_deserializeOpDocumentReplaceTransitGatewayRouteOutput(v **Repla return nil } +func awsEc2query_deserializeOpDocumentReplaceVpnTunnelOutput(v **ReplaceVpnTunnelOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ReplaceVpnTunnelOutput + if *v == nil { + sv = &ReplaceVpnTunnelOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("return", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Return = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentRequestSpotFleetOutput(v **RequestSpotFleetOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/generated.json b/service/ec2/generated.json index abfdc747028..e314a57bef5 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -462,6 +462,7 @@ "api_op_GetVerifiedAccessGroupPolicy.go", "api_op_GetVpnConnectionDeviceSampleConfiguration.go", "api_op_GetVpnConnectionDeviceTypes.go", + "api_op_GetVpnTunnelReplacementStatus.go", "api_op_ImportClientVpnClientCertificateRevocationList.go", "api_op_ImportImage.go", "api_op_ImportInstance.go", @@ -562,6 +563,7 @@ "api_op_ReplaceRoute.go", "api_op_ReplaceRouteTableAssociation.go", "api_op_ReplaceTransitGatewayRoute.go", + "api_op_ReplaceVpnTunnel.go", "api_op_ReportInstanceStatus.go", "api_op_RequestSpotFleet.go", "api_op_RequestSpotInstances.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index d4137439c84..e77bb1b2ac9 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -28881,6 +28881,70 @@ func (m *awsEc2query_serializeOpGetVpnConnectionDeviceTypes) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpGetVpnTunnelReplacementStatus struct { +} + +func (*awsEc2query_serializeOpGetVpnTunnelReplacementStatus) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpGetVpnTunnelReplacementStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVpnTunnelReplacementStatusInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetVpnTunnelReplacementStatus") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentGetVpnTunnelReplacementStatusInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpImportClientVpnClientCertificateRevocationList struct { } @@ -35281,6 +35345,70 @@ func (m *awsEc2query_serializeOpReplaceTransitGatewayRoute) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpReplaceVpnTunnel struct { +} + +func (*awsEc2query_serializeOpReplaceVpnTunnel) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpReplaceVpnTunnel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ReplaceVpnTunnelInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ReplaceVpnTunnel") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentReplaceVpnTunnelInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpReportInstanceStatus struct { } @@ -42333,6 +42461,11 @@ func awsEc2query_serializeDocumentModifyVpnTunnelOptionsSpecification(v *types.M objectKey.Integer(*v.DPDTimeoutSeconds) } + if v.EnableTunnelLifecycleControl != nil { + objectKey := object.Key("EnableTunnelLifecycleControl") + objectKey.Boolean(*v.EnableTunnelLifecycleControl) + } + if v.IKEVersions != nil { objectKey := object.FlatKey("IKEVersion") if err := awsEc2query_serializeDocumentIKEVersionsRequestList(v.IKEVersions, objectKey); err != nil { @@ -46367,6 +46500,11 @@ func awsEc2query_serializeDocumentVpnTunnelOptionsSpecification(v *types.VpnTunn objectKey.Integer(*v.DPDTimeoutSeconds) } + if v.EnableTunnelLifecycleControl != nil { + objectKey := object.Key("EnableTunnelLifecycleControl") + objectKey.Boolean(*v.EnableTunnelLifecycleControl) + } + if v.IKEVersions != nil { objectKey := object.FlatKey("IKEVersion") if err := awsEc2query_serializeDocumentIKEVersionsRequestList(v.IKEVersions, objectKey); err != nil { @@ -60384,6 +60522,28 @@ func awsEc2query_serializeOpDocumentGetVpnConnectionDeviceTypesInput(v *GetVpnCo return nil } +func awsEc2query_serializeOpDocumentGetVpnTunnelReplacementStatusInput(v *GetVpnTunnelReplacementStatusInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.VpnConnectionId != nil { + objectKey := object.Key("VpnConnectionId") + objectKey.String(*v.VpnConnectionId) + } + + if v.VpnTunnelOutsideIpAddress != nil { + objectKey := object.Key("VpnTunnelOutsideIpAddress") + objectKey.String(*v.VpnTunnelOutsideIpAddress) + } + + return nil +} + func awsEc2query_serializeOpDocumentImportClientVpnClientCertificateRevocationListInput(v *ImportClientVpnClientCertificateRevocationListInput, value query.Value) error { object := value.Object() _ = object @@ -63186,6 +63346,11 @@ func awsEc2query_serializeOpDocumentModifyVpnTunnelOptionsInput(v *ModifyVpnTunn objectKey.Boolean(*v.DryRun) } + if v.SkipTunnelReplacement != nil { + objectKey := object.Key("SkipTunnelReplacement") + objectKey.Boolean(*v.SkipTunnelReplacement) + } + if v.TunnelOptions != nil { objectKey := object.Key("TunnelOptions") if err := awsEc2query_serializeDocumentModifyVpnTunnelOptionsSpecification(v.TunnelOptions, objectKey); err != nil { @@ -64092,6 +64257,33 @@ func awsEc2query_serializeOpDocumentReplaceTransitGatewayRouteInput(v *ReplaceTr return nil } +func awsEc2query_serializeOpDocumentReplaceVpnTunnelInput(v *ReplaceVpnTunnelInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ApplyPendingMaintenance != nil { + objectKey := object.Key("ApplyPendingMaintenance") + objectKey.Boolean(*v.ApplyPendingMaintenance) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.VpnConnectionId != nil { + objectKey := object.Key("VpnConnectionId") + objectKey.String(*v.VpnConnectionId) + } + + if v.VpnTunnelOutsideIpAddress != nil { + objectKey := object.Key("VpnTunnelOutsideIpAddress") + objectKey.String(*v.VpnTunnelOutsideIpAddress) + } + + return nil +} + func awsEc2query_serializeOpDocumentReportInstanceStatusInput(v *ReportInstanceStatusInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 4c7d9aef803..6f45290f28b 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -9629,6 +9629,22 @@ type LocalGatewayVirtualInterfaceGroup struct { noSmithyDocumentSerde } +// Details for Site-to-Site VPN tunnel endpoint maintenance events. +type MaintenanceDetails struct { + + // Timestamp of last applied maintenance. + LastMaintenanceApplied *time.Time + + // The timestamp after which Amazon Web Services will automatically apply + // maintenance. + MaintenanceAutoAppliedAfter *time.Time + + // Verify existence of a pending maintenance. + PendingMaintenance *string + + noSmithyDocumentSerde +} + // Describes a managed prefix list. type ManagedPrefixList struct { @@ -9864,6 +9880,9 @@ type ModifyVpnTunnelOptionsSpecification struct { // greater than or equal to 30. Default: 30 DPDTimeoutSeconds *int32 + // Turn on or off tunnel endpoint lifecycle control feature. + EnableTunnelLifecycleControl *bool + // The IKE versions that are permitted for the VPN tunnel. Valid values: ikev1 | // ikev2 IKEVersions []IKEVersionsRequestListValue @@ -16485,6 +16504,9 @@ type TunnelOption struct { // The number of seconds after which a DPD timeout occurs. DpdTimeoutSeconds *int32 + // Status of tunnel endpoint lifecycle control feature. + EnableTunnelLifecycleControl *bool + // The IKE versions that are permitted for the VPN tunnel. IkeVersions []IKEVersionsListValue @@ -17963,6 +17985,9 @@ type VpnTunnelOptionsSpecification struct { // greater than or equal to 30. Default: 30 DPDTimeoutSeconds *int32 + // Turn on or off tunnel endpoint lifecycle control feature. + EnableTunnelLifecycleControl *bool + // The IKE versions that are permitted for the VPN tunnel. Valid values: ikev1 | // ikev2 IKEVersions []IKEVersionsRequestListValue diff --git a/service/ec2/validators.go b/service/ec2/validators.go index 279b6bc82f2..288ab802bfa 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -5770,6 +5770,26 @@ func (m *validateOpGetVpnConnectionDeviceSampleConfiguration) HandleInitialize(c return next.HandleInitialize(ctx, in) } +type validateOpGetVpnTunnelReplacementStatus struct { +} + +func (*validateOpGetVpnTunnelReplacementStatus) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVpnTunnelReplacementStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVpnTunnelReplacementStatusInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVpnTunnelReplacementStatusInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpImportClientVpnClientCertificateRevocationList struct { } @@ -7610,6 +7630,26 @@ func (m *validateOpReplaceTransitGatewayRoute) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpReplaceVpnTunnel struct { +} + +func (*validateOpReplaceVpnTunnel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpReplaceVpnTunnel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ReplaceVpnTunnelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpReplaceVpnTunnelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpReportInstanceStatus struct { } @@ -9442,6 +9482,10 @@ func addOpGetVpnConnectionDeviceSampleConfigurationValidationMiddleware(stack *m return stack.Initialize.Add(&validateOpGetVpnConnectionDeviceSampleConfiguration{}, middleware.After) } +func addOpGetVpnTunnelReplacementStatusValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVpnTunnelReplacementStatus{}, middleware.After) +} + func addOpImportClientVpnClientCertificateRevocationListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportClientVpnClientCertificateRevocationList{}, middleware.After) } @@ -9810,6 +9854,10 @@ func addOpReplaceTransitGatewayRouteValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpReplaceTransitGatewayRoute{}, middleware.After) } +func addOpReplaceVpnTunnelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpReplaceVpnTunnel{}, middleware.After) +} + func addOpReportInstanceStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpReportInstanceStatus{}, middleware.After) } @@ -15643,6 +15691,24 @@ func validateOpGetVpnConnectionDeviceSampleConfigurationInput(v *GetVpnConnectio } } +func validateOpGetVpnTunnelReplacementStatusInput(v *GetVpnTunnelReplacementStatusInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVpnTunnelReplacementStatusInput"} + if v.VpnConnectionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) + } + if v.VpnTunnelOutsideIpAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpnTunnelOutsideIpAddress")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpImportClientVpnClientCertificateRevocationListInput(v *ImportClientVpnClientCertificateRevocationListInput) error { if v == nil { return nil @@ -17215,6 +17281,24 @@ func validateOpReplaceTransitGatewayRouteInput(v *ReplaceTransitGatewayRouteInpu } } +func validateOpReplaceVpnTunnelInput(v *ReplaceVpnTunnelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReplaceVpnTunnelInput"} + if v.VpnConnectionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpnConnectionId")) + } + if v.VpnTunnelOutsideIpAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpnTunnelOutsideIpAddress")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpReportInstanceStatusInput(v *ReportInstanceStatusInput) error { if v == nil { return nil diff --git a/service/emr/deserializers.go b/service/emr/deserializers.go index a191e0855e2..0c70ab8eceb 100644 --- a/service/emr/deserializers.go +++ b/service/emr/deserializers.go @@ -6964,6 +6964,11 @@ func awsAwsjson11_deserializeDocumentClusterStatus(v **types.ClusterStatus, valu for key, value := range shape { switch key { + case "ErrorDetails": + if err := awsAwsjson11_deserializeDocumentErrorDetailList(&sv.ErrorDetails, value); err != nil { + return err + } + case "State": if value != nil { jtv, ok := value.(string) @@ -7806,6 +7811,126 @@ func awsAwsjson11_deserializeDocumentEC2InstanceIdsList(v *[]string, value inter return nil } +func awsAwsjson11_deserializeDocumentErrorData(v *[]map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []map[string]string + if *v == nil { + cv = []map[string]string{} + } else { + cv = *v + } + + for _, value := range shape { + var col map[string]string + if err := awsAwsjson11_deserializeDocumentStringMap(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentErrorDetail(v **types.ErrorDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ErrorDetail + if *v == nil { + sv = &types.ErrorDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "ErrorData": + if err := awsAwsjson11_deserializeDocumentErrorData(&sv.ErrorData, value); err != nil { + return err + } + + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentErrorDetailList(v *[]types.ErrorDetail, 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.ErrorDetail + if *v == nil { + cv = []types.ErrorDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ErrorDetail + destAddr := &col + if err := awsAwsjson11_deserializeDocumentErrorDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentExecutionEngineConfig(v **types.ExecutionEngineConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/emr/types/types.go b/service/emr/types/types.go index 5f7c2a50cd7..3b94c399d4f 100644 --- a/service/emr/types/types.go +++ b/service/emr/types/types.go @@ -438,6 +438,10 @@ type ClusterStateChangeReason struct { // The detailed status of the cluster. type ClusterStatus struct { + // A list of tuples that provide information about the errors that caused a cluster + // termination. This structure may have up to 10 different ErrorDetail tuples. + ErrorDetails []ErrorDetail + // The current state of the cluster. State ClusterState @@ -714,6 +718,23 @@ type Ec2InstanceAttributes struct { noSmithyDocumentSerde } +// A tuple that provides information about an error that caused a cluster to +// terminate. +type ErrorDetail struct { + + // The name or code that's associated with the error. + ErrorCode *string + + // A list of key value pairs that provide contextual information to explain why the + // error may have occured. + ErrorData []map[string]string + + // A message describing the error that occured. + ErrorMessage *string + + noSmithyDocumentSerde +} + // Specifies the execution engine (cluster) to run the notebook and perform the // notebook execution, for example, an EMR cluster. type ExecutionEngineConfig struct { diff --git a/service/glue/api_op_UpdateDataQualityRuleset.go b/service/glue/api_op_UpdateDataQualityRuleset.go index 4a0a752be10..6e4db220327 100644 --- a/service/glue/api_op_UpdateDataQualityRuleset.go +++ b/service/glue/api_op_UpdateDataQualityRuleset.go @@ -40,9 +40,6 @@ type UpdateDataQualityRulesetInput struct { // Glue developer guide. Ruleset *string - // The new name of the ruleset, if you are renaming it. - UpdatedName *string - noSmithyDocumentSerde } diff --git a/service/glue/serializers.go b/service/glue/serializers.go index c358d0c3aee..901ea486a57 100644 --- a/service/glue/serializers.go +++ b/service/glue/serializers.go @@ -23595,11 +23595,6 @@ func awsAwsjson11_serializeOpDocumentUpdateDataQualityRulesetInput(v *UpdateData ok.String(*v.Ruleset) } - if v.UpdatedName != nil { - ok := object.Key("UpdatedName") - ok.String(*v.UpdatedName) - } - return nil } diff --git a/service/guardduty/api_op_DescribeOrganizationConfiguration.go b/service/guardduty/api_op_DescribeOrganizationConfiguration.go index 668cf5713d0..ae1daa619b9 100644 --- a/service/guardduty/api_op_DescribeOrganizationConfiguration.go +++ b/service/guardduty/api_op_DescribeOrganizationConfiguration.go @@ -62,7 +62,8 @@ type DescribeOrganizationConfigurationOutput struct { MemberAccountLimitReached bool // Indicates whether GuardDuty is automatically enabled for accounts added to the - // organization. + // organization. Even though this is still supported, we recommend using + // AutoEnableOrganizationMembers to achieve the similar results. // // Deprecated: This field is deprecated, use AutoEnableOrganizationMembers instead AutoEnable bool @@ -70,16 +71,18 @@ type DescribeOrganizationConfigurationOutput struct { // Indicates the auto-enablement configuration of GuardDuty for the member accounts // in the organization. // - // * NEW: Indicates that new accounts joining the - // organization are configured to have GuardDuty enabled automatically. + // * NEW: Indicates that when a new account joins the + // organization, they will have GuardDuty enabled automatically. // - // * ALL: - // Indicates that all accounts (new and existing members) in the organization are - // configured to have GuardDuty enabled automatically. + // * ALL: Indicates + // that all accounts in the Amazon Web Services Organization have GuardDuty enabled + // automatically. This includes NEW accounts that join the organization and + // accounts that may have been suspended or removed from the organization in + // GuardDuty. // - // * NONE: Indicates that no - // account in the organization will be configured to have GuardDuty enabled - // automatically. + // * NONE: Indicates that GuardDuty will not be automatically enabled + // for any accounts in the organization. GuardDuty must be managed for each account + // individually by the administrator. AutoEnableOrganizationMembers types.AutoEnableMembers // Describes which data sources are enabled automatically for member accounts. diff --git a/service/guardduty/api_op_GetCoverageStatistics.go b/service/guardduty/api_op_GetCoverageStatistics.go new file mode 100644 index 00000000000..ac23c71081e --- /dev/null +++ b/service/guardduty/api_op_GetCoverageStatistics.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package guardduty + +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/guardduty/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves aggregated statistics for your account. If you are a GuardDuty +// administrator, you can retrieve the statistics for all the resources associated +// with the active member accounts in your organization who have enabled EKS +// Runtime Monitoring and have the GuardDuty agent running on their EKS nodes. +func (c *Client) GetCoverageStatistics(ctx context.Context, params *GetCoverageStatisticsInput, optFns ...func(*Options)) (*GetCoverageStatisticsOutput, error) { + if params == nil { + params = &GetCoverageStatisticsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCoverageStatistics", params, optFns, c.addOperationGetCoverageStatisticsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCoverageStatisticsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCoverageStatisticsInput struct { + + // The unique ID of the GuardDuty detector associated to the coverage statistics. + // + // This member is required. + DetectorId *string + + // Represents the statistics type used to aggregate the coverage details. + // + // This member is required. + StatisticsType []types.CoverageStatisticsType + + // Represents the criteria used to filter the coverage statistics + FilterCriteria *types.CoverageFilterCriteria + + noSmithyDocumentSerde +} + +type GetCoverageStatisticsOutput struct { + + // Represents the count aggregated by the statusCode and resourceType. + CoverageStatistics *types.CoverageStatistics + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCoverageStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCoverageStatistics{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCoverageStatistics{}, 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 = addOpGetCoverageStatisticsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCoverageStatistics(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_opGetCoverageStatistics(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "guardduty", + OperationName: "GetCoverageStatistics", + } +} diff --git a/service/guardduty/api_op_ListCoverage.go b/service/guardduty/api_op_ListCoverage.go new file mode 100644 index 00000000000..3a99f7d8649 --- /dev/null +++ b/service/guardduty/api_op_ListCoverage.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package guardduty + +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/guardduty/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists coverage details for your GuardDuty account. If you're a GuardDuty +// administrator, you can retrieve all resources associated with the active member +// accounts in your organization. Make sure the accounts have EKS Runtime +// Monitoring enabled and GuardDuty agent running on their EKS nodes. +func (c *Client) ListCoverage(ctx context.Context, params *ListCoverageInput, optFns ...func(*Options)) (*ListCoverageOutput, error) { + if params == nil { + params = &ListCoverageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCoverage", params, optFns, c.addOperationListCoverageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCoverageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCoverageInput struct { + + // The unique ID of the detector whose coverage details you want to retrieve. + // + // This member is required. + DetectorId *string + + // Represents the criteria used to filter the coverage details. + FilterCriteria *types.CoverageFilterCriteria + + // The maximum number of results to return in the response. + MaxResults int32 + + // A token to use for paginating results that are returned in the response. Set the + // value of this parameter to null for the first request to a list action. For + // subsequent calls, use the NextToken value returned from the previous request to + // continue listing results after the first page. + NextToken *string + + // Represents the criteria used to sort the coverage details. + SortCriteria *types.CoverageSortCriteria + + noSmithyDocumentSerde +} + +type ListCoverageOutput struct { + + // A list of resources and their attributes providing cluster details. + // + // This member is required. + Resources []types.CoverageResource + + // The pagination parameter to be used on the next list operation to retrieve more + // items. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCoverageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCoverage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCoverage{}, 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 = addOpListCoverageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCoverage(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 +} + +// ListCoverageAPIClient is a client that implements the ListCoverage operation. +type ListCoverageAPIClient interface { + ListCoverage(context.Context, *ListCoverageInput, ...func(*Options)) (*ListCoverageOutput, error) +} + +var _ ListCoverageAPIClient = (*Client)(nil) + +// ListCoveragePaginatorOptions is the paginator options for ListCoverage +type ListCoveragePaginatorOptions struct { + // The maximum number of results to return in the response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListCoveragePaginator is a paginator for ListCoverage +type ListCoveragePaginator struct { + options ListCoveragePaginatorOptions + client ListCoverageAPIClient + params *ListCoverageInput + nextToken *string + firstPage bool +} + +// NewListCoveragePaginator returns a new ListCoveragePaginator +func NewListCoveragePaginator(client ListCoverageAPIClient, params *ListCoverageInput, optFns ...func(*ListCoveragePaginatorOptions)) *ListCoveragePaginator { + if params == nil { + params = &ListCoverageInput{} + } + + options := ListCoveragePaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCoveragePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCoveragePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCoverage page. +func (p *ListCoveragePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCoverageOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListCoverage(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_opListCoverage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "guardduty", + OperationName: "ListCoverage", + } +} diff --git a/service/guardduty/api_op_UpdateOrganizationConfiguration.go b/service/guardduty/api_op_UpdateOrganizationConfiguration.go index 7380a556738..f1495ef8996 100644 --- a/service/guardduty/api_op_UpdateOrganizationConfiguration.go +++ b/service/guardduty/api_op_UpdateOrganizationConfiguration.go @@ -40,6 +40,8 @@ type UpdateOrganizationConfigurationInput struct { DetectorId *string // Indicates whether to automatically enable member accounts in the organization. + // Even though this is still supported, we recommend using + // AutoEnableOrganizationMembers to achieve the similar results. // // Deprecated: This field is deprecated, use AutoEnableOrganizationMembers instead AutoEnable bool @@ -47,16 +49,18 @@ type UpdateOrganizationConfigurationInput struct { // Indicates the auto-enablement configuration of GuardDuty for the member accounts // in the organization. // - // * NEW: Indicates that new accounts joining the - // organization are configured to have GuardDuty enabled automatically. + // * NEW: Indicates that when a new account joins the + // organization, they will have GuardDuty enabled automatically. // - // * ALL: - // Indicates that all accounts (new and existing members) in the organization are - // configured to have GuardDuty enabled automatically. + // * ALL: Indicates + // that all accounts in the Amazon Web Services Organization have GuardDuty enabled + // automatically. This includes NEW accounts that join the organization and + // accounts that may have been suspended or removed from the organization in + // GuardDuty. // - // * NONE: Indicates that no - // account in the organization will be configured to have GuardDuty enabled - // automatically. + // * NONE: Indicates that GuardDuty will not be automatically enabled + // for any accounts in the organization. GuardDuty must be managed for each account + // individually by the administrator. AutoEnableOrganizationMembers types.AutoEnableMembers // Describes which data sources will be updated. diff --git a/service/guardduty/deserializers.go b/service/guardduty/deserializers.go index 493f7250111..bdc3fa637a7 100644 --- a/service/guardduty/deserializers.go +++ b/service/guardduty/deserializers.go @@ -3353,6 +3353,156 @@ func awsRestjson1_deserializeOpDocumentGetAdministratorAccountOutput(v **GetAdmi return nil } +type awsRestjson1_deserializeOpGetCoverageStatistics struct { +} + +func (*awsRestjson1_deserializeOpGetCoverageStatistics) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetCoverageStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetCoverageStatistics(response, &metadata) + } + output := &GetCoverageStatisticsOutput{} + 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_deserializeOpDocumentGetCoverageStatisticsOutput(&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_deserializeOpErrorGetCoverageStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetCoverageStatisticsOutput(v **GetCoverageStatisticsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetCoverageStatisticsOutput + if *v == nil { + sv = &GetCoverageStatisticsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "coverageStatistics": + if err := awsRestjson1_deserializeDocumentCoverageStatistics(&sv.CoverageStatistics, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpGetDetector struct { } @@ -5666,14 +5816,14 @@ func awsRestjson1_deserializeOpDocumentInviteMembersOutput(v **InviteMembersOutp return nil } -type awsRestjson1_deserializeOpListDetectors struct { +type awsRestjson1_deserializeOpListCoverage struct { } -func (*awsRestjson1_deserializeOpListDetectors) ID() string { +func (*awsRestjson1_deserializeOpListCoverage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDetectors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCoverage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5687,9 +5837,9 @@ func (m *awsRestjson1_deserializeOpListDetectors) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDetectors(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCoverage(response, &metadata) } - output := &ListDetectorsOutput{} + output := &ListCoverageOutput{} out.Result = output var buff [1024]byte @@ -5710,7 +5860,7 @@ func (m *awsRestjson1_deserializeOpListDetectors) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDetectorsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCoverageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5723,7 +5873,7 @@ func (m *awsRestjson1_deserializeOpListDetectors) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDetectors(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCoverage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5780,7 +5930,7 @@ func awsRestjson1_deserializeOpErrorListDetectors(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListDetectorsOutput(v **ListDetectorsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCoverageOutput(v **ListCoverageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5793,20 +5943,15 @@ func awsRestjson1_deserializeOpDocumentListDetectorsOutput(v **ListDetectorsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDetectorsOutput + var sv *ListCoverageOutput if *v == nil { - sv = &ListDetectorsOutput{} + sv = &ListCoverageOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "detectorIds": - if err := awsRestjson1_deserializeDocumentDetectorIds(&sv.DetectorIds, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -5816,6 +5961,11 @@ func awsRestjson1_deserializeOpDocumentListDetectorsOutput(v **ListDetectorsOutp sv.NextToken = ptr.String(jtv) } + case "resources": + if err := awsRestjson1_deserializeDocumentCoverageResources(&sv.Resources, value); err != nil { + return err + } + default: _, _ = key, value @@ -5825,14 +5975,14 @@ func awsRestjson1_deserializeOpDocumentListDetectorsOutput(v **ListDetectorsOutp return nil } -type awsRestjson1_deserializeOpListFilters struct { +type awsRestjson1_deserializeOpListDetectors struct { } -func (*awsRestjson1_deserializeOpListFilters) ID() string { +func (*awsRestjson1_deserializeOpListDetectors) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDetectors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5846,9 +5996,9 @@ func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFilters(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDetectors(response, &metadata) } - output := &ListFiltersOutput{} + output := &ListDetectorsOutput{} out.Result = output var buff [1024]byte @@ -5869,7 +6019,7 @@ func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFiltersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDetectorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5882,7 +6032,7 @@ func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDetectors(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5939,7 +6089,7 @@ func awsRestjson1_deserializeOpErrorListFilters(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDetectorsOutput(v **ListDetectorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5952,17 +6102,17 @@ func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFiltersOutput + var sv *ListDetectorsOutput if *v == nil { - sv = &ListFiltersOutput{} + sv = &ListDetectorsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "filterNames": - if err := awsRestjson1_deserializeDocumentFilterNames(&sv.FilterNames, value); err != nil { + case "detectorIds": + if err := awsRestjson1_deserializeDocumentDetectorIds(&sv.DetectorIds, value); err != nil { return err } @@ -5984,14 +6134,14 @@ func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, return nil } -type awsRestjson1_deserializeOpListFindings struct { +type awsRestjson1_deserializeOpListFilters struct { } -func (*awsRestjson1_deserializeOpListFindings) ID() string { +func (*awsRestjson1_deserializeOpListFilters) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6005,9 +6155,9 @@ func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFindings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListFilters(response, &metadata) } - output := &ListFindingsOutput{} + output := &ListFiltersOutput{} out.Result = output var buff [1024]byte @@ -6028,7 +6178,7 @@ func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFindingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListFiltersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6041,7 +6191,7 @@ func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6098,7 +6248,7 @@ func awsRestjson1_deserializeOpErrorListFindings(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFiltersOutput(v **ListFiltersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6111,17 +6261,17 @@ func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFindingsOutput + var sv *ListFiltersOutput if *v == nil { - sv = &ListFindingsOutput{} + sv = &ListFiltersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "findingIds": - if err := awsRestjson1_deserializeDocumentFindingIds(&sv.FindingIds, value); err != nil { + case "filterNames": + if err := awsRestjson1_deserializeDocumentFilterNames(&sv.FilterNames, value); err != nil { return err } @@ -6143,14 +6293,14 @@ func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput return nil } -type awsRestjson1_deserializeOpListInvitations struct { +type awsRestjson1_deserializeOpListFindings struct { } -func (*awsRestjson1_deserializeOpListInvitations) ID() string { +func (*awsRestjson1_deserializeOpListFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6164,9 +6314,9 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListInvitations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListFindings(response, &metadata) } - output := &ListInvitationsOutput{} + output := &ListFindingsOutput{} out.Result = output var buff [1024]byte @@ -6187,7 +6337,7 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListInvitationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6200,7 +6350,7 @@ func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6257,7 +6407,7 @@ func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFindingsOutput(v **ListFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6270,17 +6420,17 @@ func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitations return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInvitationsOutput + var sv *ListFindingsOutput if *v == nil { - sv = &ListInvitationsOutput{} + sv = &ListFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "invitations": - if err := awsRestjson1_deserializeDocumentInvitations(&sv.Invitations, value); err != nil { + case "findingIds": + if err := awsRestjson1_deserializeDocumentFindingIds(&sv.FindingIds, value); err != nil { return err } @@ -6302,14 +6452,14 @@ func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitations return nil } -type awsRestjson1_deserializeOpListIPSets struct { +type awsRestjson1_deserializeOpListInvitations struct { } -func (*awsRestjson1_deserializeOpListIPSets) ID() string { +func (*awsRestjson1_deserializeOpListInvitations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListIPSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6323,9 +6473,9 @@ func (m *awsRestjson1_deserializeOpListIPSets) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListIPSets(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListInvitations(response, &metadata) } - output := &ListIPSetsOutput{} + output := &ListInvitationsOutput{} out.Result = output var buff [1024]byte @@ -6346,7 +6496,7 @@ func (m *awsRestjson1_deserializeOpListIPSets) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListIPSetsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListInvitationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6359,7 +6509,7 @@ func (m *awsRestjson1_deserializeOpListIPSets) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListIPSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6416,7 +6566,7 @@ func awsRestjson1_deserializeOpErrorListIPSets(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListIPSetsOutput(v **ListIPSetsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6429,17 +6579,17 @@ func awsRestjson1_deserializeOpDocumentListIPSetsOutput(v **ListIPSetsOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListIPSetsOutput + var sv *ListInvitationsOutput if *v == nil { - sv = &ListIPSetsOutput{} + sv = &ListInvitationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ipSetIds": - if err := awsRestjson1_deserializeDocumentIpSetIds(&sv.IpSetIds, value); err != nil { + case "invitations": + if err := awsRestjson1_deserializeDocumentInvitations(&sv.Invitations, value); err != nil { return err } @@ -6461,10 +6611,169 @@ func awsRestjson1_deserializeOpDocumentListIPSetsOutput(v **ListIPSetsOutput, va return nil } -type awsRestjson1_deserializeOpListMembers struct { +type awsRestjson1_deserializeOpListIPSets struct { } -func (*awsRestjson1_deserializeOpListMembers) ID() string { +func (*awsRestjson1_deserializeOpListIPSets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListIPSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListIPSets(response, &metadata) + } + output := &ListIPSetsOutput{} + 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_deserializeOpDocumentListIPSetsOutput(&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_deserializeOpErrorListIPSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListIPSetsOutput(v **ListIPSetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListIPSetsOutput + if *v == nil { + sv = &ListIPSetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ipSetIds": + if err := awsRestjson1_deserializeDocumentIpSetIds(&sv.IpSetIds, 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_deserializeOpListMembers struct { +} + +func (*awsRestjson1_deserializeOpListMembers) ID() string { return "OperationDeserializer" } @@ -9089,6 +9398,55 @@ func awsRestjson1_deserializeDocumentAction(v **types.Action, value interface{}) return nil } +func awsRestjson1_deserializeDocumentAddonDetails(v **types.AddonDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AddonDetails + if *v == nil { + sv = &types.AddonDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "addonStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AddonStatus = ptr.String(jtv) + } + + case "addonVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AddonVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAdminAccount(v **types.AdminAccount, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9937,7 +10295,7 @@ func awsRestjson1_deserializeDocumentContainers(v *[]types.Container, value inte return nil } -func awsRestjson1_deserializeDocumentCountBySeverity(v *map[string]int32, value interface{}) error { +func awsRestjson1_deserializeDocumentCountByCoverageStatus(v *map[string]int64, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9950,25 +10308,25 @@ func awsRestjson1_deserializeDocumentCountBySeverity(v *map[string]int32, value return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]int32 + var mv map[string]int64 if *v == nil { - mv = map[string]int32{} + mv = map[string]int64{} } else { mv = *v } for key, value := range shape { - var parsedVal int32 + var parsedVal int64 if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - parsedVal = int32(i64) + parsedVal = i64 } mv[key] = parsedVal @@ -9977,7 +10335,7 @@ func awsRestjson1_deserializeDocumentCountBySeverity(v *map[string]int32, value return nil } -func awsRestjson1_deserializeDocumentCountry(v **types.Country, value interface{}) error { +func awsRestjson1_deserializeDocumentCountByResourceType(v *map[string]int64, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9990,43 +10348,34 @@ func awsRestjson1_deserializeDocumentCountry(v **types.Country, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Country + var mv map[string]int64 if *v == nil { - sv = &types.Country{} + mv = map[string]int64{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "countryCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.CountryCode = ptr.String(jtv) + var parsedVal int64 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } - - case "countryName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.CountryName = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err } - - default: - _, _ = key, value - + parsedVal = i64 } + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsRestjson1_deserializeDocumentCriterion(v *map[string]types.Condition, value interface{}) error { +func awsRestjson1_deserializeDocumentCountBySeverity(v *map[string]int32, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10039,22 +10388,399 @@ func awsRestjson1_deserializeDocumentCriterion(v *map[string]types.Condition, va return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.Condition + var mv map[string]int32 if *v == nil { - mv = map[string]types.Condition{} + mv = map[string]int32{} } else { mv = *v } for key, value := range shape { - var parsedVal types.Condition - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentCondition(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal + var parsedVal int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + parsedVal = int32(i64) + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentCountry(v **types.Country, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Country + if *v == nil { + sv = &types.Country{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "countryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CountryCode = ptr.String(jtv) + } + + case "countryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CountryName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCoverageEksClusterDetails(v **types.CoverageEksClusterDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CoverageEksClusterDetails + if *v == nil { + sv = &types.CoverageEksClusterDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "addonDetails": + if err := awsRestjson1_deserializeDocumentAddonDetails(&sv.AddonDetails, value); err != nil { + return err + } + + case "clusterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ClusterName = ptr.String(jtv) + } + + case "compatibleNodes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CompatibleNodes = i64 + } + + case "coveredNodes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CoveredNodes = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCoverageResource(v **types.CoverageResource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CoverageResource + if *v == nil { + sv = &types.CoverageResource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "coverageStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoverageStatus to be of type string, got %T instead", value) + } + sv.CoverageStatus = types.CoverageStatus(jtv) + } + + case "detectorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DetectorId to be of type string, got %T instead", value) + } + sv.DetectorId = ptr.String(jtv) + } + + case "issue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Issue = ptr.String(jtv) + } + + case "resourceDetails": + if err := awsRestjson1_deserializeDocumentCoverageResourceDetails(&sv.ResourceDetails, value); err != nil { + return err + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCoverageResourceDetails(v **types.CoverageResourceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CoverageResourceDetails + if *v == nil { + sv = &types.CoverageResourceDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "eksClusterDetails": + if err := awsRestjson1_deserializeDocumentCoverageEksClusterDetails(&sv.EksClusterDetails, value); err != nil { + return err + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = types.ResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCoverageResources(v *[]types.CoverageResource, 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.CoverageResource + if *v == nil { + cv = []types.CoverageResource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CoverageResource + destAddr := &col + if err := awsRestjson1_deserializeDocumentCoverageResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCoverageStatistics(v **types.CoverageStatistics, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CoverageStatistics + if *v == nil { + sv = &types.CoverageStatistics{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "countByCoverageStatus": + if err := awsRestjson1_deserializeDocumentCountByCoverageStatus(&sv.CountByCoverageStatus, value); err != nil { + return err + } + + case "countByResourceType": + if err := awsRestjson1_deserializeDocumentCountByResourceType(&sv.CountByResourceType, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCriterion(v *map[string]types.Condition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.Condition + if *v == nil { + mv = map[string]types.Condition{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.Condition + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentCondition(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal } *v = mv @@ -10276,7 +11002,114 @@ func awsRestjson1_deserializeDocumentDefaultServerSideEncryption(v **types.Defau return nil } -func awsRestjson1_deserializeDocumentDestination(v **types.Destination, value interface{}) error { +func awsRestjson1_deserializeDocumentDestination(v **types.Destination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Destination + if *v == nil { + sv = &types.Destination{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destinationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DestinationId = ptr.String(jtv) + } + + case "destinationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationType to be of type string, got %T instead", value) + } + sv.DestinationType = types.DestinationType(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PublishingStatus to be of type string, got %T instead", value) + } + sv.Status = types.PublishingStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDestinationProperties(v **types.DestinationProperties, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DestinationProperties + if *v == nil { + sv = &types.DestinationProperties{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destinationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DestinationArn = ptr.String(jtv) + } + + case "kmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDestinations(v *[]types.Destination, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10284,57 +11117,33 @@ func awsRestjson1_deserializeDocumentDestination(v **types.Destination, value in return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Destination + var cv []types.Destination if *v == nil { - sv = &types.Destination{} + cv = []types.Destination{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "destinationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.DestinationId = ptr.String(jtv) - } - - case "destinationType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationType to be of type string, got %T instead", value) - } - sv.DestinationType = types.DestinationType(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PublishingStatus to be of type string, got %T instead", value) - } - sv.Status = types.PublishingStatus(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.Destination + destAddr := &col + if err := awsRestjson1_deserializeDocumentDestination(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentDestinationProperties(v **types.DestinationProperties, value interface{}) error { +func awsRestjson1_deserializeDocumentDetectorAdditionalConfigurationResult(v **types.DetectorAdditionalConfigurationResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10347,31 +11156,47 @@ func awsRestjson1_deserializeDocumentDestinationProperties(v **types.Destination return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DestinationProperties + var sv *types.DetectorAdditionalConfigurationResult if *v == nil { - sv = &types.DestinationProperties{} + sv = &types.DetectorAdditionalConfigurationResult{} } else { sv = *v } for key, value := range shape { switch key { - case "destinationArn": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected FeatureAdditionalConfiguration to be of type string, got %T instead", value) } - sv.DestinationArn = ptr.String(jtv) + sv.Name = types.FeatureAdditionalConfiguration(jtv) } - case "kmsKeyArn": + case "status": 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 FeatureStatus to be of type string, got %T instead", value) + } + sv.Status = types.FeatureStatus(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.KmsKeyArn = ptr.String(jtv) } default: @@ -10383,7 +11208,7 @@ func awsRestjson1_deserializeDocumentDestinationProperties(v **types.Destination return nil } -func awsRestjson1_deserializeDocumentDestinations(v *[]types.Destination, value interface{}) error { +func awsRestjson1_deserializeDocumentDetectorAdditionalConfigurationResults(v *[]types.DetectorAdditionalConfigurationResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10396,17 +11221,17 @@ func awsRestjson1_deserializeDocumentDestinations(v *[]types.Destination, value return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Destination + var cv []types.DetectorAdditionalConfigurationResult if *v == nil { - cv = []types.Destination{} + cv = []types.DetectorAdditionalConfigurationResult{} } else { cv = *v } for _, value := range shape { - var col types.Destination + var col types.DetectorAdditionalConfigurationResult destAddr := &col - if err := awsRestjson1_deserializeDocumentDestination(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentDetectorAdditionalConfigurationResult(&destAddr, value); err != nil { return err } col = *destAddr @@ -10439,6 +11264,11 @@ func awsRestjson1_deserializeDocumentDetectorFeatureConfigurationResult(v **type for key, value := range shape { switch key { + case "additionalConfiguration": + if err := awsRestjson1_deserializeDocumentDetectorAdditionalConfigurationResults(&sv.AdditionalConfiguration, value); err != nil { + return err + } + case "name": if value != nil { jtv, ok := value.(string) @@ -11717,6 +12547,42 @@ func awsRestjson1_deserializeDocumentFindingStatistics(v **types.FindingStatisti return nil } +func awsRestjson1_deserializeDocumentFlagsList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentFlowLogsConfigurationResult(v **types.FlowLogsConfigurationResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12713,8 +13579,148 @@ func awsRestjson1_deserializeDocumentKubernetesDetails(v **types.KubernetesDetai return err } - case "kubernetesWorkloadDetails": - if err := awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(&sv.KubernetesWorkloadDetails, value); err != nil { + case "kubernetesWorkloadDetails": + if err := awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(&sv.KubernetesWorkloadDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKubernetesUserDetails(v **types.KubernetesUserDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.KubernetesUserDetails + if *v == nil { + sv = &types.KubernetesUserDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "groups": + if err := awsRestjson1_deserializeDocumentGroups(&sv.Groups, value); err != nil { + return err + } + + case "uid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Uid = ptr.String(jtv) + } + + case "username": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Username = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(v **types.KubernetesWorkloadDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.KubernetesWorkloadDetails + if *v == nil { + sv = &types.KubernetesWorkloadDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "containers": + if err := awsRestjson1_deserializeDocumentContainers(&sv.Containers, value); err != nil { + return err + } + + case "hostNetwork": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.HostNetwork = jtv + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "uid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Uid = ptr.String(jtv) + } + + case "volumes": + if err := awsRestjson1_deserializeDocumentVolumes(&sv.Volumes, value); err != nil { return err } @@ -12727,7 +13733,7 @@ func awsRestjson1_deserializeDocumentKubernetesDetails(v **types.KubernetesDetai return nil } -func awsRestjson1_deserializeDocumentKubernetesUserDetails(v **types.KubernetesUserDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentLineage(v *[]types.LineageObject, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12735,53 +13741,33 @@ func awsRestjson1_deserializeDocumentKubernetesUserDetails(v **types.KubernetesU return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KubernetesUserDetails + var cv []types.LineageObject if *v == nil { - sv = &types.KubernetesUserDetails{} + cv = []types.LineageObject{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "groups": - if err := awsRestjson1_deserializeDocumentGroups(&sv.Groups, value); err != nil { - return err - } - - case "uid": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Uid = ptr.String(jtv) - } - - case "username": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Username = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.LineageObject + destAddr := &col + if err := awsRestjson1_deserializeDocumentLineageObject(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(v **types.KubernetesWorkloadDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentLineageObject(v **types.LineageObject, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12794,27 +13780,35 @@ func awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(v **types.Kuberne return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KubernetesWorkloadDetails + var sv *types.LineageObject if *v == nil { - sv = &types.KubernetesWorkloadDetails{} + sv = &types.LineageObject{} } else { sv = *v } for key, value := range shape { switch key { - case "containers": - if err := awsRestjson1_deserializeDocumentContainers(&sv.Containers, value); err != nil { - return err + case "euid": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Euid = int32(i64) } - case "hostNetwork": + case "executablePath": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.HostNetwork = jtv + sv.ExecutablePath = ptr.String(jtv) } case "name": @@ -12826,36 +13820,77 @@ func awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(v **types.Kuberne sv.Name = ptr.String(jtv) } - case "namespace": + case "namespacePid": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.Namespace = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NamespacePid = int32(i64) } - case "type": + case "parentUuid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.ParentUuid = ptr.String(jtv) } - case "uid": + case "pid": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.Uid = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Pid = int32(i64) } - case "volumes": - if err := awsRestjson1_deserializeDocumentVolumes(&sv.Volumes, value); err != nil { - return err + case "startTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "userId": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UserId = int32(i64) + } + + case "uuid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Uuid = ptr.String(jtv) } default: @@ -13354,6 +14389,105 @@ func awsRestjson1_deserializeDocumentMember(v **types.Member, value interface{}) return nil } +func awsRestjson1_deserializeDocumentMemberAdditionalConfigurationResult(v **types.MemberAdditionalConfigurationResult, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MemberAdditionalConfigurationResult + if *v == nil { + sv = &types.MemberAdditionalConfigurationResult{} + } 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 OrgFeatureAdditionalConfiguration to be of type string, got %T instead", value) + } + sv.Name = types.OrgFeatureAdditionalConfiguration(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value) + } + sv.Status = types.FeatureStatus(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMemberAdditionalConfigurationResults(v *[]types.MemberAdditionalConfigurationResult, 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.MemberAdditionalConfigurationResult + if *v == nil { + cv = []types.MemberAdditionalConfigurationResult{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MemberAdditionalConfigurationResult + destAddr := &col + if err := awsRestjson1_deserializeDocumentMemberAdditionalConfigurationResult(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentMemberDataSourceConfiguration(v **types.MemberDataSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13460,6 +14594,11 @@ func awsRestjson1_deserializeDocumentMemberFeaturesConfigurationResult(v **types for key, value := range shape { switch key { + case "additionalConfiguration": + if err := awsRestjson1_deserializeDocumentMemberAdditionalConfigurationResults(&sv.AdditionalConfiguration, value); err != nil { + return err + } + case "name": if value != nil { jtv, ok := value.(string) @@ -13552,18 +14691,54 @@ func awsRestjson1_deserializeDocumentMembers(v *[]types.Member, value interface{ var cv []types.Member if *v == nil { - cv = []types.Member{} + cv = []types.Member{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Member + destAddr := &col + if err := awsRestjson1_deserializeDocumentMember(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMemoryRegionsList(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 types.Member - destAddr := &col - if err := awsRestjson1_deserializeDocumentMember(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -13931,6 +15106,89 @@ func awsRestjson1_deserializeDocumentOrganization(v **types.Organization, value return nil } +func awsRestjson1_deserializeDocumentOrganizationAdditionalConfigurationResult(v **types.OrganizationAdditionalConfigurationResult, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.OrganizationAdditionalConfigurationResult + if *v == nil { + sv = &types.OrganizationAdditionalConfigurationResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "autoEnable": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OrgFeatureStatus to be of type string, got %T instead", value) + } + sv.AutoEnable = types.OrgFeatureStatus(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OrgFeatureAdditionalConfiguration to be of type string, got %T instead", value) + } + sv.Name = types.OrgFeatureAdditionalConfiguration(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOrganizationAdditionalConfigurationResults(v *[]types.OrganizationAdditionalConfigurationResult, 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.OrganizationAdditionalConfigurationResult + if *v == nil { + cv = []types.OrganizationAdditionalConfigurationResult{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OrganizationAdditionalConfigurationResult + destAddr := &col + if err := awsRestjson1_deserializeDocumentOrganizationAdditionalConfigurationResult(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentOrganizationDataSourceConfigurationsResult(v **types.OrganizationDataSourceConfigurationsResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14039,6 +15297,11 @@ func awsRestjson1_deserializeDocumentOrganizationFeatureConfigurationResult(v ** for key, value := range shape { switch key { + case "additionalConfiguration": + if err := awsRestjson1_deserializeDocumentOrganizationAdditionalConfigurationResults(&sv.AdditionalConfiguration, value); err != nil { + return err + } + case "autoEnable": if value != nil { jtv, ok := value.(string) @@ -14514,24 +15777,225 @@ func awsRestjson1_deserializeDocumentPrivateIpAddressDetails(v **types.PrivateIp sv = *v } - for key, value := range shape { - switch key { - case "privateDnsName": + for key, value := range shape { + switch key { + case "privateDnsName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PrivateDnsName = ptr.String(jtv) + } + + case "privateIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PrivateIpAddress = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPrivateIpAddresses(v *[]types.PrivateIpAddressDetails, 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.PrivateIpAddressDetails + if *v == nil { + cv = []types.PrivateIpAddressDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PrivateIpAddressDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentPrivateIpAddressDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProcessDetails(v **types.ProcessDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ProcessDetails + if *v == nil { + sv = &types.ProcessDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "euid": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Euid = int32(i64) + } + + case "executablePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ExecutablePath = ptr.String(jtv) + } + + case "executableSha256": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ExecutableSha256 = ptr.String(jtv) + } + + case "lineage": + if err := awsRestjson1_deserializeDocumentLineage(&sv.Lineage, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "namespacePid": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NamespacePid = int32(i64) + } + + case "parentUuid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParentUuid = ptr.String(jtv) + } + + case "pid": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Pid = int32(i64) + } + + case "pwd": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Pwd = ptr.String(jtv) + } + + case "startTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "user": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.PrivateDnsName = ptr.String(jtv) + sv.User = ptr.String(jtv) } - case "privateIpAddress": + case "userId": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UserId = int32(i64) + } + + case "uuid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.PrivateIpAddress = ptr.String(jtv) + sv.Uuid = ptr.String(jtv) } default: @@ -14543,40 +16007,6 @@ func awsRestjson1_deserializeDocumentPrivateIpAddressDetails(v **types.PrivateIp return nil } -func awsRestjson1_deserializeDocumentPrivateIpAddresses(v *[]types.PrivateIpAddressDetails, 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.PrivateIpAddressDetails - if *v == nil { - cv = []types.PrivateIpAddressDetails{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PrivateIpAddressDetails - destAddr := &col - if err := awsRestjson1_deserializeDocumentPrivateIpAddressDetails(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - func awsRestjson1_deserializeDocumentProductCode(v **types.ProductCode, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15195,6 +16625,253 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return nil } +func awsRestjson1_deserializeDocumentRuntimeContext(v **types.RuntimeContext, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RuntimeContext + if *v == nil { + sv = &types.RuntimeContext{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "addressFamily": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AddressFamily = ptr.String(jtv) + } + + case "fileSystemType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FileSystemType = ptr.String(jtv) + } + + case "flags": + if err := awsRestjson1_deserializeDocumentFlagsList(&sv.Flags, value); err != nil { + return err + } + + case "ianaProtocolNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.IanaProtocolNumber = int32(i64) + } + + case "ldPreloadValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LdPreloadValue = ptr.String(jtv) + } + + case "libraryPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LibraryPath = ptr.String(jtv) + } + + case "memoryRegions": + if err := awsRestjson1_deserializeDocumentMemoryRegionsList(&sv.MemoryRegions, value); err != nil { + return err + } + + case "modifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "modifyingProcess": + if err := awsRestjson1_deserializeDocumentProcessDetails(&sv.ModifyingProcess, value); err != nil { + return err + } + + case "moduleFilePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ModuleFilePath = ptr.String(jtv) + } + + case "moduleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ModuleName = ptr.String(jtv) + } + + case "moduleSha256": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ModuleSha256 = ptr.String(jtv) + } + + case "mountSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MountSource = ptr.String(jtv) + } + + case "mountTarget": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MountTarget = ptr.String(jtv) + } + + case "releaseAgentPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReleaseAgentPath = ptr.String(jtv) + } + + case "runcBinaryPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RuncBinaryPath = ptr.String(jtv) + } + + case "scriptPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ScriptPath = ptr.String(jtv) + } + + case "shellHistoryFilePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ShellHistoryFilePath = ptr.String(jtv) + } + + case "socketPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SocketPath = ptr.String(jtv) + } + + case "targetProcess": + if err := awsRestjson1_deserializeDocumentProcessDetails(&sv.TargetProcess, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuntimeDetails(v **types.RuntimeDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RuntimeDetails + if *v == nil { + sv = &types.RuntimeDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "context": + if err := awsRestjson1_deserializeDocumentRuntimeContext(&sv.Context, value); err != nil { + return err + } + + case "process": + if err := awsRestjson1_deserializeDocumentProcessDetails(&sv.Process, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentS3BucketDetail(v **types.S3BucketDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16318,6 +17995,11 @@ func awsRestjson1_deserializeDocumentService(v **types.Service, value interface{ sv.ResourceRole = ptr.String(jtv) } + case "runtimeDetails": + if err := awsRestjson1_deserializeDocumentRuntimeDetails(&sv.RuntimeDetails, value); err != nil { + return err + } + case "serviceName": if value != nil { jtv, ok := value.(string) diff --git a/service/guardduty/generated.json b/service/guardduty/generated.json index d2b00c78066..e506f05d4f6 100644 --- a/service/guardduty/generated.json +++ b/service/guardduty/generated.json @@ -35,6 +35,7 @@ "api_op_DisassociateMembers.go", "api_op_EnableOrganizationAdminAccount.go", "api_op_GetAdministratorAccount.go", + "api_op_GetCoverageStatistics.go", "api_op_GetDetector.go", "api_op_GetFilter.go", "api_op_GetFindings.go", @@ -49,6 +50,7 @@ "api_op_GetThreatIntelSet.go", "api_op_GetUsageStatistics.go", "api_op_InviteMembers.go", + "api_op_ListCoverage.go", "api_op_ListDetectors.go", "api_op_ListFilters.go", "api_op_ListFindings.go", diff --git a/service/guardduty/serializers.go b/service/guardduty/serializers.go index 2ee8a85e4f6..14120c5b58b 100644 --- a/service/guardduty/serializers.go +++ b/service/guardduty/serializers.go @@ -2133,6 +2133,96 @@ func awsRestjson1_serializeOpHttpBindingsGetAdministratorAccountInput(v *GetAdmi return nil } +type awsRestjson1_serializeOpGetCoverageStatistics struct { +} + +func (*awsRestjson1_serializeOpGetCoverageStatistics) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCoverageStatistics) 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.(*GetCoverageStatisticsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/detector/{DetectorId}/coverage/statistics") + 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_serializeOpHttpBindingsGetCoverageStatisticsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetCoverageStatisticsInput(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_serializeOpHttpBindingsGetCoverageStatisticsInput(v *GetCoverageStatisticsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DetectorId == nil || len(*v.DetectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DetectorId must not be empty")} + } + if v.DetectorId != nil { + if err := encoder.SetURI("DetectorId").String(*v.DetectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetCoverageStatisticsInput(v *GetCoverageStatisticsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentCoverageFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + + if v.StatisticsType != nil { + ok := object.Key("statisticsType") + if err := awsRestjson1_serializeDocumentCoverageStatisticsTypeList(v.StatisticsType, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetDetector struct { } @@ -3178,6 +3268,106 @@ func awsRestjson1_serializeOpDocumentInviteMembersInput(v *InviteMembersInput, v return nil } +type awsRestjson1_serializeOpListCoverage struct { +} + +func (*awsRestjson1_serializeOpListCoverage) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCoverage) 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.(*ListCoverageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/detector/{DetectorId}/coverage") + 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_serializeOpHttpBindingsListCoverageInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListCoverageInput(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_serializeOpHttpBindingsListCoverageInput(v *ListCoverageInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DetectorId == nil || len(*v.DetectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DetectorId must not be empty")} + } + if v.DetectorId != nil { + if err := encoder.SetURI("DetectorId").String(*v.DetectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListCoverageInput(v *ListCoverageInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterCriteria != nil { + ok := object.Key("filterCriteria") + if err := awsRestjson1_serializeDocumentCoverageFilterCriteria(v.FilterCriteria, ok); err != nil { + return err + } + } + + if v.MaxResults != 0 { + ok := object.Key("maxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.SortCriteria != nil { + ok := object.Key("sortCriteria") + if err := awsRestjson1_serializeDocumentCoverageSortCriteria(v.SortCriteria, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListDetectors struct { } @@ -5230,6 +5420,101 @@ func awsRestjson1_serializeDocumentCondition(v *types.Condition, value smithyjso return nil } +func awsRestjson1_serializeDocumentCoverageFilterCondition(v *types.CoverageFilterCondition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Equals != nil { + ok := object.Key("equals") + if err := awsRestjson1_serializeDocumentEquals(v.Equals, ok); err != nil { + return err + } + } + + if v.NotEquals != nil { + ok := object.Key("notEquals") + if err := awsRestjson1_serializeDocumentNotEquals(v.NotEquals, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCoverageFilterCriteria(v *types.CoverageFilterCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterCriterion != nil { + ok := object.Key("filterCriterion") + if err := awsRestjson1_serializeDocumentCoverageFilterCriterionList(v.FilterCriterion, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCoverageFilterCriterion(v *types.CoverageFilterCriterion, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.CriterionKey) > 0 { + ok := object.Key("criterionKey") + ok.String(string(v.CriterionKey)) + } + + if v.FilterCondition != nil { + ok := object.Key("filterCondition") + if err := awsRestjson1_serializeDocumentCoverageFilterCondition(v.FilterCondition, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCoverageFilterCriterionList(v []types.CoverageFilterCriterion, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCoverageFilterCriterion(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCoverageSortCriteria(v *types.CoverageSortCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AttributeName) > 0 { + ok := object.Key("attributeName") + ok.String(string(v.AttributeName)) + } + + if len(v.OrderBy) > 0 { + ok := object.Key("orderBy") + ok.String(string(v.OrderBy)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCoverageStatisticsTypeList(v []types.CoverageStatisticsType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentCriterion(v map[string]types.Condition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5300,10 +5585,47 @@ func awsRestjson1_serializeDocumentDestinationProperties(v *types.DestinationPro return nil } +func awsRestjson1_serializeDocumentDetectorAdditionalConfiguration(v *types.DetectorAdditionalConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Name) > 0 { + ok := object.Key("name") + ok.String(string(v.Name)) + } + + if len(v.Status) > 0 { + ok := object.Key("status") + ok.String(string(v.Status)) + } + + return nil +} + +func awsRestjson1_serializeDocumentDetectorAdditionalConfigurations(v []types.DetectorAdditionalConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDetectorAdditionalConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentDetectorFeatureConfiguration(v *types.DetectorFeatureConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AdditionalConfiguration != nil { + ok := object.Key("additionalConfiguration") + if err := awsRestjson1_serializeDocumentDetectorAdditionalConfigurations(v.AdditionalConfiguration, ok); err != nil { + return err + } + } + if len(v.Name) > 0 { ok := object.Key("name") ok.String(string(v.Name)) @@ -5520,10 +5842,47 @@ func awsRestjson1_serializeDocumentMapEquals(v []types.ScanConditionPair, value return nil } +func awsRestjson1_serializeDocumentMemberAdditionalConfiguration(v *types.MemberAdditionalConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Name) > 0 { + ok := object.Key("name") + ok.String(string(v.Name)) + } + + if len(v.Status) > 0 { + ok := object.Key("status") + ok.String(string(v.Status)) + } + + return nil +} + +func awsRestjson1_serializeDocumentMemberAdditionalConfigurations(v []types.MemberAdditionalConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentMemberAdditionalConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentMemberFeaturesConfiguration(v *types.MemberFeaturesConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AdditionalConfiguration != nil { + ok := object.Key("additionalConfiguration") + if err := awsRestjson1_serializeDocumentMemberAdditionalConfigurations(v.AdditionalConfiguration, ok); err != nil { + return err + } + } + if len(v.Name) > 0 { ok := object.Key("name") ok.String(string(v.Name)) @@ -5572,6 +5931,36 @@ func awsRestjson1_serializeDocumentNotEquals(v []string, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentOrganizationAdditionalConfiguration(v *types.OrganizationAdditionalConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AutoEnable) > 0 { + ok := object.Key("autoEnable") + ok.String(string(v.AutoEnable)) + } + + if len(v.Name) > 0 { + ok := object.Key("name") + ok.String(string(v.Name)) + } + + return nil +} + +func awsRestjson1_serializeDocumentOrganizationAdditionalConfigurations(v []types.OrganizationAdditionalConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentOrganizationAdditionalConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentOrganizationDataSourceConfigurations(v *types.OrganizationDataSourceConfigurations, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5616,6 +6005,13 @@ func awsRestjson1_serializeDocumentOrganizationFeatureConfiguration(v *types.Org object := value.Object() defer object.Close() + if v.AdditionalConfiguration != nil { + ok := object.Key("additionalConfiguration") + if err := awsRestjson1_serializeDocumentOrganizationAdditionalConfigurations(v.AdditionalConfiguration, ok); err != nil { + return err + } + } + if len(v.AutoEnable) > 0 { ok := object.Key("autoEnable") ok.String(string(v.AutoEnable)) diff --git a/service/guardduty/types/enums.go b/service/guardduty/types/enums.go index 3902a544c78..3ba7e44fd28 100644 --- a/service/guardduty/types/enums.go +++ b/service/guardduty/types/enums.go @@ -40,6 +40,92 @@ func (AutoEnableMembers) Values() []AutoEnableMembers { } } +type CoverageFilterCriterionKey string + +// Enum values for CoverageFilterCriterionKey +const ( + CoverageFilterCriterionKeyAccountId CoverageFilterCriterionKey = "ACCOUNT_ID" + CoverageFilterCriterionKeyClusterName CoverageFilterCriterionKey = "CLUSTER_NAME" + CoverageFilterCriterionKeyResourceType CoverageFilterCriterionKey = "RESOURCE_TYPE" + CoverageFilterCriterionKeyCoverageStatus CoverageFilterCriterionKey = "COVERAGE_STATUS" + CoverageFilterCriterionKeyAddonVersion CoverageFilterCriterionKey = "ADDON_VERSION" +) + +// Values returns all known values for CoverageFilterCriterionKey. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (CoverageFilterCriterionKey) Values() []CoverageFilterCriterionKey { + return []CoverageFilterCriterionKey{ + "ACCOUNT_ID", + "CLUSTER_NAME", + "RESOURCE_TYPE", + "COVERAGE_STATUS", + "ADDON_VERSION", + } +} + +type CoverageSortKey string + +// Enum values for CoverageSortKey +const ( + CoverageSortKeyAccountId CoverageSortKey = "ACCOUNT_ID" + CoverageSortKeyClusterName CoverageSortKey = "CLUSTER_NAME" + CoverageSortKeyCoverageStatus CoverageSortKey = "COVERAGE_STATUS" + CoverageSortKeyIssue CoverageSortKey = "ISSUE" + CoverageSortKeyAddonVersion CoverageSortKey = "ADDON_VERSION" + CoverageSortKeyUpdatedAt CoverageSortKey = "UPDATED_AT" +) + +// Values returns all known values for CoverageSortKey. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (CoverageSortKey) Values() []CoverageSortKey { + return []CoverageSortKey{ + "ACCOUNT_ID", + "CLUSTER_NAME", + "COVERAGE_STATUS", + "ISSUE", + "ADDON_VERSION", + "UPDATED_AT", + } +} + +type CoverageStatisticsType string + +// Enum values for CoverageStatisticsType +const ( + CoverageStatisticsTypeCountByResourceType CoverageStatisticsType = "COUNT_BY_RESOURCE_TYPE" + CoverageStatisticsTypeCountByCoverageStatus CoverageStatisticsType = "COUNT_BY_COVERAGE_STATUS" +) + +// Values returns all known values for CoverageStatisticsType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (CoverageStatisticsType) Values() []CoverageStatisticsType { + return []CoverageStatisticsType{ + "COUNT_BY_RESOURCE_TYPE", + "COUNT_BY_COVERAGE_STATUS", + } +} + +type CoverageStatus string + +// Enum values for CoverageStatus +const ( + CoverageStatusHealthy CoverageStatus = "HEALTHY" + CoverageStatusUnhealthy CoverageStatus = "UNHEALTHY" +) + +// Values returns all known values for CoverageStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (CoverageStatus) Values() []CoverageStatus { + return []CoverageStatus{ + "HEALTHY", + "UNHEALTHY", + } +} + type CriterionKey string // Enum values for CriterionKey @@ -134,6 +220,7 @@ const ( DetectorFeatureEksAuditLogs DetectorFeature = "EKS_AUDIT_LOGS" DetectorFeatureEbsMalwareProtection DetectorFeature = "EBS_MALWARE_PROTECTION" DetectorFeatureRdsLoginEvents DetectorFeature = "RDS_LOGIN_EVENTS" + DetectorFeatureEksRuntimeMonitoring DetectorFeature = "EKS_RUNTIME_MONITORING" ) // Values returns all known values for DetectorFeature. Note that this can be @@ -145,6 +232,7 @@ func (DetectorFeature) Values() []DetectorFeature { "EKS_AUDIT_LOGS", "EBS_MALWARE_PROTECTION", "RDS_LOGIN_EVENTS", + "EKS_RUNTIME_MONITORING", } } @@ -159,6 +247,7 @@ const ( DetectorFeatureResultEksAuditLogs DetectorFeatureResult = "EKS_AUDIT_LOGS" DetectorFeatureResultEbsMalwareProtection DetectorFeatureResult = "EBS_MALWARE_PROTECTION" DetectorFeatureResultRdsLoginEvents DetectorFeatureResult = "RDS_LOGIN_EVENTS" + DetectorFeatureResultEksRuntimeMonitoring DetectorFeatureResult = "EKS_RUNTIME_MONITORING" ) // Values returns all known values for DetectorFeatureResult. Note that this can be @@ -173,6 +262,7 @@ func (DetectorFeatureResult) Values() []DetectorFeatureResult { "EKS_AUDIT_LOGS", "EBS_MALWARE_PROTECTION", "RDS_LOGIN_EVENTS", + "EKS_RUNTIME_MONITORING", } } @@ -212,6 +302,23 @@ func (EbsSnapshotPreservation) Values() []EbsSnapshotPreservation { } } +type FeatureAdditionalConfiguration string + +// Enum values for FeatureAdditionalConfiguration +const ( + FeatureAdditionalConfigurationEksAddonManagement FeatureAdditionalConfiguration = "EKS_ADDON_MANAGEMENT" +) + +// Values returns all known values for FeatureAdditionalConfiguration. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (FeatureAdditionalConfiguration) Values() []FeatureAdditionalConfiguration { + return []FeatureAdditionalConfiguration{ + "EKS_ADDON_MANAGEMENT", + } +} + type FeatureStatus string // Enum values for FeatureStatus @@ -313,6 +420,7 @@ const ( FreeTrialFeatureResultEksAuditLogs FreeTrialFeatureResult = "EKS_AUDIT_LOGS" FreeTrialFeatureResultEbsMalwareProtection FreeTrialFeatureResult = "EBS_MALWARE_PROTECTION" FreeTrialFeatureResultRdsLoginEvents FreeTrialFeatureResult = "RDS_LOGIN_EVENTS" + FreeTrialFeatureResultEksRuntimeMonitoring FreeTrialFeatureResult = "EKS_RUNTIME_MONITORING" ) // Values returns all known values for FreeTrialFeatureResult. Note that this can @@ -327,6 +435,7 @@ func (FreeTrialFeatureResult) Values() []FreeTrialFeatureResult { "EKS_AUDIT_LOGS", "EBS_MALWARE_PROTECTION", "RDS_LOGIN_EVENTS", + "EKS_RUNTIME_MONITORING", } } @@ -410,6 +519,7 @@ const ( OrgFeatureEksAuditLogs OrgFeature = "EKS_AUDIT_LOGS" OrgFeatureEbsMalwareProtection OrgFeature = "EBS_MALWARE_PROTECTION" OrgFeatureRdsLoginEvents OrgFeature = "RDS_LOGIN_EVENTS" + OrgFeatureEksRuntimeMonitoring OrgFeature = "EKS_RUNTIME_MONITORING" ) // Values returns all known values for OrgFeature. Note that this can be expanded @@ -421,6 +531,24 @@ func (OrgFeature) Values() []OrgFeature { "EKS_AUDIT_LOGS", "EBS_MALWARE_PROTECTION", "RDS_LOGIN_EVENTS", + "EKS_RUNTIME_MONITORING", + } +} + +type OrgFeatureAdditionalConfiguration string + +// Enum values for OrgFeatureAdditionalConfiguration +const ( + OrgFeatureAdditionalConfigurationEksAddonManagement OrgFeatureAdditionalConfiguration = "EKS_ADDON_MANAGEMENT" +) + +// Values returns all known values for OrgFeatureAdditionalConfiguration. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (OrgFeatureAdditionalConfiguration) Values() []OrgFeatureAdditionalConfiguration { + return []OrgFeatureAdditionalConfiguration{ + "EKS_ADDON_MANAGEMENT", } } @@ -464,6 +592,22 @@ func (PublishingStatus) Values() []PublishingStatus { } } +type ResourceType string + +// Enum values for ResourceType +const ( + ResourceTypeEks ResourceType = "EKS" +) + +// Values returns all known values for ResourceType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (ResourceType) Values() []ResourceType { + return []ResourceType{ + "EKS", + } +} + type ScanCriterionKey string // Enum values for ScanCriterionKey diff --git a/service/guardduty/types/types.go b/service/guardduty/types/types.go index ba250b8ad96..68b15a995a8 100644 --- a/service/guardduty/types/types.go +++ b/service/guardduty/types/types.go @@ -108,6 +108,18 @@ type Action struct { noSmithyDocumentSerde } +// Information about the installed EKS add-on (GuardDuty security agent). +type AddonDetails struct { + + // Status of the installed EKS add-on. + AddonStatus *string + + // Version of the installed EKS add-on. + AddonVersion *string + + noSmithyDocumentSerde +} + // The account within the organization specified as the GuardDuty delegated // administrator. type AdminAccount struct { @@ -356,6 +368,126 @@ type Country struct { noSmithyDocumentSerde } +// Information about the EKS cluster that has a coverage status. +type CoverageEksClusterDetails struct { + + // Information about the installed EKS add-on. + AddonDetails *AddonDetails + + // Name of the EKS cluster. + ClusterName *string + + // Represents all the nodes within the EKS cluster in your account. + CompatibleNodes int64 + + // Represents the nodes within the EKS cluster that have a HEALTHY coverage status. + CoveredNodes int64 + + noSmithyDocumentSerde +} + +// Represents a condition that when matched will be added to the response of the +// operation. +type CoverageFilterCondition struct { + + // Represents an equal condition that is applied to a single field while retrieving + // the coverage details. + Equals []string + + // Represents a not equal condition that is applied to a single field while + // retrieving the coverage details. + NotEquals []string + + noSmithyDocumentSerde +} + +// Represents the criteria used in the filter. +type CoverageFilterCriteria struct { + + // Represents a condition that when matched will be added to the response of the + // operation. + FilterCriterion []CoverageFilterCriterion + + noSmithyDocumentSerde +} + +// Represents a condition that when matched will be added to the response of the +// operation. +type CoverageFilterCriterion struct { + + // An enum value representing possible filter fields. + CriterionKey CoverageFilterCriterionKey + + // Contains information about the condition. + FilterCondition *CoverageFilterCondition + + noSmithyDocumentSerde +} + +// Information about the resource of the GuardDuty account. +type CoverageResource struct { + + // The unique ID of the Amazon Web Services account. + AccountId *string + + // Represents the status of the EKS cluster coverage. + CoverageStatus CoverageStatus + + // The unique ID of the GuardDuty detector associated with the resource. + DetectorId *string + + // Represents the reason why a coverage status was UNHEALTHY for the EKS cluster. + Issue *string + + // Information about the resource for which the coverage statistics are retrieved. + ResourceDetails *CoverageResourceDetails + + // The unique ID of the resource. + ResourceId *string + + // The timestamp at which the coverage details for the resource were last updated. + // This is in UTC format. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// Information about the resource for each individual EKS cluster. +type CoverageResourceDetails struct { + + // EKS cluster details involved in the coverage statistics. + EksClusterDetails *CoverageEksClusterDetails + + // The type of Amazon Web Services resource. + ResourceType ResourceType + + noSmithyDocumentSerde +} + +// Information about the sorting criteria used in the coverage statistics. +type CoverageSortCriteria struct { + + // Represents the field name used to sort the coverage details. + AttributeName CoverageSortKey + + // The order in which the sorted findings are to be displayed. + OrderBy OrderBy + + noSmithyDocumentSerde +} + +// Information about the coverage statistics for a resource. +type CoverageStatistics struct { + + // Represents coverage statistics for EKS clusters aggregated by coverage status. + CountByCoverageStatus map[string]int64 + + // Represents coverage statistics for EKS clusters aggregated by resource type. + CountByResourceType map[string]int64 + + noSmithyDocumentSerde +} + // Contains information about which data sources are enabled. type DataSourceConfigurations struct { @@ -496,9 +628,41 @@ type DestinationProperties struct { noSmithyDocumentSerde } +// Information about the additional configuration for a feature in your GuardDuty +// account. +type DetectorAdditionalConfiguration struct { + + // Name of the additional configuration. + Name FeatureAdditionalConfiguration + + // Status of the additional configuration. + Status FeatureStatus + + noSmithyDocumentSerde +} + +// Information about the additional configuration. +type DetectorAdditionalConfigurationResult struct { + + // Name of the additional configuration. + Name FeatureAdditionalConfiguration + + // Status of the additional configuration. + Status FeatureStatus + + // The timestamp at which the additional configuration was last updated. This is in + // UTC format. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + // Contains information about a GuardDuty feature. type DetectorFeatureConfiguration struct { + // Additional configuration for a resource. + AdditionalConfiguration []DetectorAdditionalConfiguration + // The name of the feature. Name DetectorFeature @@ -511,6 +675,9 @@ type DetectorFeatureConfiguration struct { // Contains information about a GuardDuty feature. type DetectorFeatureConfigurationResult struct { + // Additional configuration for a resource. + AdditionalConfiguration []DetectorAdditionalConfigurationResult + // Indicates the name of the feature that can be enabled for the detector. Name DetectorFeatureResult @@ -1119,6 +1286,40 @@ type KubernetesWorkloadDetails struct { noSmithyDocumentSerde } +// Information about the runtime process details. +type LineageObject struct { + + // The effective user ID that was used to execute the process. + Euid int32 + + // The absolute path of the process executable file. + ExecutablePath *string + + // The name of the process. + Name *string + + // The process ID of the child process. + NamespacePid int32 + + // The unique ID of the parent process. This ID is assigned to the parent process + // by GuardDuty. + ParentUuid *string + + // The ID of the process. + Pid int32 + + // The time when the process started. This is in UTC format. + StartTime *time.Time + + // The user ID of the user that executed the process. + UserId int32 + + // The unique ID assigned to the process by GuardDuty. + Uuid *string + + noSmithyDocumentSerde +} + // Contains information about the local IP address of the connection. type LocalIpDetails struct { @@ -1252,6 +1453,36 @@ type Member struct { noSmithyDocumentSerde } +// Information about the additional configuration for the member account. +type MemberAdditionalConfiguration struct { + + // Name of the additional configuration. + Name OrgFeatureAdditionalConfiguration + + // Status of the additional configuration. + Status FeatureStatus + + noSmithyDocumentSerde +} + +// Information about the additional configuration for the member account. +type MemberAdditionalConfigurationResult struct { + + // Indicates the name of the additional configuration that is set for the member + // account. + Name OrgFeatureAdditionalConfiguration + + // Indicates the status of the additional configuration that is set for the member + // account. + Status FeatureStatus + + // The timestamp at which the additional configuration was set for the member + // account. This is in UTC format. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + // Contains information on which data sources are enabled for a member account. type MemberDataSourceConfiguration struct { @@ -1274,6 +1505,9 @@ type MemberDataSourceConfiguration struct { // Contains information about the features for the member account. type MemberFeaturesConfiguration struct { + // Additional configuration of the feature for the member account. + AdditionalConfiguration []MemberAdditionalConfiguration + // The name of the feature. Name OrgFeature @@ -1286,6 +1520,10 @@ type MemberFeaturesConfiguration struct { // Contains information about the features for the member account. type MemberFeaturesConfigurationResult struct { + // Indicates the additional configuration of the feature that is configured for the + // member account. + AdditionalConfiguration []MemberAdditionalConfigurationResult + // Indicates the name of the feature that is enabled for the detector. Name OrgFeature @@ -1381,6 +1619,39 @@ type Organization struct { noSmithyDocumentSerde } +// A list of additional configurations which will be configured for the +// organization. +type OrganizationAdditionalConfiguration struct { + + // The status of the additional configuration that will be configured for the + // organization. + AutoEnable OrgFeatureStatus + + // The name of the additional configuration that will be configured for the + // organization. + Name OrgFeatureAdditionalConfiguration + + noSmithyDocumentSerde +} + +// A list of additional configuration which will be configured for the +// organization. +type OrganizationAdditionalConfigurationResult struct { + + // Describes how The status of the additional configuration that are configured for + // the member accounts within the organization. If you set AutoEnable to NEW, a + // feature will be configured for only the new accounts when they join the + // organization. If you set AutoEnable to NONE, no feature will be configured for + // the accounts when they join the organization. + AutoEnable OrgFeatureStatus + + // The name of the additional configuration that is configured for the member + // accounts within the organization. + Name OrgFeatureAdditionalConfiguration + + noSmithyDocumentSerde +} + // An object that contains information on which data sources will be configured to // be automatically enabled for new members within the organization. type OrganizationDataSourceConfigurations struct { @@ -1443,6 +1714,9 @@ type OrganizationEbsVolumesResult struct { // A list of features which will be configured for the organization. type OrganizationFeatureConfiguration struct { + // The additional information that will be configured for the organization. + AdditionalConfiguration []OrganizationAdditionalConfiguration + // The status of the feature that will be configured for the organization. AutoEnable OrgFeatureStatus @@ -1455,6 +1729,10 @@ type OrganizationFeatureConfiguration struct { // A list of features which will be configured for the organization. type OrganizationFeatureConfigurationResult struct { + // The additional configuration that is configured for the member accounts within + // the organization. + AdditionalConfiguration []OrganizationAdditionalConfigurationResult + // Describes how The status of the feature that are configured for the member // accounts within the organization. If you set AutoEnable to NEW, a feature will // be configured for only the new accounts when they join the organization. If you @@ -1648,6 +1926,52 @@ type PrivateIpAddressDetails struct { noSmithyDocumentSerde } +// Information about the observed process. +type ProcessDetails struct { + + // The effective user ID of the user that executed the process. + Euid int32 + + // The absolute path of the process executable file. + ExecutablePath *string + + // The SHA256 hash of the process executable. + ExecutableSha256 *string + + // Information about the process's lineage. + Lineage []LineageObject + + // The name of the process. + Name *string + + // The ID of the child process. + NamespacePid int32 + + // The unique ID of the parent process. This ID is assigned to the parent process + // by GuardDuty. + ParentUuid *string + + // The ID of the process. + Pid int32 + + // The present working directory of the process. + Pwd *string + + // The time when the process started. This is in UTC format. + StartTime *time.Time + + // The user that executed the process. + User *string + + // The unique ID of the user that executed the process. + UserId int32 + + // The unique ID assigned to the process by GuardDuty. + Uuid *string + + noSmithyDocumentSerde +} + // Contains information about the product code for the EC2 instance. type ProductCode struct { @@ -1838,6 +2162,92 @@ type ResourceDetails struct { noSmithyDocumentSerde } +// Additional information about the suspicious activity. +type RuntimeContext struct { + + // Represents the communication protocol associated with the address. For example, + // the address family AF_INET is used for IP version of 4 protocol. + AddressFamily *string + + // Represents the type of mounted fileSystem. + FileSystemType *string + + // Represents options that control the behavior of a runtime operation or action. + // For example, a filesystem mount operation may contain a read-only flag. + Flags []string + + // Specifies a particular protocol within the address family. Usually there is a + // single protocol in address families. For example, the address family AF_INET + // only has the IP protocol. + IanaProtocolNumber int32 + + // The value of the LD_PRELOAD environment variable. + LdPreloadValue *string + + // The path to the new library that was loaded. + LibraryPath *string + + // Specifies the Region of a process's address space such as stack and heap. + MemoryRegions []string + + // The timestamp at which the process modified the current process. The timestamp + // is in UTC date string format. + ModifiedAt *time.Time + + // Information about the process that modified the current process. This is + // available for multiple finding types. + ModifyingProcess *ProcessDetails + + // The path to the module loaded into the kernel. + ModuleFilePath *string + + // The name of the module loaded into the kernel. + ModuleName *string + + // The SHA256 hash of the module. + ModuleSha256 *string + + // The path on the host that is mounted by the container. + MountSource *string + + // The path in the container that is mapped to the host directory. + MountTarget *string + + // The path in the container that modified the release agent file. + ReleaseAgentPath *string + + // The path to the leveraged runc implementation. + RuncBinaryPath *string + + // The path to the script that was executed. + ScriptPath *string + + // The path to the modified shell history file. + ShellHistoryFilePath *string + + // The path to the docket socket that was accessed. + SocketPath *string + + // Information about the process that had its memory overwritten by the current + // process. + TargetProcess *ProcessDetails + + noSmithyDocumentSerde +} + +// Information about the process and any required context values for a specific +// finding. +type RuntimeDetails struct { + + // Additional information about the suspicious activity. + Context *RuntimeContext + + // Information about the observed process. + Process *ProcessDetails + + noSmithyDocumentSerde +} + // Contains information on the S3 bucket. type S3BucketDetail struct { @@ -2142,6 +2552,10 @@ type Service struct { // The resource role information for this finding. ResourceRole *string + // Information about the process and any required context values for a specific + // finding + RuntimeDetails *RuntimeDetails + // The name of the Amazon Web Services service (GuardDuty) that generated a // finding. ServiceName *string diff --git a/service/guardduty/validators.go b/service/guardduty/validators.go index a8857f97695..3ed4e1bd433 100644 --- a/service/guardduty/validators.go +++ b/service/guardduty/validators.go @@ -550,6 +550,26 @@ func (m *validateOpGetAdministratorAccount) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpGetCoverageStatistics struct { +} + +func (*validateOpGetCoverageStatistics) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCoverageStatistics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCoverageStatisticsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCoverageStatisticsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetDetector struct { } @@ -810,6 +830,26 @@ func (m *validateOpInviteMembers) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpListCoverage struct { +} + +func (*validateOpListCoverage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCoverage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCoverageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCoverageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListFilters struct { } @@ -1338,6 +1378,10 @@ func addOpGetAdministratorAccountValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpGetAdministratorAccount{}, middleware.After) } +func addOpGetCoverageStatisticsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCoverageStatistics{}, middleware.After) +} + func addOpGetDetectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDetector{}, middleware.After) } @@ -1390,6 +1434,10 @@ func addOpInviteMembersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpInviteMembers{}, middleware.After) } +func addOpListCoverageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCoverage{}, middleware.After) +} + func addOpListFiltersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListFilters{}, middleware.After) } @@ -2210,6 +2258,24 @@ func validateOpGetAdministratorAccountInput(v *GetAdministratorAccountInput) err } } +func validateOpGetCoverageStatisticsInput(v *GetCoverageStatisticsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCoverageStatisticsInput"} + if v.DetectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DetectorId")) + } + if v.StatisticsType == nil { + invalidParams.Add(smithy.NewErrParamRequired("StatisticsType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetDetectorInput(v *GetDetectorInput) error { if v == nil { return nil @@ -2435,6 +2501,21 @@ func validateOpInviteMembersInput(v *InviteMembersInput) error { } } +func validateOpListCoverageInput(v *ListCoverageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCoverageInput"} + if v.DetectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DetectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListFiltersInput(v *ListFiltersInput) error { if v == nil { return nil diff --git a/service/imagebuilder/api_op_CancelImageCreation.go b/service/imagebuilder/api_op_CancelImageCreation.go index e67d453df69..2698042a984 100644 --- a/service/imagebuilder/api_op_CancelImageCreation.go +++ b/service/imagebuilder/api_op_CancelImageCreation.go @@ -38,7 +38,8 @@ type CancelImageCreationInput struct { // This member is required. ClientToken *string - // The Amazon Resource Name (ARN) of the image whose creation you want to cancel. + // The Amazon Resource Name (ARN) of the image that you want to cancel creation + // for. // // This member is required. ImageBuildVersionArn *string @@ -51,7 +52,7 @@ type CancelImageCreationOutput struct { // The idempotency token that was used for this request. ClientToken *string - // The Amazon Resource Name (ARN) of the image whose creation has been cancelled. + // The ARN of the image whose creation this request canceled. ImageBuildVersionArn *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_CreateComponent.go b/service/imagebuilder/api_op_CreateComponent.go index f48d4dbc191..dbf5230c07f 100644 --- a/service/imagebuilder/api_op_CreateComponent.go +++ b/service/imagebuilder/api_op_CreateComponent.go @@ -105,8 +105,7 @@ type CreateComponentOutput struct { // The idempotency token used to make this request idempotent. ClientToken *string - // The Amazon Resource Name (ARN) of the component that was created by this - // request. + // The Amazon Resource Name (ARN) of the component that this request created. ComponentBuildVersionArn *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_CreateImage.go b/service/imagebuilder/api_op_CreateImage.go index a15931c3d77..7796fac7391 100644 --- a/service/imagebuilder/api_op_CreateImage.go +++ b/service/imagebuilder/api_op_CreateImage.go @@ -61,6 +61,9 @@ type CreateImageInput struct { // configured, tested, and assessed. ImageRecipeArn *string + // Contains settings for vulnerability scans. + ImageScanningConfiguration *types.ImageScanningConfiguration + // The image tests configuration of the image. ImageTestsConfiguration *types.ImageTestsConfiguration @@ -75,7 +78,7 @@ type CreateImageOutput struct { // The idempotency token used to make this request idempotent. ClientToken *string - // The Amazon Resource Name (ARN) of the image that was created by this request. + // The Amazon Resource Name (ARN) of the image that this request created. ImageBuildVersionArn *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_CreateImagePipeline.go b/service/imagebuilder/api_op_CreateImagePipeline.go index ed8d1251e37..ac689c87a92 100644 --- a/service/imagebuilder/api_op_CreateImagePipeline.go +++ b/service/imagebuilder/api_op_CreateImagePipeline.go @@ -67,6 +67,9 @@ type CreateImagePipelineInput struct { // configure images created by this image pipeline. ImageRecipeArn *string + // Contains settings for vulnerability scans. + ImageScanningConfiguration *types.ImageScanningConfiguration + // The image test configuration of the image pipeline. ImageTestsConfiguration *types.ImageTestsConfiguration diff --git a/service/imagebuilder/api_op_DeleteComponent.go b/service/imagebuilder/api_op_DeleteComponent.go index dfbf0e3a62f..334ff325d7c 100644 --- a/service/imagebuilder/api_op_DeleteComponent.go +++ b/service/imagebuilder/api_op_DeleteComponent.go @@ -38,7 +38,7 @@ type DeleteComponentInput struct { type DeleteComponentOutput struct { - // The Amazon Resource Name (ARN) of the component build version that was deleted. + // The ARN of the component build version that this request deleted. ComponentBuildVersionArn *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_DeleteImage.go b/service/imagebuilder/api_op_DeleteImage.go index 4a7589910a2..557436598de 100644 --- a/service/imagebuilder/api_op_DeleteImage.go +++ b/service/imagebuilder/api_op_DeleteImage.go @@ -56,8 +56,7 @@ type DeleteImageInput struct { type DeleteImageOutput struct { - // The Amazon Resource Name (ARN) of the Image Builder image resource that was - // deleted. + // The ARN of the Image Builder image resource that this request deleted. ImageBuildVersionArn *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_GetComponent.go b/service/imagebuilder/api_op_GetComponent.go index cadb3760224..8fd08c2dc49 100644 --- a/service/imagebuilder/api_op_GetComponent.go +++ b/service/imagebuilder/api_op_GetComponent.go @@ -29,8 +29,8 @@ func (c *Client) GetComponent(ctx context.Context, params *GetComponentInput, op type GetComponentInput struct { - // The Amazon Resource Name (ARN) of the component that you want to retrieve. Regex - // requires "/\d+$" suffix. + // The Amazon Resource Name (ARN) of the component that you want to get. Regex + // requires the suffix /\d+$. // // This member is required. ComponentBuildVersionArn *string diff --git a/service/imagebuilder/api_op_GetImage.go b/service/imagebuilder/api_op_GetImage.go index b403ceef847..7180fb0667e 100644 --- a/service/imagebuilder/api_op_GetImage.go +++ b/service/imagebuilder/api_op_GetImage.go @@ -29,7 +29,7 @@ func (c *Client) GetImage(ctx context.Context, params *GetImageInput, optFns ... type GetImageInput struct { - // The Amazon Resource Name (ARN) of the image that you want to retrieve. + // The Amazon Resource Name (ARN) of the image that you want to get. // // This member is required. ImageBuildVersionArn *string diff --git a/service/imagebuilder/api_op_GetWorkflowExecution.go b/service/imagebuilder/api_op_GetWorkflowExecution.go new file mode 100644 index 00000000000..456c91986ef --- /dev/null +++ b/service/imagebuilder/api_op_GetWorkflowExecution.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get the runtime information that was logged for a specific runtime instance of +// the workflow. +func (c *Client) GetWorkflowExecution(ctx context.Context, params *GetWorkflowExecutionInput, optFns ...func(*Options)) (*GetWorkflowExecutionOutput, error) { + if params == nil { + params = &GetWorkflowExecutionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWorkflowExecution", params, optFns, c.addOperationGetWorkflowExecutionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWorkflowExecutionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWorkflowExecutionInput struct { + + // Use the unique identifier for a runtime instance of the workflow to get runtime + // details. + // + // This member is required. + WorkflowExecutionId *string + + noSmithyDocumentSerde +} + +type GetWorkflowExecutionOutput struct { + + // The timestamp when the specified runtime instance of the workflow finished. + EndTime *string + + // The Amazon Resource Name (ARN) of the image resource build version that the + // specified runtime instance of the workflow created. + ImageBuildVersionArn *string + + // The output message from the specified runtime instance of the workflow, if + // applicable. + Message *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // The timestamp when the specified runtime instance of the workflow started. + StartTime *string + + // The current runtime status for the specified runtime instance of the workflow. + Status types.WorkflowExecutionStatus + + // The total number of steps in the specified runtime instance of the workflow that + // ran. This number should equal the sum of the step counts for steps that + // succeeded, were skipped, and failed. + TotalStepCount int32 + + // A runtime count for the number of steps that failed in the specified runtime + // instance of the workflow. + TotalStepsFailed int32 + + // A runtime count for the number of steps that were skipped in the specified + // runtime instance of the workflow. + TotalStepsSkipped int32 + + // A runtime count for the number of steps that ran successfully in the specified + // runtime instance of the workflow. + TotalStepsSucceeded int32 + + // The type of workflow that Image Builder ran for the specified runtime instance + // of the workflow. + Type types.WorkflowType + + // The Amazon Resource Name (ARN) of the build version for the Image Builder + // workflow resource that defines the specified runtime instance of the workflow. + WorkflowBuildVersionArn *string + + // The unique identifier that Image Builder assigned to keep track of runtime + // details when it ran the workflow. + WorkflowExecutionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetWorkflowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorkflowExecution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorkflowExecution{}, 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 = addOpGetWorkflowExecutionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorkflowExecution(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_opGetWorkflowExecution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "GetWorkflowExecution", + } +} diff --git a/service/imagebuilder/api_op_GetWorkflowStepExecution.go b/service/imagebuilder/api_op_GetWorkflowStepExecution.go new file mode 100644 index 00000000000..ee35bba4b31 --- /dev/null +++ b/service/imagebuilder/api_op_GetWorkflowStepExecution.go @@ -0,0 +1,179 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get the runtime information that was logged for a specific runtime instance of +// the workflow step. +func (c *Client) GetWorkflowStepExecution(ctx context.Context, params *GetWorkflowStepExecutionInput, optFns ...func(*Options)) (*GetWorkflowStepExecutionOutput, error) { + if params == nil { + params = &GetWorkflowStepExecutionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWorkflowStepExecution", params, optFns, c.addOperationGetWorkflowStepExecutionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWorkflowStepExecutionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWorkflowStepExecutionInput struct { + + // Use the unique identifier for a specific runtime instance of the workflow step + // to get runtime details for that step. + // + // This member is required. + StepExecutionId *string + + noSmithyDocumentSerde +} + +type GetWorkflowStepExecutionOutput struct { + + // The name of the action that the specified step performs. + Action *string + + // Describes the specified workflow step. + Description *string + + // The timestamp when the specified runtime instance of the workflow step finished. + EndTime *string + + // The Amazon Resource Name (ARN) of the image resource build version that the + // specified runtime instance of the workflow step creates. + ImageBuildVersionArn *string + + // Input parameters that Image Builder provided for the specified runtime instance + // of the workflow step. + Inputs *string + + // The output message from the specified runtime instance of the workflow step, if + // applicable. + Message *string + + // The name of the specified runtime instance of the workflow step. + Name *string + + // The action to perform if the workflow step fails. + OnFailure *string + + // The file names that the specified runtime version of the workflow step created + // as output. + Outputs *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Reports on the rollback status of the specified runtime version of the workflow + // step, if applicable. + RollbackStatus types.WorkflowStepExecutionRollbackStatus + + // The timestamp when the specified runtime version of the workflow step started. + StartTime *string + + // The current status for the specified runtime version of the workflow step. + Status types.WorkflowStepExecutionStatus + + // The unique identifier for the runtime version of the workflow step that you + // specified in the request. + StepExecutionId *string + + // The maximum duration in seconds for this step to complete its action. + TimeoutSeconds *int32 + + // The Amazon Resource Name (ARN) of the build version for the Image Builder + // workflow resource that defines this workflow step. + WorkflowBuildVersionArn *string + + // The unique identifier that Image Builder assigned to keep track of runtime + // details when it ran the workflow. + WorkflowExecutionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetWorkflowStepExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorkflowStepExecution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorkflowStepExecution{}, 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 = addOpGetWorkflowStepExecutionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorkflowStepExecution(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_opGetWorkflowStepExecution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "GetWorkflowStepExecution", + } +} diff --git a/service/imagebuilder/api_op_ImportComponent.go b/service/imagebuilder/api_op_ImportComponent.go index e571021cb24..2df9a66cde5 100644 --- a/service/imagebuilder/api_op_ImportComponent.go +++ b/service/imagebuilder/api_op_ImportComponent.go @@ -67,9 +67,9 @@ type ImportComponentInput struct { // This member is required. Type types.ComponentType - // The change description of the component. Describes what change has been made in - // this version, or what makes this version different from other versions of this - // component. + // The change description of the component. This description indicates the change + // that has been made in this version, or what makes this version different from + // other versions of this component. ChangeDescription *string // The data of the component. Used to specify the data inline. Either data or uri diff --git a/service/imagebuilder/api_op_ListComponentBuildVersions.go b/service/imagebuilder/api_op_ListComponentBuildVersions.go index 317b219a4c5..5ea2d908358 100644 --- a/service/imagebuilder/api_op_ListComponentBuildVersions.go +++ b/service/imagebuilder/api_op_ListComponentBuildVersions.go @@ -57,9 +57,9 @@ type ListComponentBuildVersionsOutput struct { // The list of component summaries for the specified semantic version. ComponentSummaryList []types.ComponentSummary - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListComponents.go b/service/imagebuilder/api_op_ListComponents.go index c0aa9cd43cc..412c8ccc6dc 100644 --- a/service/imagebuilder/api_op_ListComponents.go +++ b/service/imagebuilder/api_op_ListComponents.go @@ -78,9 +78,9 @@ type ListComponentsOutput struct { // ../. You can assign values for the first three, and can filter on all of them. ComponentVersionList []types.ComponentVersion - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListContainerRecipes.go b/service/imagebuilder/api_op_ListContainerRecipes.go index 3c670d64d88..33bc6fb6223 100644 --- a/service/imagebuilder/api_op_ListContainerRecipes.go +++ b/service/imagebuilder/api_op_ListContainerRecipes.go @@ -42,11 +42,11 @@ type ListContainerRecipesInput struct { // * platform Filters []types.Filter - // The maximum number of results to return in the list. + // The maximum items to return in a request. MaxResults *int32 - // Provides a token for pagination, which determines where to begin the next set of - // results when the current set reaches the maximum for one request. + // A token to specify where to start paginating. This is the NextToken from a + // previously truncated response. NextToken *string // Returns container recipes belonging to the specified owner, that have been @@ -62,10 +62,9 @@ type ListContainerRecipesOutput struct { // The list of container recipes returned for the request. ContainerRecipeSummaryList []types.ContainerRecipeSummary - // The next token field is used for paginated responses. When this is not empty, - // there are additional container recipes that the service has not included in this - // response. Use this token with the next request to retrieve additional list - // items. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. @@ -148,7 +147,7 @@ var _ ListContainerRecipesAPIClient = (*Client)(nil) // ListContainerRecipesPaginatorOptions is the paginator options for // ListContainerRecipes type ListContainerRecipesPaginatorOptions struct { - // The maximum number of results to return in the list. + // The maximum items to return in a request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/imagebuilder/api_op_ListDistributionConfigurations.go b/service/imagebuilder/api_op_ListDistributionConfigurations.go index 57458ec3a54..07d8b956b2f 100644 --- a/service/imagebuilder/api_op_ListDistributionConfigurations.go +++ b/service/imagebuilder/api_op_ListDistributionConfigurations.go @@ -48,9 +48,9 @@ type ListDistributionConfigurationsOutput struct { // The list of distributions. DistributionConfigurationSummaryList []types.DistributionConfigurationSummary - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListImageBuildVersions.go b/service/imagebuilder/api_op_ListImageBuildVersions.go index d1f24d29029..445d9620a92 100644 --- a/service/imagebuilder/api_op_ListImageBuildVersions.go +++ b/service/imagebuilder/api_op_ListImageBuildVersions.go @@ -65,9 +65,9 @@ type ListImageBuildVersionsOutput struct { // The list of image build versions. ImageSummaryList []types.ImageSummary - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListImagePackages.go b/service/imagebuilder/api_op_ListImagePackages.go index 88585dc2381..f79c6be6f62 100644 --- a/service/imagebuilder/api_op_ListImagePackages.go +++ b/service/imagebuilder/api_op_ListImagePackages.go @@ -36,7 +36,7 @@ type ListImagePackagesInput struct { // This member is required. ImageBuildVersionArn *string - // The maxiumum number of results to return from the ListImagePackages request. + // The maximum items to return in a request. MaxResults *int32 // A token to specify where to start paginating. This is the NextToken from a @@ -51,8 +51,9 @@ type ListImagePackagesOutput struct { // The list of Image Packages returned in the response. ImagePackageList []types.ImagePackage - // A token to specify where to start paginating. This is the NextToken from a - // previously truncated response. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. @@ -137,7 +138,7 @@ var _ ListImagePackagesAPIClient = (*Client)(nil) // ListImagePackagesPaginatorOptions is the paginator options for ListImagePackages type ListImagePackagesPaginatorOptions struct { - // The maxiumum number of results to return from the ListImagePackages request. + // The maximum items to return in a request. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/imagebuilder/api_op_ListImagePipelineImages.go b/service/imagebuilder/api_op_ListImagePipelineImages.go index 08db6e34d0f..272f0df79da 100644 --- a/service/imagebuilder/api_op_ListImagePipelineImages.go +++ b/service/imagebuilder/api_op_ListImagePipelineImages.go @@ -58,9 +58,9 @@ type ListImagePipelineImagesOutput struct { // The list of images built by this pipeline. ImageSummaryList []types.ImageSummary - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListImagePipelines.go b/service/imagebuilder/api_op_ListImagePipelines.go index bb5438e0733..828ede0f49b 100644 --- a/service/imagebuilder/api_op_ListImagePipelines.go +++ b/service/imagebuilder/api_op_ListImagePipelines.go @@ -62,9 +62,9 @@ type ListImagePipelinesOutput struct { // The list of image pipelines. ImagePipelineList []types.ImagePipeline - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListImageRecipes.go b/service/imagebuilder/api_op_ListImageRecipes.go index 3e9a8b83aac..1ae9efacb2c 100644 --- a/service/imagebuilder/api_op_ListImageRecipes.go +++ b/service/imagebuilder/api_op_ListImageRecipes.go @@ -61,9 +61,9 @@ type ListImageRecipesOutput struct { // The list of image pipelines. ImageRecipeSummaryList []types.ImageRecipeSummary - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListImageScanFindingAggregations.go b/service/imagebuilder/api_op_ListImageScanFindingAggregations.go new file mode 100644 index 00000000000..9fb3eec7732 --- /dev/null +++ b/service/imagebuilder/api_op_ListImageScanFindingAggregations.go @@ -0,0 +1,245 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of image scan aggregations for your account. You can filter by +// the type of key that Image Builder uses to group results. For example, if you +// want to get a list of findings by severity level for one of your pipelines, you +// might specify your pipeline with the imagePipelineArn filter. If you don't +// specify a filter, Image Builder returns an aggregation for your account. To +// streamline results, you can use the following filters in your request: +// +// * +// accountId +// +// * imageBuildVersionArn +// +// * imagePipelineArn +// +// * vulnerabilityId +func (c *Client) ListImageScanFindingAggregations(ctx context.Context, params *ListImageScanFindingAggregationsInput, optFns ...func(*Options)) (*ListImageScanFindingAggregationsOutput, error) { + if params == nil { + params = &ListImageScanFindingAggregationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListImageScanFindingAggregations", params, optFns, c.addOperationListImageScanFindingAggregationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListImageScanFindingAggregationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListImageScanFindingAggregationsInput struct { + + // A filter name and value pair that is used to return a more specific list of + // results from a list operation. Filters can be used to match a set of resources + // by specific criteria, such as tags, attributes, or IDs. + Filter *types.Filter + + // A token to specify where to start paginating. This is the NextToken from a + // previously truncated response. + NextToken *string + + noSmithyDocumentSerde +} + +type ListImageScanFindingAggregationsOutput struct { + + // The aggregation type specifies what type of key is used to group the image scan + // findings. Image Builder returns results based on the request filter. If you + // didn't specify a filter in the request, the type defaults to accountId. + // Aggregation types + // + // * accountId + // + // * imageBuildVersionArn + // + // * imagePipelineArn + // + // * + // vulnerabilityId + // + // Each aggregation includes counts by severity level for medium + // severity and higher level findings, plus a total for all of the findings for + // each key value. + AggregationType *string + + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. + NextToken *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // An array of image scan finding aggregations that match the filter criteria. + Responses []types.ImageScanFindingAggregation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListImageScanFindingAggregationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListImageScanFindingAggregations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImageScanFindingAggregations{}, 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_opListImageScanFindingAggregations(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 +} + +// ListImageScanFindingAggregationsAPIClient is a client that implements the +// ListImageScanFindingAggregations operation. +type ListImageScanFindingAggregationsAPIClient interface { + ListImageScanFindingAggregations(context.Context, *ListImageScanFindingAggregationsInput, ...func(*Options)) (*ListImageScanFindingAggregationsOutput, error) +} + +var _ ListImageScanFindingAggregationsAPIClient = (*Client)(nil) + +// ListImageScanFindingAggregationsPaginatorOptions is the paginator options for +// ListImageScanFindingAggregations +type ListImageScanFindingAggregationsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListImageScanFindingAggregationsPaginator is a paginator for +// ListImageScanFindingAggregations +type ListImageScanFindingAggregationsPaginator struct { + options ListImageScanFindingAggregationsPaginatorOptions + client ListImageScanFindingAggregationsAPIClient + params *ListImageScanFindingAggregationsInput + nextToken *string + firstPage bool +} + +// NewListImageScanFindingAggregationsPaginator returns a new +// ListImageScanFindingAggregationsPaginator +func NewListImageScanFindingAggregationsPaginator(client ListImageScanFindingAggregationsAPIClient, params *ListImageScanFindingAggregationsInput, optFns ...func(*ListImageScanFindingAggregationsPaginatorOptions)) *ListImageScanFindingAggregationsPaginator { + if params == nil { + params = &ListImageScanFindingAggregationsInput{} + } + + options := ListImageScanFindingAggregationsPaginatorOptions{} + + for _, fn := range optFns { + fn(&options) + } + + return &ListImageScanFindingAggregationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageScanFindingAggregationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListImageScanFindingAggregations page. +func (p *ListImageScanFindingAggregationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageScanFindingAggregationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + result, err := p.client.ListImageScanFindingAggregations(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_opListImageScanFindingAggregations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "ListImageScanFindingAggregations", + } +} diff --git a/service/imagebuilder/api_op_ListImageScanFindings.go b/service/imagebuilder/api_op_ListImageScanFindings.go new file mode 100644 index 00000000000..045f7b26588 --- /dev/null +++ b/service/imagebuilder/api_op_ListImageScanFindings.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of image scan findings for your account. +func (c *Client) ListImageScanFindings(ctx context.Context, params *ListImageScanFindingsInput, optFns ...func(*Options)) (*ListImageScanFindingsOutput, error) { + if params == nil { + params = &ListImageScanFindingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListImageScanFindings", params, optFns, c.addOperationListImageScanFindingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListImageScanFindingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListImageScanFindingsInput struct { + + // An array of name value pairs that you can use to filter your results. You can + // use the following filters to streamline results: + // + // * imageBuildVersionArn + // + // * + // imagePipelineArn + // + // * vulnerabilityId + // + // * severity + // + // If you don't request a filter, + // then all findings in your account are listed. + Filters []types.ImageScanFindingsFilter + + // The maximum items to return in a request. + MaxResults *int32 + + // A token to specify where to start paginating. This is the NextToken from a + // previously truncated response. + NextToken *string + + noSmithyDocumentSerde +} + +type ListImageScanFindingsOutput struct { + + // The image scan findings for your account that meet your request filter criteria. + Findings []types.ImageScanFinding + + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. + NextToken *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListImageScanFindingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListImageScanFindings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImageScanFindings{}, 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_opListImageScanFindings(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 +} + +// ListImageScanFindingsAPIClient is a client that implements the +// ListImageScanFindings operation. +type ListImageScanFindingsAPIClient interface { + ListImageScanFindings(context.Context, *ListImageScanFindingsInput, ...func(*Options)) (*ListImageScanFindingsOutput, error) +} + +var _ ListImageScanFindingsAPIClient = (*Client)(nil) + +// ListImageScanFindingsPaginatorOptions is the paginator options for +// ListImageScanFindings +type ListImageScanFindingsPaginatorOptions struct { + // The maximum items to return in a request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListImageScanFindingsPaginator is a paginator for ListImageScanFindings +type ListImageScanFindingsPaginator struct { + options ListImageScanFindingsPaginatorOptions + client ListImageScanFindingsAPIClient + params *ListImageScanFindingsInput + nextToken *string + firstPage bool +} + +// NewListImageScanFindingsPaginator returns a new ListImageScanFindingsPaginator +func NewListImageScanFindingsPaginator(client ListImageScanFindingsAPIClient, params *ListImageScanFindingsInput, optFns ...func(*ListImageScanFindingsPaginatorOptions)) *ListImageScanFindingsPaginator { + if params == nil { + params = &ListImageScanFindingsInput{} + } + + options := ListImageScanFindingsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListImageScanFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageScanFindingsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListImageScanFindings page. +func (p *ListImageScanFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageScanFindingsOutput, 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.ListImageScanFindings(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_opListImageScanFindings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "ListImageScanFindings", + } +} diff --git a/service/imagebuilder/api_op_ListImages.go b/service/imagebuilder/api_op_ListImages.go index 7967b5b850b..7db2ed58524 100644 --- a/service/imagebuilder/api_op_ListImages.go +++ b/service/imagebuilder/api_op_ListImages.go @@ -77,9 +77,9 @@ type ListImagesOutput struct { // the right of the first wildcard must also be wildcards. ImageVersionList []types.ImageVersion - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListInfrastructureConfigurations.go b/service/imagebuilder/api_op_ListInfrastructureConfigurations.go index 5e6e1a40bc3..2c610560d15 100644 --- a/service/imagebuilder/api_op_ListInfrastructureConfigurations.go +++ b/service/imagebuilder/api_op_ListInfrastructureConfigurations.go @@ -48,9 +48,9 @@ type ListInfrastructureConfigurationsOutput struct { // The list of infrastructure configurations. InfrastructureConfigurationSummaryList []types.InfrastructureConfigurationSummary - // The next token used for paginated responses. When this is not empty, there are - // additional elements that the service has not included in this request. Use this - // token with the next request to retrieve additional objects. + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. NextToken *string // The request ID that uniquely identifies this request. diff --git a/service/imagebuilder/api_op_ListWorkflowExecutions.go b/service/imagebuilder/api_op_ListWorkflowExecutions.go new file mode 100644 index 00000000000..0d8edd61f59 --- /dev/null +++ b/service/imagebuilder/api_op_ListWorkflowExecutions.go @@ -0,0 +1,238 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of workflow runtime instance metadata objects for a specific +// image build version. +func (c *Client) ListWorkflowExecutions(ctx context.Context, params *ListWorkflowExecutionsInput, optFns ...func(*Options)) (*ListWorkflowExecutionsOutput, error) { + if params == nil { + params = &ListWorkflowExecutionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWorkflowExecutions", params, optFns, c.addOperationListWorkflowExecutionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWorkflowExecutionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWorkflowExecutionsInput struct { + + // List all workflow runtime instances for the specified image build version + // resource ARN. + // + // This member is required. + ImageBuildVersionArn *string + + // The maximum items to return in a request. + MaxResults *int32 + + // A token to specify where to start paginating. This is the NextToken from a + // previously truncated response. + NextToken *string + + noSmithyDocumentSerde +} + +type ListWorkflowExecutionsOutput struct { + + // The resource ARN of the image build version for which you requested a list of + // workflow runtime details. + ImageBuildVersionArn *string + + // The output message from the list action, if applicable. + Message *string + + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. + NextToken *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Contains an array of runtime details that represents each time a workflow ran + // for the requested image build version. + WorkflowExecutions []types.WorkflowExecutionMetadata + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListWorkflowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkflowExecutions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkflowExecutions{}, 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 = addOpListWorkflowExecutionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkflowExecutions(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 +} + +// ListWorkflowExecutionsAPIClient is a client that implements the +// ListWorkflowExecutions operation. +type ListWorkflowExecutionsAPIClient interface { + ListWorkflowExecutions(context.Context, *ListWorkflowExecutionsInput, ...func(*Options)) (*ListWorkflowExecutionsOutput, error) +} + +var _ ListWorkflowExecutionsAPIClient = (*Client)(nil) + +// ListWorkflowExecutionsPaginatorOptions is the paginator options for +// ListWorkflowExecutions +type ListWorkflowExecutionsPaginatorOptions struct { + // The maximum items to return in a request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListWorkflowExecutionsPaginator is a paginator for ListWorkflowExecutions +type ListWorkflowExecutionsPaginator struct { + options ListWorkflowExecutionsPaginatorOptions + client ListWorkflowExecutionsAPIClient + params *ListWorkflowExecutionsInput + nextToken *string + firstPage bool +} + +// NewListWorkflowExecutionsPaginator returns a new ListWorkflowExecutionsPaginator +func NewListWorkflowExecutionsPaginator(client ListWorkflowExecutionsAPIClient, params *ListWorkflowExecutionsInput, optFns ...func(*ListWorkflowExecutionsPaginatorOptions)) *ListWorkflowExecutionsPaginator { + if params == nil { + params = &ListWorkflowExecutionsInput{} + } + + options := ListWorkflowExecutionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListWorkflowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkflowExecutionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListWorkflowExecutions page. +func (p *ListWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowExecutionsOutput, 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.ListWorkflowExecutions(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_opListWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "ListWorkflowExecutions", + } +} diff --git a/service/imagebuilder/api_op_ListWorkflowStepExecutions.go b/service/imagebuilder/api_op_ListWorkflowStepExecutions.go new file mode 100644 index 00000000000..1806d606ba7 --- /dev/null +++ b/service/imagebuilder/api_op_ListWorkflowStepExecutions.go @@ -0,0 +1,248 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Shows runtime data for each step in a runtime instance of the workflow that you +// specify in the request. +func (c *Client) ListWorkflowStepExecutions(ctx context.Context, params *ListWorkflowStepExecutionsInput, optFns ...func(*Options)) (*ListWorkflowStepExecutionsOutput, error) { + if params == nil { + params = &ListWorkflowStepExecutionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWorkflowStepExecutions", params, optFns, c.addOperationListWorkflowStepExecutionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWorkflowStepExecutionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWorkflowStepExecutionsInput struct { + + // The unique identifier that Image Builder assigned to keep track of runtime + // details when it ran the workflow. + // + // This member is required. + WorkflowExecutionId *string + + // The maximum items to return in a request. + MaxResults *int32 + + // A token to specify where to start paginating. This is the NextToken from a + // previously truncated response. + NextToken *string + + noSmithyDocumentSerde +} + +type ListWorkflowStepExecutionsOutput struct { + + // The image build version resource ARN that's associated with the specified + // runtime instance of the workflow. + ImageBuildVersionArn *string + + // The output message from the list action, if applicable. + Message *string + + // The next token used for paginated responses. When this field isn't empty, there + // are additional elements that the service has'ot included in this request. Use + // this token with the next request to retrieve additional objects. + NextToken *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Contains an array of runtime details that represents each step in this runtime + // instance of the workflow. + Steps []types.WorkflowStepMetadata + + // The build version ARN for the Image Builder workflow resource that defines the + // steps for this runtime instance of the workflow. + WorkflowBuildVersionArn *string + + // The unique identifier that Image Builder assigned to keep track of runtime + // details when it ran the workflow. + WorkflowExecutionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListWorkflowStepExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkflowStepExecutions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkflowStepExecutions{}, 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 = addOpListWorkflowStepExecutionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkflowStepExecutions(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 +} + +// ListWorkflowStepExecutionsAPIClient is a client that implements the +// ListWorkflowStepExecutions operation. +type ListWorkflowStepExecutionsAPIClient interface { + ListWorkflowStepExecutions(context.Context, *ListWorkflowStepExecutionsInput, ...func(*Options)) (*ListWorkflowStepExecutionsOutput, error) +} + +var _ ListWorkflowStepExecutionsAPIClient = (*Client)(nil) + +// ListWorkflowStepExecutionsPaginatorOptions is the paginator options for +// ListWorkflowStepExecutions +type ListWorkflowStepExecutionsPaginatorOptions struct { + // The maximum items to return in a request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListWorkflowStepExecutionsPaginator is a paginator for +// ListWorkflowStepExecutions +type ListWorkflowStepExecutionsPaginator struct { + options ListWorkflowStepExecutionsPaginatorOptions + client ListWorkflowStepExecutionsAPIClient + params *ListWorkflowStepExecutionsInput + nextToken *string + firstPage bool +} + +// NewListWorkflowStepExecutionsPaginator returns a new +// ListWorkflowStepExecutionsPaginator +func NewListWorkflowStepExecutionsPaginator(client ListWorkflowStepExecutionsAPIClient, params *ListWorkflowStepExecutionsInput, optFns ...func(*ListWorkflowStepExecutionsPaginatorOptions)) *ListWorkflowStepExecutionsPaginator { + if params == nil { + params = &ListWorkflowStepExecutionsInput{} + } + + options := ListWorkflowStepExecutionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListWorkflowStepExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkflowStepExecutionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListWorkflowStepExecutions page. +func (p *ListWorkflowStepExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowStepExecutionsOutput, 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.ListWorkflowStepExecutions(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_opListWorkflowStepExecutions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "ListWorkflowStepExecutions", + } +} diff --git a/service/imagebuilder/api_op_UpdateImagePipeline.go b/service/imagebuilder/api_op_UpdateImagePipeline.go index e180caf0829..a151c549144 100644 --- a/service/imagebuilder/api_op_UpdateImagePipeline.go +++ b/service/imagebuilder/api_op_UpdateImagePipeline.go @@ -43,8 +43,8 @@ type UpdateImagePipelineInput struct { // This member is required. ImagePipelineArn *string - // The Amazon Resource Name (ARN) of the infrastructure configuration that will be - // used to build images updated by this image pipeline. + // The Amazon Resource Name (ARN) of the infrastructure configuration that Image + // Builder uses to build images that this image pipeline has updated. // // This member is required. InfrastructureConfigurationArn *string @@ -55,8 +55,9 @@ type UpdateImagePipelineInput struct { // The description of the image pipeline. Description *string - // The Amazon Resource Name (ARN) of the distribution configuration that will be - // used to configure and distribute images updated by this image pipeline. + // The Amazon Resource Name (ARN) of the distribution configuration that Image + // Builder uses to configure and distribute images that this image pipeline has + // updated. DistributionConfigurationArn *string // Collects additional information about the image being created, including the @@ -68,6 +69,9 @@ type UpdateImagePipelineInput struct { // configure images updated by this image pipeline. ImageRecipeArn *string + // Contains settings for vulnerability scans. + ImageScanningConfiguration *types.ImageScanningConfiguration + // The image test configuration of the image pipeline. ImageTestsConfiguration *types.ImageTestsConfiguration diff --git a/service/imagebuilder/deserializers.go b/service/imagebuilder/deserializers.go index c1afc3af281..21e9247c453 100644 --- a/service/imagebuilder/deserializers.go +++ b/service/imagebuilder/deserializers.go @@ -13,8 +13,10 @@ import ( smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" + "math" "strings" ) @@ -4732,14 +4734,14 @@ func awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(v ** return nil } -type awsRestjson1_deserializeOpImportComponent struct { +type awsRestjson1_deserializeOpGetWorkflowExecution struct { } -func (*awsRestjson1_deserializeOpImportComponent) ID() string { +func (*awsRestjson1_deserializeOpGetWorkflowExecution) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetWorkflowExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4753,9 +4755,9 @@ func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorImportComponent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetWorkflowExecution(response, &metadata) } - output := &ImportComponentOutput{} + output := &GetWorkflowExecutionOutput{} out.Result = output var buff [1024]byte @@ -4776,7 +4778,7 @@ func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentImportComponentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetWorkflowExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4789,7 +4791,7 @@ func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetWorkflowExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4839,21 +4841,9 @@ func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Respons case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - - case strings.EqualFold("InvalidParameterCombinationException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidVersionNumberException", errorCode): - return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -4870,7 +4860,7 @@ func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetWorkflowExecutionOutput(v **GetWorkflowExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4883,31 +4873,40 @@ func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ImportComponentOutput + var sv *GetWorkflowExecutionOutput if *v == nil { - sv = &ImportComponentOutput{} + sv = &GetWorkflowExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": + case "endTime": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.ClientToken = ptr.String(jtv) + sv.EndTime = ptr.String(jtv) } - case "componentBuildVersionArn": + case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.ComponentBuildVersionArn = ptr.String(jtv) + sv.ImageBuildVersionArn = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowExecutionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } case "requestId": @@ -4919,6 +4918,103 @@ func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponent sv.RequestId = ptr.String(jtv) } + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.StartTime = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowExecutionStatus to be of type string, got %T instead", value) + } + sv.Status = types.WorkflowExecutionStatus(jtv) + } + + case "totalStepCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepCount = int32(i64) + } + + case "totalStepsFailed": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepsFailed = int32(i64) + } + + case "totalStepsSkipped": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepsSkipped = int32(i64) + } + + case "totalStepsSucceeded": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepsSucceeded = int32(i64) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowType to be of type string, got %T instead", value) + } + sv.Type = types.WorkflowType(jtv) + } + + case "workflowBuildVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) + } + sv.WorkflowBuildVersionArn = ptr.String(jtv) + } + + case "workflowExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) + } + sv.WorkflowExecutionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -4928,14 +5024,14 @@ func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponent return nil } -type awsRestjson1_deserializeOpImportVmImage struct { +type awsRestjson1_deserializeOpGetWorkflowStepExecution struct { } -func (*awsRestjson1_deserializeOpImportVmImage) ID() string { +func (*awsRestjson1_deserializeOpGetWorkflowStepExecution) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpImportVmImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetWorkflowStepExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4949,9 +5045,9 @@ func (m *awsRestjson1_deserializeOpImportVmImage) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorImportVmImage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetWorkflowStepExecution(response, &metadata) } - output := &ImportVmImageOutput{} + output := &GetWorkflowStepExecutionOutput{} out.Result = output var buff [1024]byte @@ -4972,7 +5068,7 @@ func (m *awsRestjson1_deserializeOpImportVmImage) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentImportVmImageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetWorkflowStepExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4985,7 +5081,7 @@ func (m *awsRestjson1_deserializeOpImportVmImage) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorImportVmImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetWorkflowStepExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5026,9 +5122,18 @@ func awsRestjson1_deserializeOpErrorImportVmImage(response *smithyhttp.Response, } switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -5045,7 +5150,7 @@ func awsRestjson1_deserializeOpErrorImportVmImage(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentImportVmImageOutput(v **ImportVmImageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetWorkflowStepExecutionOutput(v **GetWorkflowStepExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5058,31 +5163,94 @@ func awsRestjson1_deserializeOpDocumentImportVmImageOutput(v **ImportVmImageOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ImportVmImageOutput + var sv *GetWorkflowStepExecutionOutput if *v == nil { - sv = &ImportVmImageOutput{} + sv = &GetWorkflowStepExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": + case "action": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkflowStepAction to be of type string, got %T instead", value) } - sv.ClientToken = ptr.String(jtv) + sv.Action = ptr.String(jtv) } - case "imageArn": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkflowStepDescription to be of type string, got %T instead", value) } - sv.ImageArn = ptr.String(jtv) + sv.Description = ptr.String(jtv) + } + + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.EndTime = ptr.String(jtv) + } + + case "imageBuildVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) + } + sv.ImageBuildVersionArn = ptr.String(jtv) + } + + case "inputs": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepInputs to be of type string, got %T instead", value) + } + sv.Inputs = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "onFailure": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.OnFailure = ptr.String(jtv) + } + + case "outputs": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepOutputs to be of type string, got %T instead", value) + } + sv.Outputs = ptr.String(jtv) } case "requestId": @@ -5094,6 +5262,73 @@ func awsRestjson1_deserializeOpDocumentImportVmImageOutput(v **ImportVmImageOutp sv.RequestId = ptr.String(jtv) } + case "rollbackStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepExecutionRollbackStatus to be of type string, got %T instead", value) + } + sv.RollbackStatus = types.WorkflowStepExecutionRollbackStatus(jtv) + } + + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.StartTime = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepExecutionStatus to be of type string, got %T instead", value) + } + sv.Status = types.WorkflowStepExecutionStatus(jtv) + } + + case "stepExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepExecutionId to be of type string, got %T instead", value) + } + sv.StepExecutionId = ptr.String(jtv) + } + + case "timeoutSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepTimeoutSecondsInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimeoutSeconds = ptr.Int32(int32(i64)) + } + + case "workflowBuildVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) + } + sv.WorkflowBuildVersionArn = ptr.String(jtv) + } + + case "workflowExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) + } + sv.WorkflowExecutionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -5103,14 +5338,14 @@ func awsRestjson1_deserializeOpDocumentImportVmImageOutput(v **ImportVmImageOutp return nil } -type awsRestjson1_deserializeOpListComponentBuildVersions struct { +type awsRestjson1_deserializeOpImportComponent struct { } -func (*awsRestjson1_deserializeOpListComponentBuildVersions) ID() string { +func (*awsRestjson1_deserializeOpImportComponent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5124,9 +5359,9 @@ func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListComponentBuildVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorImportComponent(response, &metadata) } - output := &ListComponentBuildVersionsOutput{} + output := &ImportComponentOutput{} out.Result = output var buff [1024]byte @@ -5147,7 +5382,7 @@ func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentImportComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5160,7 +5395,7 @@ func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5210,12 +5445,21 @@ func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyh case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidPaginationTokenException", errorCode): - return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) - + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidParameterCombinationException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidVersionNumberException", errorCode): + return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -5232,7 +5476,7 @@ func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyh } } -func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **ListComponentBuildVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5245,27 +5489,31 @@ func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **List return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListComponentBuildVersionsOutput + var sv *ImportComponentOutput if *v == nil { - sv = &ListComponentBuildVersionsOutput{} + sv = &ImportComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentSummaryList": - if err := awsRestjson1_deserializeDocumentComponentSummaryList(&sv.ComponentSummaryList, value); err != nil { - return err + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) } - case "nextToken": + case "componentBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ComponentBuildVersionArn = ptr.String(jtv) } case "requestId": @@ -5286,14 +5534,14 @@ func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **List return nil } -type awsRestjson1_deserializeOpListComponents struct { +type awsRestjson1_deserializeOpImportVmImage struct { } -func (*awsRestjson1_deserializeOpListComponents) ID() string { +func (*awsRestjson1_deserializeOpImportVmImage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpImportVmImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5307,9 +5555,9 @@ func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListComponents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorImportVmImage(response, &metadata) } - output := &ListComponentsOutput{} + output := &ImportVmImageOutput{} out.Result = output var buff [1024]byte @@ -5330,7 +5578,7 @@ func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListComponentsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentImportVmImageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5343,7 +5591,7 @@ func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorImportVmImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5384,21 +5632,9 @@ func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response } switch { - case strings.EqualFold("CallRateLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ForbiddenException", errorCode): - return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - - case strings.EqualFold("InvalidPaginationTokenException", errorCode): - return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -5415,7 +5651,7 @@ func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentImportVmImageOutput(v **ImportVmImageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5428,27 +5664,31 @@ func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListComponentsOutput + var sv *ImportVmImageOutput if *v == nil { - sv = &ListComponentsOutput{} + sv = &ImportVmImageOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentVersionList": - if err := awsRestjson1_deserializeDocumentComponentVersionList(&sv.ComponentVersionList, value); err != nil { - return err + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) } - case "nextToken": + case "imageArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ImageArn = ptr.String(jtv) } case "requestId": @@ -5469,14 +5709,14 @@ func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOu return nil } -type awsRestjson1_deserializeOpListContainerRecipes struct { +type awsRestjson1_deserializeOpListComponentBuildVersions struct { } -func (*awsRestjson1_deserializeOpListContainerRecipes) ID() string { +func (*awsRestjson1_deserializeOpListComponentBuildVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListContainerRecipes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5490,9 +5730,9 @@ func (m *awsRestjson1_deserializeOpListContainerRecipes) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListContainerRecipes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListComponentBuildVersions(response, &metadata) } - output := &ListContainerRecipesOutput{} + output := &ListComponentBuildVersionsOutput{} out.Result = output var buff [1024]byte @@ -5513,7 +5753,7 @@ func (m *awsRestjson1_deserializeOpListContainerRecipes) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5526,7 +5766,7 @@ func (m *awsRestjson1_deserializeOpListContainerRecipes) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListContainerRecipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5598,7 +5838,7 @@ func awsRestjson1_deserializeOpErrorListContainerRecipes(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContainerRecipesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **ListComponentBuildVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5611,17 +5851,17 @@ func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListContainerRecipesOutput + var sv *ListComponentBuildVersionsOutput if *v == nil { - sv = &ListContainerRecipesOutput{} + sv = &ListComponentBuildVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "containerRecipeSummaryList": - if err := awsRestjson1_deserializeDocumentContainerRecipeSummaryList(&sv.ContainerRecipeSummaryList, value); err != nil { + case "componentSummaryList": + if err := awsRestjson1_deserializeDocumentComponentSummaryList(&sv.ComponentSummaryList, value); err != nil { return err } @@ -5629,7 +5869,7 @@ func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContai if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -5652,14 +5892,14 @@ func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContai return nil } -type awsRestjson1_deserializeOpListDistributionConfigurations struct { +type awsRestjson1_deserializeOpListComponents struct { } -func (*awsRestjson1_deserializeOpListDistributionConfigurations) ID() string { +func (*awsRestjson1_deserializeOpListComponents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5673,9 +5913,9 @@ func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDistributionConfigurations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListComponents(response, &metadata) } - output := &ListDistributionConfigurationsOutput{} + output := &ListComponentsOutput{} out.Result = output var buff [1024]byte @@ -5696,7 +5936,7 @@ func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListComponentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5709,7 +5949,7 @@ func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDistributionConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5781,7 +6021,7 @@ func awsRestjson1_deserializeOpErrorListDistributionConfigurations(response *smi } } -func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v **ListDistributionConfigurationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5794,17 +6034,17 @@ func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDistributionConfigurationsOutput + var sv *ListComponentsOutput if *v == nil { - sv = &ListDistributionConfigurationsOutput{} + sv = &ListComponentsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "distributionConfigurationSummaryList": - if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(&sv.DistributionConfigurationSummaryList, value); err != nil { + case "componentVersionList": + if err := awsRestjson1_deserializeDocumentComponentVersionList(&sv.ComponentVersionList, value); err != nil { return err } @@ -5835,14 +6075,14 @@ func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v ** return nil } -type awsRestjson1_deserializeOpListImageBuildVersions struct { +type awsRestjson1_deserializeOpListContainerRecipes struct { } -func (*awsRestjson1_deserializeOpListImageBuildVersions) ID() string { +func (*awsRestjson1_deserializeOpListContainerRecipes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListContainerRecipes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5856,9 +6096,9 @@ func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImageBuildVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListContainerRecipes(response, &metadata) } - output := &ListImageBuildVersionsOutput{} + output := &ListContainerRecipesOutput{} out.Result = output var buff [1024]byte @@ -5879,7 +6119,7 @@ func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5892,7 +6132,7 @@ func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImageBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListContainerRecipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5964,7 +6204,7 @@ func awsRestjson1_deserializeOpErrorListImageBuildVersions(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImageBuildVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContainerRecipesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5977,17 +6217,17 @@ func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImag return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImageBuildVersionsOutput + var sv *ListContainerRecipesOutput if *v == nil { - sv = &ListImageBuildVersionsOutput{} + sv = &ListContainerRecipesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageSummaryList": - if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { + case "containerRecipeSummaryList": + if err := awsRestjson1_deserializeDocumentContainerRecipeSummaryList(&sv.ContainerRecipeSummaryList, value); err != nil { return err } @@ -5995,7 +6235,7 @@ func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImag if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -6018,14 +6258,14 @@ func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImag return nil } -type awsRestjson1_deserializeOpListImagePackages struct { +type awsRestjson1_deserializeOpListDistributionConfigurations struct { } -func (*awsRestjson1_deserializeOpListImagePackages) ID() string { +func (*awsRestjson1_deserializeOpListDistributionConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImagePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6039,9 +6279,9 @@ func (m *awsRestjson1_deserializeOpListImagePackages) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImagePackages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDistributionConfigurations(response, &metadata) } - output := &ListImagePackagesOutput{} + output := &ListDistributionConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -6062,7 +6302,7 @@ func (m *awsRestjson1_deserializeOpListImagePackages) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImagePackagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6075,7 +6315,7 @@ func (m *awsRestjson1_deserializeOpListImagePackages) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImagePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDistributionConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6131,9 +6371,6 @@ func awsRestjson1_deserializeOpErrorListImagePackages(response *smithyhttp.Respo case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -6150,7 +6387,7 @@ func awsRestjson1_deserializeOpErrorListImagePackages(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListImagePackagesOutput(v **ListImagePackagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v **ListDistributionConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6163,17 +6400,17 @@ func awsRestjson1_deserializeOpDocumentListImagePackagesOutput(v **ListImagePack return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImagePackagesOutput + var sv *ListDistributionConfigurationsOutput if *v == nil { - sv = &ListImagePackagesOutput{} + sv = &ListDistributionConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imagePackageList": - if err := awsRestjson1_deserializeDocumentImagePackageList(&sv.ImagePackageList, value); err != nil { + case "distributionConfigurationSummaryList": + if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(&sv.DistributionConfigurationSummaryList, value); err != nil { return err } @@ -6204,14 +6441,14 @@ func awsRestjson1_deserializeOpDocumentListImagePackagesOutput(v **ListImagePack return nil } -type awsRestjson1_deserializeOpListImagePipelineImages struct { +type awsRestjson1_deserializeOpListImageBuildVersions struct { } -func (*awsRestjson1_deserializeOpListImagePipelineImages) ID() string { +func (*awsRestjson1_deserializeOpListImageBuildVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6225,9 +6462,9 @@ func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelineImages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImageBuildVersions(response, &metadata) } - output := &ListImagePipelineImagesOutput{} + output := &ListImageBuildVersionsOutput{} out.Result = output var buff [1024]byte @@ -6248,7 +6485,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6261,7 +6498,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImageBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6317,9 +6554,6 @@ func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -6336,7 +6570,7 @@ func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListImagePipelineImagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImageBuildVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6349,9 +6583,9 @@ func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListIma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImagePipelineImagesOutput + var sv *ListImageBuildVersionsOutput if *v == nil { - sv = &ListImagePipelineImagesOutput{} + sv = &ListImageBuildVersionsOutput{} } else { sv = *v } @@ -6390,14 +6624,14 @@ func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListIma return nil } -type awsRestjson1_deserializeOpListImagePipelines struct { +type awsRestjson1_deserializeOpListImagePackages struct { } -func (*awsRestjson1_deserializeOpListImagePipelines) ID() string { +func (*awsRestjson1_deserializeOpListImagePackages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImagePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6411,9 +6645,9 @@ func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelines(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImagePackages(response, &metadata) } - output := &ListImagePipelinesOutput{} + output := &ListImagePackagesOutput{} out.Result = output var buff [1024]byte @@ -6434,7 +6668,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImagePackagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6447,7 +6681,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImagePipelines(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImagePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6503,6 +6737,9 @@ func awsRestjson1_deserializeOpErrorListImagePipelines(response *smithyhttp.Resp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -6519,7 +6756,7 @@ func awsRestjson1_deserializeOpErrorListImagePipelines(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePipelinesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImagePackagesOutput(v **ListImagePackagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6532,17 +6769,17 @@ func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePip return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImagePipelinesOutput + var sv *ListImagePackagesOutput if *v == nil { - sv = &ListImagePipelinesOutput{} + sv = &ListImagePackagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imagePipelineList": - if err := awsRestjson1_deserializeDocumentImagePipelineList(&sv.ImagePipelineList, value); err != nil { + case "imagePackageList": + if err := awsRestjson1_deserializeDocumentImagePackageList(&sv.ImagePackageList, value); err != nil { return err } @@ -6573,14 +6810,14 @@ func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePip return nil } -type awsRestjson1_deserializeOpListImageRecipes struct { +type awsRestjson1_deserializeOpListImagePipelineImages struct { } -func (*awsRestjson1_deserializeOpListImageRecipes) ID() string { +func (*awsRestjson1_deserializeOpListImagePipelineImages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6594,9 +6831,9 @@ func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImageRecipes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelineImages(response, &metadata) } - output := &ListImageRecipesOutput{} + output := &ListImagePipelineImagesOutput{} out.Result = output var buff [1024]byte @@ -6617,7 +6854,7 @@ func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImageRecipesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6630,7 +6867,7 @@ func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImageRecipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6686,6 +6923,9 @@ func awsRestjson1_deserializeOpErrorListImageRecipes(response *smithyhttp.Respon case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -6702,7 +6942,7 @@ func awsRestjson1_deserializeOpErrorListImageRecipes(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecipesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListImagePipelineImagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6715,17 +6955,17 @@ func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecip return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImageRecipesOutput + var sv *ListImagePipelineImagesOutput if *v == nil { - sv = &ListImageRecipesOutput{} + sv = &ListImagePipelineImagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageRecipeSummaryList": - if err := awsRestjson1_deserializeDocumentImageRecipeSummaryList(&sv.ImageRecipeSummaryList, value); err != nil { + case "imageSummaryList": + if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { return err } @@ -6756,14 +6996,14 @@ func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecip return nil } -type awsRestjson1_deserializeOpListImages struct { +type awsRestjson1_deserializeOpListImagePipelines struct { } -func (*awsRestjson1_deserializeOpListImages) ID() string { +func (*awsRestjson1_deserializeOpListImagePipelines) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6777,9 +7017,9 @@ func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelines(response, &metadata) } - output := &ListImagesOutput{} + output := &ListImagePipelinesOutput{} out.Result = output var buff [1024]byte @@ -6800,7 +7040,7 @@ func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6813,7 +7053,7 @@ func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImagePipelines(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6885,7 +7125,7 @@ func awsRestjson1_deserializeOpErrorListImages(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePipelinesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6898,17 +7138,17 @@ func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImagesOutput + var sv *ListImagePipelinesOutput if *v == nil { - sv = &ListImagesOutput{} + sv = &ListImagePipelinesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageVersionList": - if err := awsRestjson1_deserializeDocumentImageVersionList(&sv.ImageVersionList, value); err != nil { + case "imagePipelineList": + if err := awsRestjson1_deserializeDocumentImagePipelineList(&sv.ImagePipelineList, value); err != nil { return err } @@ -6939,14 +7179,14 @@ func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, va return nil } -type awsRestjson1_deserializeOpListInfrastructureConfigurations struct { +type awsRestjson1_deserializeOpListImageRecipes struct { } -func (*awsRestjson1_deserializeOpListInfrastructureConfigurations) ID() string { +func (*awsRestjson1_deserializeOpListImageRecipes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6960,9 +7200,9 @@ func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImageRecipes(response, &metadata) } - output := &ListInfrastructureConfigurationsOutput{} + output := &ListImageRecipesOutput{} out.Result = output var buff [1024]byte @@ -6983,7 +7223,7 @@ func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImageRecipesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6996,7 +7236,7 @@ func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImageRecipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7068,7 +7308,7 @@ func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response *s } } -func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v **ListInfrastructureConfigurationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecipesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7081,17 +7321,17 @@ func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInfrastructureConfigurationsOutput + var sv *ListImageRecipesOutput if *v == nil { - sv = &ListInfrastructureConfigurationsOutput{} + sv = &ListImageRecipesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "infrastructureConfigurationSummaryList": - if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(&sv.InfrastructureConfigurationSummaryList, value); err != nil { + case "imageRecipeSummaryList": + if err := awsRestjson1_deserializeDocumentImageRecipeSummaryList(&sv.ImageRecipeSummaryList, value); err != nil { return err } @@ -7122,14 +7362,14 @@ func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListImages struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListImages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7143,9 +7383,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImages(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListImagesOutput{} out.Result = output var buff [1024]byte @@ -7166,7 +7406,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7179,7 +7419,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7220,15 +7460,27 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7239,7 +7491,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7252,20 +7504,38 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListImagesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListImagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "imageVersionList": + if err := awsRestjson1_deserializeDocumentImageVersionList(&sv.ImageVersionList, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + default: _, _ = key, value @@ -7275,14 +7545,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpPutComponentPolicy struct { +type awsRestjson1_deserializeOpListImageScanFindingAggregations struct { } -func (*awsRestjson1_deserializeOpPutComponentPolicy) ID() string { +func (*awsRestjson1_deserializeOpListImageScanFindingAggregations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImageScanFindingAggregations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7296,9 +7566,9 @@ func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutComponentPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImageScanFindingAggregations(response, &metadata) } - output := &PutComponentPolicyOutput{} + output := &ListImageScanFindingAggregationsOutput{} out.Result = output var buff [1024]byte @@ -7319,7 +7589,7 @@ func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImageScanFindingAggregationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7332,7 +7602,7 @@ func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImageScanFindingAggregations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7382,15 +7652,12 @@ func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Resp case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidParameterValueException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -7407,7 +7674,7 @@ func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponentPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImageScanFindingAggregationsOutput(v **ListImageScanFindingAggregationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7420,22 +7687,31 @@ func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutComponentPolicyOutput + var sv *ListImageScanFindingAggregationsOutput if *v == nil { - sv = &PutComponentPolicyOutput{} + sv = &ListImageScanFindingAggregationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentArn": + case "aggregationType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ComponentArn = ptr.String(jtv) + sv.AggregationType = ptr.String(jtv) + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) } case "requestId": @@ -7447,6 +7723,11 @@ func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponent sv.RequestId = ptr.String(jtv) } + case "responses": + if err := awsRestjson1_deserializeDocumentImageScanFindingAggregationsList(&sv.Responses, value); err != nil { + return err + } + default: _, _ = key, value @@ -7456,14 +7737,14 @@ func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponent return nil } -type awsRestjson1_deserializeOpPutContainerRecipePolicy struct { +type awsRestjson1_deserializeOpListImageScanFindings struct { } -func (*awsRestjson1_deserializeOpPutContainerRecipePolicy) ID() string { +func (*awsRestjson1_deserializeOpListImageScanFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImageScanFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7477,9 +7758,9 @@ func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImageScanFindings(response, &metadata) } - output := &PutContainerRecipePolicyOutput{} + output := &ListImageScanFindingsOutput{} out.Result = output var buff [1024]byte @@ -7500,7 +7781,7 @@ func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImageScanFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7513,7 +7794,7 @@ func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImageScanFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7563,15 +7844,12 @@ func awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response *smithyhtt case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidParameterValueException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -7588,7 +7866,7 @@ func awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(v **PutContainerRecipePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImageScanFindingsOutput(v **ListImageScanFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7601,22 +7879,27 @@ func awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(v **PutCon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutContainerRecipePolicyOutput + var sv *ListImageScanFindingsOutput if *v == nil { - sv = &PutContainerRecipePolicyOutput{} + sv = &ListImageScanFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "containerRecipeArn": + case "findings": + if err := awsRestjson1_deserializeDocumentImageScanFindingsList(&sv.Findings, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } - sv.ContainerRecipeArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } case "requestId": @@ -7637,14 +7920,14 @@ func awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(v **PutCon return nil } -type awsRestjson1_deserializeOpPutImagePolicy struct { +type awsRestjson1_deserializeOpListInfrastructureConfigurations struct { } -func (*awsRestjson1_deserializeOpPutImagePolicy) ID() string { +func (*awsRestjson1_deserializeOpListInfrastructureConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7658,9 +7941,9 @@ func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutImagePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response, &metadata) } - output := &PutImagePolicyOutput{} + output := &ListInfrastructureConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -7681,7 +7964,7 @@ func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7694,7 +7977,7 @@ func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7744,15 +8027,12 @@ func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidParameterValueException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -7769,7 +8049,7 @@ func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v **ListInfrastructureConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7782,22 +8062,27 @@ func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutImagePolicyOutput + var sv *ListInfrastructureConfigurationsOutput if *v == nil { - sv = &PutImagePolicyOutput{} + sv = &ListInfrastructureConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageArn": + case "infrastructureConfigurationSummaryList": + if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(&sv.InfrastructureConfigurationSummaryList, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } - sv.ImageArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } case "requestId": @@ -7818,14 +8103,14 @@ func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOu return nil } -type awsRestjson1_deserializeOpPutImageRecipePolicy struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpPutImageRecipePolicy) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7839,9 +8124,9 @@ func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutImageRecipePolicyOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -7862,7 +8147,7 @@ func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7875,7 +8160,7 @@ func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7916,20 +8201,8 @@ func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Re } switch { - case strings.EqualFold("CallRateLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("ForbiddenException", errorCode): - return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - - case strings.EqualFold("InvalidParameterValueException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -7937,9 +8210,6 @@ func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Re case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7950,7 +8220,7 @@ func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRecipePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7963,31 +8233,18 @@ func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutImageRecipePolicyOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &PutImageRecipePolicyOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageRecipeArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) - } - sv.ImageRecipeArn = ptr.String(jtv) - } - - case "requestId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.RequestId = ptr.String(jtv) + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -7999,14 +8256,14 @@ func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRe return nil } -type awsRestjson1_deserializeOpStartImagePipelineExecution struct { +type awsRestjson1_deserializeOpListWorkflowExecutions struct { } -func (*awsRestjson1_deserializeOpStartImagePipelineExecution) ID() string { +func (*awsRestjson1_deserializeOpListWorkflowExecutions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListWorkflowExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8020,9 +8277,9 @@ func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListWorkflowExecutions(response, &metadata) } - output := &StartImagePipelineExecutionOutput{} + output := &ListWorkflowExecutionsOutput{} out.Result = output var buff [1024]byte @@ -8043,7 +8300,7 @@ func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListWorkflowExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8056,7 +8313,7 @@ func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListWorkflowExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8106,18 +8363,12 @@ func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithy case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -8134,7 +8385,7 @@ func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithy } } -func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **StartImagePipelineExecutionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListWorkflowExecutionsOutput(v **ListWorkflowExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8147,31 +8398,40 @@ func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **Sta return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartImagePipelineExecutionOutput + var sv *ListWorkflowExecutionsOutput if *v == nil { - sv = &StartImagePipelineExecutionOutput{} + sv = &ListWorkflowExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": + case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.ClientToken = ptr.String(jtv) + sv.ImageBuildVersionArn = ptr.String(jtv) } - case "imageBuildVersionArn": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildMessage to be of type string, got %T instead", value) } - sv.ImageBuildVersionArn = ptr.String(jtv) + sv.Message = ptr.String(jtv) + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) } case "requestId": @@ -8183,6 +8443,11 @@ func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **Sta sv.RequestId = ptr.String(jtv) } + case "workflowExecutions": + if err := awsRestjson1_deserializeDocumentWorkflowExecutionsList(&sv.WorkflowExecutions, value); err != nil { + return err + } + default: _, _ = key, value @@ -8192,14 +8457,14 @@ func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **Sta return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpListWorkflowStepExecutions struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpListWorkflowStepExecutions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListWorkflowStepExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8213,15 +8478,43 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListWorkflowStepExecutions(response, &metadata) } - output := &TagResourceOutput{} + output := &ListWorkflowStepExecutionsOutput{} 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_deserializeOpDocumentListWorkflowStepExecutionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListWorkflowStepExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8262,15 +8555,27 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8281,103 +8586,104 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -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 +func awsRestjson1_deserializeOpDocumentListWorkflowStepExecutionsOutput(v **ListWorkflowStepExecutionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + if value == nil { + return nil } - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - 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)} + var sv *ListWorkflowStepExecutionsOutput + if *v == nil { + sv = &ListWorkflowStepExecutionsOutput{} + } else { + sv = *v } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - errorCode := "UnknownError" - errorMessage := errorCode + for key, value := range shape { + switch key { + case "imageBuildVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) + } + sv.ImageBuildVersionArn = ptr.String(jtv) + } - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuildMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } + case "steps": + if err := awsRestjson1_deserializeDocumentWorkflowStepExecutionsList(&sv.Steps, value); err != nil { + return err + } - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case "workflowBuildVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) + } + sv.WorkflowBuildVersionArn = ptr.String(jtv) + } - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case "workflowExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) + } + sv.WorkflowExecutionId = ptr.String(jtv) + } - case strings.EqualFold("ServiceException", errorCode): - return awsRestjson1_deserializeErrorServiceException(response, errorBody) + default: + _, _ = key, value - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, } - return genericError - } + *v = sv + return nil } -type awsRestjson1_deserializeOpUpdateDistributionConfiguration struct { +type awsRestjson1_deserializeOpPutComponentPolicy struct { } -func (*awsRestjson1_deserializeOpUpdateDistributionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpPutComponentPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8391,9 +8697,9 @@ func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutComponentPolicy(response, &metadata) } - output := &UpdateDistributionConfigurationOutput{} + output := &PutComponentPolicyOutput{} out.Result = output var buff [1024]byte @@ -8414,7 +8720,7 @@ func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8427,7 +8733,7 @@ func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8477,17 +8783,14 @@ func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response *sm case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - - case strings.EqualFold("InvalidParameterCombinationException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -8505,7 +8808,7 @@ func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response *sm } } -func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v **UpdateDistributionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponentPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8518,31 +8821,22 @@ func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateDistributionConfigurationOutput + var sv *PutComponentPolicyOutput if *v == nil { - sv = &UpdateDistributionConfigurationOutput{} + sv = &PutComponentPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) - } - sv.ClientToken = ptr.String(jtv) - } - - case "distributionConfigurationArn": + case "componentArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) } - sv.DistributionConfigurationArn = ptr.String(jtv) + sv.ComponentArn = ptr.String(jtv) } case "requestId": @@ -8563,14 +8857,14 @@ func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v * return nil } -type awsRestjson1_deserializeOpUpdateImagePipeline struct { +type awsRestjson1_deserializeOpPutContainerRecipePolicy struct { } -func (*awsRestjson1_deserializeOpUpdateImagePipeline) ID() string { +func (*awsRestjson1_deserializeOpPutContainerRecipePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8584,9 +8878,9 @@ func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateImagePipeline(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response, &metadata) } - output := &UpdateImagePipelineOutput{} + output := &PutContainerRecipePolicyOutput{} out.Result = output var buff [1024]byte @@ -8607,7 +8901,7 @@ func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8620,7 +8914,7 @@ func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8670,14 +8964,14 @@ func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Res case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -8695,7 +8989,7 @@ func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImagePipelineOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(v **PutContainerRecipePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8708,31 +9002,22 @@ func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImage return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateImagePipelineOutput + var sv *PutContainerRecipePolicyOutput if *v == nil { - sv = &UpdateImagePipelineOutput{} + sv = &PutContainerRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) - } - sv.ClientToken = ptr.String(jtv) - } - - case "imagePipelineArn": + case "containerRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) } - sv.ImagePipelineArn = ptr.String(jtv) + sv.ContainerRecipeArn = ptr.String(jtv) } case "requestId": @@ -8753,14 +9038,14 @@ func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImage return nil } -type awsRestjson1_deserializeOpUpdateInfrastructureConfiguration struct { +type awsRestjson1_deserializeOpPutImagePolicy struct { } -func (*awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) ID() string { +func (*awsRestjson1_deserializeOpPutImagePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8774,9 +9059,9 @@ func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutImagePolicy(response, &metadata) } - output := &UpdateInfrastructureConfigurationOutput{} + output := &PutImagePolicyOutput{} out.Result = output var buff [1024]byte @@ -8797,7 +9082,7 @@ func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8810,7 +9095,7 @@ func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8860,14 +9145,14 @@ func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response * case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -8885,7 +9170,7 @@ func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v **UpdateInfrastructureConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8898,31 +9183,22 @@ func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateInfrastructureConfigurationOutput + var sv *PutImagePolicyOutput if *v == nil { - sv = &UpdateInfrastructureConfigurationOutput{} + sv = &PutImagePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) - } - sv.ClientToken = ptr.String(jtv) - } - - case "infrastructureConfigurationArn": + case "imageArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.InfrastructureConfigurationArn = ptr.String(jtv) + sv.ImageArn = ptr.String(jtv) } case "requestId": @@ -8943,48 +9219,37 @@ func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v return nil } -func awsRestjson1_deserializeErrorCallRateLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.CallRateLimitExceededException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } +type awsRestjson1_deserializeOpPutImageRecipePolicy struct { +} - err := awsRestjson1_deserializeDocumentCallRateLimitExceededException(&output, shape) +func (*awsRestjson1_deserializeOpPutImageRecipePolicy) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response, &metadata) + } + output := &PutImageRecipePolicyOutput{} + out.Result = output -func awsRestjson1_deserializeErrorClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ClientException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -8995,83 +9260,44 @@ func awsRestjson1_deserializeErrorClientException(response *smithyhttp.Response, Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentClientException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ForbiddenException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err +func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IdempotentParameterMismatchException{} 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_deserializeDocumentIdempotentParameterMismatchException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9083,124 +9309,128 @@ func awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} - -func awsRestjson1_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidPaginationTokenException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) - err := awsRestjson1_deserializeDocumentInvalidPaginationTokenException(&output, shape) + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) - errorBody.Seek(0, io.SeekStart) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - return output -} + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) -func awsRestjson1_deserializeErrorInvalidParameterCombinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterCombinationException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - err := awsRestjson1_deserializeDocumentInvalidParameterCombinationException(&output, shape) +func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRecipePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) + var sv *PutImageRecipePolicyOutput + if *v == nil { + sv = &PutImageRecipePolicyOutput{} + } else { + sv = *v + } - return output -} + for key, value := range shape { + switch key { + case "imageRecipeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) + } + sv.ImageRecipeArn = ptr.String(jtv) + } -func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value - 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 } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentInvalidParameterException(&output, shape) +type awsRestjson1_deserializeOpStartImagePipelineExecution struct { +} + +func (*awsRestjson1_deserializeOpStartImagePipelineExecution) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response, &metadata) + } + output := &StartImagePipelineExecutionOutput{} + out.Result = output -func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterValueException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -9211,83 +9441,44 @@ func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smith Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentInvalidParameterValueException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err +func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInvalidVersionNumberException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidVersionNumberException{} 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_deserializeDocumentInvalidVersionNumberException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9299,92 +9490,161 @@ func awsRestjson1_deserializeErrorInvalidVersionNumberException(response *smithy } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) -func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceAlreadyExistsException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape) +func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **StartImagePipelineExecutionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) + var sv *StartImagePipelineExecutionOutput + if *v == nil { + sv = &StartImagePipelineExecutionOutput{} + } else { + sv = *v + } - return output -} + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } -func awsRestjson1_deserializeErrorResourceDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceDependencyException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "imageBuildVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) + } + sv.ImageBuildVersionArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value - 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 } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentResourceDependencyException(&output, shape) +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 { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err } -func awsRestjson1_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceInUseException{} +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -9394,33 +9654,86 @@ func awsRestjson1_deserializeErrorResourceInUseException(response *smithyhttp.Re return err } - err := awsRestjson1_deserializeDocumentResourceInUseException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpUntagResource struct { +} - return output +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} +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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -9430,29 +9743,65 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpUpdateDistributionConfiguration struct { +} - return output +func (*awsRestjson1_deserializeOpUpdateDistributionConfiguration) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceException{} +func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateDistributionConfiguration(response, &metadata) + } + output := &UpdateDistributionConfigurationOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -9463,11 +9812,44 @@ func awsRestjson1_deserializeErrorServiceException(response *smithyhttp.Response Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentServiceException(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(&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_deserializeOpErrorUpdateDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9479,16 +9861,140 @@ func awsRestjson1_deserializeErrorServiceException(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - return output + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidParameterCombinationException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} +func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v **UpdateDistributionConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDistributionConfigurationOutput + if *v == nil { + sv = &UpdateDistributionConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "distributionConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) + } + sv.DistributionConfigurationArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateImagePipeline struct { +} + +func (*awsRestjson1_deserializeOpUpdateImagePipeline) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateImagePipeline(response, &metadata) + } + output := &UpdateImagePipelineOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -9499,99 +10005,2487 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImagePipelineOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateImagePipelineOutput + if *v == nil { + sv = &UpdateImagePipelineOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "imagePipelineArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) + } + sv.ImagePipelineArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateInfrastructureConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateInfrastructureConfiguration(response, &metadata) + } + output := &UpdateInfrastructureConfigurationOutput{} + 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_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(&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_deserializeOpErrorUpdateInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v **UpdateInfrastructureConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateInfrastructureConfigurationOutput + if *v == nil { + sv = &UpdateInfrastructureConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "infrastructureConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) + } + sv.InfrastructureConfigurationArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorCallRateLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CallRateLimitExceededException{} + 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_deserializeDocumentCallRateLimitExceededException(&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_deserializeErrorClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ClientException{} + 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_deserializeDocumentClientException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ForbiddenException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IdempotentParameterMismatchException{} + 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_deserializeDocumentIdempotentParameterMismatchException(&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_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidPaginationTokenException{} + 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_deserializeDocumentInvalidPaginationTokenException(&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_deserializeErrorInvalidParameterCombinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterCombinationException{} + 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_deserializeDocumentInvalidParameterCombinationException(&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_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterException{} + 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_deserializeDocumentInvalidParameterException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterValueException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + 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_deserializeDocumentInvalidParameterValueException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidVersionNumberException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidVersionNumberException{} + 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_deserializeDocumentInvalidVersionNumberException(&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_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceAlreadyExistsException{} + 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_deserializeDocumentResourceAlreadyExistsException(&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_deserializeErrorResourceDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceDependencyException{} + 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_deserializeDocumentResourceDependencyException(&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_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceInUseException{} + 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_deserializeDocumentResourceInUseException(&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_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceException{} + 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_deserializeDocumentServiceException(&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_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceUnavailableException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccountAggregation(v **types.AccountAggregation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AccountAggregation + if *v == nil { + sv = &types.AccountAggregation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "severityCounts": + if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountList(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 AccountId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(v **types.AdditionalInstanceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AdditionalInstanceConfiguration + if *v == nil { + sv = &types.AdditionalInstanceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "systemsManagerAgent": + if err := awsRestjson1_deserializeDocumentSystemsManagerAgent(&sv.SystemsManagerAgent, value); err != nil { + return err + } + + case "userDataOverride": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserDataOverride to be of type string, got %T instead", value) + } + sv.UserDataOverride = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Ami + if *v == nil { + sv = &types.Ami{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "image": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Image = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "state": + if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiDistributionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AmiDistributionConfiguration + if *v == nil { + sv = &types.AmiDistributionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "amiTags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.AmiTags, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "launchPermission": + if err := awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(&sv.LaunchPermission, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmiNameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "targetAccountIds": + if err := awsRestjson1_deserializeDocumentAccountList(&sv.TargetAccountIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, 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.Ami + if *v == nil { + cv = []types.Ami{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Ami + destAddr := &col + if err := awsRestjson1_deserializeDocumentAmi(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.CallRateLimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CallRateLimitExceededException + if *v == nil { + sv = &types.CallRateLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ClientException + if *v == nil { + sv = &types.ClientException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Component + if *v == nil { + sv = &types.Component{} + } 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 ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "changeDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ChangeDescription = ptr.String(jtv) + } + + case "data": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentData to be of type string, got %T instead", value) + } + sv.Data = ptr.String(jtv) + } + + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "encrypted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.Encrypted = ptr.Bool(jtv) + } + + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "obfuscate": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Obfuscate = jtv + } + + case "owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentComponentParameterDetailList(&sv.Parameters, value); err != nil { + return err + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) + } + + case "publisher": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Publisher = ptr.String(jtv) + } + + case "state": + if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil { + return err + } + + case "supportedOsVersions": + if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + } + sv.Type = types.ComponentType(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ComponentConfiguration + if *v == nil { + sv = &types.ComponentConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionArnOrBuildVersionArn to be of type string, got %T instead", value) + } + sv.ComponentArn = ptr.String(jtv) + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentComponentParameterList(&sv.Parameters, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.ComponentConfiguration, 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.ComponentConfiguration + if *v == nil { + cv = []types.ComponentConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentParameter(v **types.ComponentParameter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ComponentParameter + if *v == nil { + sv = &types.ComponentParameter{} + } 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 ComponentParameterName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "value": + if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.Value, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentParameterDetail(v **types.ComponentParameterDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ComponentParameterDetail + if *v == nil { + sv = &types.ComponentParameterDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "defaultValue": + if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.DefaultValue, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentParameterDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentParameterName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentParameterType to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentParameterDetailList(v *[]types.ComponentParameterDetail, 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.ComponentParameterDetail + if *v == nil { + cv = []types.ComponentParameterDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentParameterDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentParameterDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentParameterList(v *[]types.ComponentParameter, 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.ComponentParameter + if *v == nil { + cv = []types.ComponentParameter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentParameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentParameter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentParameterValueList(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 ComponentParameterValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentState(v **types.ComponentState, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ComponentState + if *v == nil { + sv = &types.ComponentState{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Reason = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentStatus to be of type string, got %T instead", value) + } + sv.Status = types.ComponentStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ComponentSummary + if *v == nil { + sv = &types.ComponentSummary{} + } 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 ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "changeDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ChangeDescription = ptr.String(jtv) + } + + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "obfuscate": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Obfuscate = jtv + } + + case "owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) + } + + case "publisher": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Publisher = ptr.String(jtv) + } + + case "state": + if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil { + return err + } + + case "supportedOsVersions": + if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + } + sv.Type = types.ComponentType(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentSummaryList(v *[]types.ComponentSummary, 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.ComponentSummary + if *v == nil { + cv = []types.ComponentSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ComponentVersion + if *v == nil { + sv = &types.ComponentVersion{} + } 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 ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) + } + + case "supportedOsVersions": + if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + } + sv.Type = types.ComponentType(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVersion, 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.ComponentVersion + if *v == nil { + cv = []types.ComponentVersion{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentVersion + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentVersion(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentContainer(v **types.Container, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Container + if *v == nil { + sv = &types.Container{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "imageUris": + if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageUris, value); err != nil { + return err + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContainerDistributionConfiguration(v **types.ContainerDistributionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ContainerDistributionConfiguration + if *v == nil { + sv = &types.ContainerDistributionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "containerTags": + if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "targetRepository": + if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContainerList(v *[]types.Container, 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.Container + if *v == nil { + cv = []types.Container{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Container + destAddr := &col + if err := awsRestjson1_deserializeDocumentContainer(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ContainerRecipe + if *v == nil { + sv = &types.ContainerRecipe{} + } 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 ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "components": + if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil { + return err + } + + case "containerType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) + } + sv.ContainerType = types.ContainerType(jtv) + } + + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "dockerfileTemplateData": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DockerFileTemplate to be of type string, got %T instead", value) + } + sv.DockerfileTemplateData = ptr.String(jtv) + } + + case "encrypted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.Encrypted = ptr.Bool(jtv) + } + + case "instanceConfiguration": + if err := awsRestjson1_deserializeDocumentInstanceConfiguration(&sv.InstanceConfiguration, value); err != nil { + return err + } - return output -} + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } -func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceUnavailableException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case "owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } - err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape) + case "parentImage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ParentImage = ptr.String(jtv) + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) + } - errorBody.Seek(0, io.SeekStart) + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } - return output -} + case "targetRepository": + if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { + return err + } -func awsRestjson1_deserializeDocumentAccountList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "workingDirectory": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.WorkingDirectory = ptr.String(jtv) + } - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } + default: + _, _ = key, value - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - col = jtv } - cv = append(cv, col) - } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(v **types.AdditionalInstanceConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentContainerRecipeSummary(v **types.ContainerRecipeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9604,27 +12498,81 @@ func awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(v **types.A return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AdditionalInstanceConfiguration + var sv *types.ContainerRecipeSummary if *v == nil { - sv = &types.AdditionalInstanceConfiguration{} + sv = &types.ContainerRecipeSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "systemsManagerAgent": - if err := awsRestjson1_deserializeDocumentSystemsManagerAgent(&sv.SystemsManagerAgent, value); err != nil { - return err + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) } - case "userDataOverride": + case "containerType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UserDataOverride to be of type string, got %T instead", value) + return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) } - sv.UserDataOverride = ptr.String(jtv) + sv.ContainerType = types.ContainerType(jtv) + } + + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "parentImage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ParentImage = ptr.String(jtv) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -9636,7 +12584,41 @@ func awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(v **types.A return nil } -func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error { +func awsRestjson1_deserializeDocumentContainerRecipeSummaryList(v *[]types.ContainerRecipeSummary, 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.ContainerRecipeSummary + if *v == nil { + cv = []types.ContainerRecipeSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ContainerRecipeSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentContainerRecipeSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCvssScore(v **types.CvssScore, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9649,63 +12631,74 @@ func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Ami + var sv *types.CvssScore if *v == nil { - sv = &types.Ami{} + sv = &types.CvssScore{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "baseScore": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.BaseScore = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.BaseScore = ptr.Float64(f64) + + default: + return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value) - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) } - case "image": + case "scoringVector": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Image = ptr.String(jtv) + sv.ScoringVector = ptr.String(jtv) } - case "name": + case "source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Source = ptr.String(jtv) } - case "region": + case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Region = ptr.String(jtv) - } - - case "state": - if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { - return err + sv.Version = ptr.String(jtv) } default: @@ -9717,7 +12710,7 @@ func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error return nil } -func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiDistributionConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentCvssScoreAdjustment(v **types.CvssScoreAdjustment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9730,55 +12723,31 @@ func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiD return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AmiDistributionConfiguration + var sv *types.CvssScoreAdjustment if *v == nil { - sv = &types.AmiDistributionConfiguration{} + sv = &types.CvssScoreAdjustment{} } else { sv = *v } for key, value := range shape { switch key { - case "amiTags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.AmiTags, value); err != nil { - return err - } - - case "description": + case "metric": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.Metric = ptr.String(jtv) } - case "kmsKeyId": + case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.KmsKeyId = ptr.String(jtv) - } - - case "launchPermission": - if err := awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(&sv.LaunchPermission, value); err != nil { - return err - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AmiNameString to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "targetAccountIds": - if err := awsRestjson1_deserializeDocumentAccountList(&sv.TargetAccountIds, value); err != nil { - return err + sv.Reason = ptr.String(jtv) } default: @@ -9790,7 +12759,7 @@ func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiD return nil } -func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, value interface{}) error { +func awsRestjson1_deserializeDocumentCvssScoreAdjustmentList(v *[]types.CvssScoreAdjustment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9803,17 +12772,17 @@ func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Ami + var cv []types.CvssScoreAdjustment if *v == nil { - cv = []types.Ami{} + cv = []types.CvssScoreAdjustment{} } else { cv = *v } for _, value := range shape { - var col types.Ami + var col types.CvssScoreAdjustment destAddr := &col - if err := awsRestjson1_deserializeDocumentAmi(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentCvssScoreAdjustment(&destAddr, value); err != nil { return err } col = *destAddr @@ -9824,7 +12793,7 @@ func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, value interface{}) return nil } -func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.CallRateLimitExceededException, value interface{}) error { +func awsRestjson1_deserializeDocumentCvssScoreDetails(v **types.CvssScoreDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9837,22 +12806,88 @@ func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.Ca return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CallRateLimitExceededException + var sv *types.CvssScoreDetails if *v == nil { - sv = &types.CallRateLimitExceededException{} + sv = &types.CvssScoreDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "adjustments": + if err := awsRestjson1_deserializeDocumentCvssScoreAdjustmentList(&sv.Adjustments, value); err != nil { + return err + } + + case "cvssSource": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.CvssSource = ptr.String(jtv) + } + + case "score": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Score = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Score = ptr.Float64(f64) + + default: + return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value) + + } + } + + case "scoreSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ScoreSource = ptr.String(jtv) + } + + case "scoringVector": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ScoringVector = ptr.String(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) } default: @@ -9864,7 +12899,7 @@ func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.Ca return nil } -func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, value interface{}) error { +func awsRestjson1_deserializeDocumentCvssScoreList(v *[]types.CvssScore, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9872,39 +12907,33 @@ func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ClientException + var cv []types.CvssScore if *v == nil { - sv = &types.ClientException{} + cv = []types.CvssScore{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.CvssScore + destAddr := &col + if err := awsRestjson1_deserializeDocumentCvssScore(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interface{}) error { +func awsRestjson1_deserializeDocumentDistribution(v **types.Distribution, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9917,136 +12946,133 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Component + var sv *types.Distribution if *v == nil { - sv = &types.Component{} + sv = &types.Distribution{} } 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 ImageBuilderArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "changeDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ChangeDescription = ptr.String(jtv) + case "amiDistributionConfiguration": + if err := awsRestjson1_deserializeDocumentAmiDistributionConfiguration(&sv.AmiDistributionConfiguration, value); err != nil { + return err } - case "data": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentData to be of type string, got %T instead", value) - } - sv.Data = ptr.String(jtv) + case "containerDistributionConfiguration": + if err := awsRestjson1_deserializeDocumentContainerDistributionConfiguration(&sv.ContainerDistributionConfiguration, value); err != nil { + return err } - case "dateCreated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateCreated = ptr.String(jtv) + case "fastLaunchConfigurations": + if err := awsRestjson1_deserializeDocumentFastLaunchConfigurationList(&sv.FastLaunchConfigurations, value); err != nil { + return err } - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) + case "launchTemplateConfigurations": + if err := awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(&sv.LaunchTemplateConfigurations, value); err != nil { + return err } - case "encrypted": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) - } - sv.Encrypted = ptr.Bool(jtv) + case "licenseConfigurationArns": + if err := awsRestjson1_deserializeDocumentLicenseConfigurationArnList(&sv.LicenseConfigurationArns, value); err != nil { + return err } - case "kmsKeyId": + case "region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.KmsKeyId = ptr.String(jtv) + sv.Region = ptr.String(jtv) } - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "s3ExportConfiguration": + if err := awsRestjson1_deserializeDocumentS3ExportConfiguration(&sv.S3ExportConfiguration, value); err != nil { + return err } - case "obfuscate": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.Obfuscate = jtv - } + default: + _, _ = key, value - case "owner": + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDistributionConfiguration(v **types.DistributionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DistributionConfiguration + if *v == nil { + sv = &types.DistributionConfiguration{} + } 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 NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "parameters": - if err := awsRestjson1_deserializeDocumentComponentParameterDetailList(&sv.Parameters, value); err != nil { - return err + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) } - case "platform": + case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.Platform = types.Platform(jtv) + sv.DateUpdated = ptr.String(jtv) } - case "publisher": + case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Publisher = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "state": - if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil { + case "distributions": + if err := awsRestjson1_deserializeDocumentDistributionList(&sv.Distributions, value); err != nil { return err } - case "supportedOsVersions": - if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { - return err + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } case "tags": @@ -10054,22 +13080,17 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf return err } - case "type": + case "timeoutMinutes": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + return fmt.Errorf("expected DistributionTimeoutMinutes to be json.Number, got %T instead", value) } - sv.Type = types.ComponentType(jtv) - } - - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.Version = ptr.String(jtv) + sv.TimeoutMinutes = ptr.Int32(int32(i64)) } default: @@ -10081,7 +13102,7 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf return nil } -func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types.DistributionConfigurationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10094,26 +13115,67 @@ func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentConfiguration + var sv *types.DistributionConfigurationSummary if *v == nil { - sv = &types.ComponentConfiguration{} + sv = &types.DistributionConfigurationSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "componentArn": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentVersionArnOrBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } - sv.ComponentArn = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "parameters": - if err := awsRestjson1_deserializeDocumentComponentParameterList(&sv.Parameters, value); err != nil { + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) + } + + case "dateUpdated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateUpdated = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "regions": + if err := awsRestjson1_deserializeDocumentRegionList(&sv.Regions, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -10126,7 +13188,7 @@ func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentC return nil } -func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.ComponentConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(v *[]types.DistributionConfigurationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10139,17 +13201,17 @@ func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.Compo return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ComponentConfiguration + var cv []types.DistributionConfigurationSummary if *v == nil { - cv = []types.ComponentConfiguration{} + cv = []types.DistributionConfigurationSummary{} } else { cv = *v } for _, value := range shape { - var col types.ComponentConfiguration + var col types.DistributionConfigurationSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentConfiguration(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -10160,7 +13222,7 @@ func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.Compo return nil } -func awsRestjson1_deserializeDocumentComponentParameter(v **types.ComponentParameter, value interface{}) error { +func awsRestjson1_deserializeDocumentDistributionList(v *[]types.Distribution, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10168,44 +13230,33 @@ func awsRestjson1_deserializeDocumentComponentParameter(v **types.ComponentParam return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentParameter + var cv []types.Distribution if *v == nil { - sv = &types.ComponentParameter{} + cv = []types.Distribution{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentParameterName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "value": - if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.Value, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.Distribution + destAddr := &col + if err := awsRestjson1_deserializeDocumentDistribution(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentComponentParameterDetail(v **types.ComponentParameterDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(v **types.EbsInstanceBlockDeviceSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10218,45 +13269,97 @@ func awsRestjson1_deserializeDocumentComponentParameterDetail(v **types.Componen return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentParameterDetail + var sv *types.EbsInstanceBlockDeviceSpecification if *v == nil { - sv = &types.ComponentParameterDetail{} + sv = &types.EbsInstanceBlockDeviceSpecification{} } else { sv = *v } for key, value := range shape { switch key { - case "defaultValue": - if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.DefaultValue, value); err != nil { - return err + case "deleteOnTermination": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.DeleteOnTermination = ptr.Bool(jtv) } - case "description": + case "encrypted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.Encrypted = ptr.Bool(jtv) + } + + case "iops": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EbsIopsInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentParameterDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.KmsKeyId = ptr.String(jtv) } - case "name": + case "snapshotId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentParameterName to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.SnapshotId = ptr.String(jtv) } - case "type": + case "throughput": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EbsVolumeThroughput to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Throughput = ptr.Int32(int32(i64)) + } + + case "volumeSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected EbsVolumeSizeInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VolumeSize = ptr.Int32(int32(i64)) + } + + case "volumeType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentParameterType to be of type string, got %T instead", value) + return fmt.Errorf("expected EbsVolumeType to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.VolumeType = types.EbsVolumeType(jtv) } default: @@ -10268,7 +13371,7 @@ func awsRestjson1_deserializeDocumentComponentParameterDetail(v **types.Componen return nil } -func awsRestjson1_deserializeDocumentComponentParameterDetailList(v *[]types.ComponentParameterDetail, value interface{}) error { +func awsRestjson1_deserializeDocumentEcrConfiguration(v **types.EcrConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10276,33 +13379,44 @@ func awsRestjson1_deserializeDocumentComponentParameterDetailList(v *[]types.Com return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ComponentParameterDetail + var sv *types.EcrConfiguration if *v == nil { - cv = []types.ComponentParameterDetail{} + sv = &types.EcrConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ComponentParameterDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentParameterDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "containerTags": + if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil { + return err + } + + case "repositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentComponentParameterList(v *[]types.ComponentParameter, value interface{}) error { +func awsRestjson1_deserializeDocumentFastLaunchConfiguration(v **types.FastLaunchConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10310,33 +13424,71 @@ func awsRestjson1_deserializeDocumentComponentParameterList(v *[]types.Component return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ComponentParameter + var sv *types.FastLaunchConfiguration if *v == nil { - cv = []types.ComponentParameter{} + sv = &types.FastLaunchConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ComponentParameter - destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentParameter(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + case "launchTemplate": + if err := awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(&sv.LaunchTemplate, value); err != nil { + return err + } + + case "maxParallelLaunches": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaxParallelLaunches to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxParallelLaunches = ptr.Int32(int32(i64)) + } + + case "snapshotConfiguration": + if err := awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(&sv.SnapshotConfiguration, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentComponentParameterValueList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentFastLaunchConfigurationList(v *[]types.FastLaunchConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10349,22 +13501,20 @@ func awsRestjson1_deserializeDocumentComponentParameterValueList(v *[]string, va return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.FastLaunchConfiguration if *v == nil { - cv = []string{} + cv = []types.FastLaunchConfiguration{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentParameterValue to be of type string, got %T instead", value) - } - col = jtv + var col types.FastLaunchConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentFastLaunchConfiguration(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -10372,7 +13522,7 @@ func awsRestjson1_deserializeDocumentComponentParameterValueList(v *[]string, va return nil } -func awsRestjson1_deserializeDocumentComponentState(v **types.ComponentState, value interface{}) error { +func awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(v **types.FastLaunchLaunchTemplateSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10385,31 +13535,40 @@ func awsRestjson1_deserializeDocumentComponentState(v **types.ComponentState, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentState + var sv *types.FastLaunchLaunchTemplateSpecification if *v == nil { - sv = &types.ComponentState{} + sv = &types.FastLaunchLaunchTemplateSpecification{} } else { sv = *v } for key, value := range shape { switch key { - case "reason": + case "launchTemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value) + } + sv.LaunchTemplateId = ptr.String(jtv) + } + + case "launchTemplateName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Reason = ptr.String(jtv) + sv.LaunchTemplateName = ptr.String(jtv) } - case "status": + case "launchTemplateVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Status = types.ComponentStatus(jtv) + sv.LaunchTemplateVersion = ptr.String(jtv) } default: @@ -10421,7 +13580,7 @@ func awsRestjson1_deserializeDocumentComponentState(v **types.ComponentState, va return nil } -func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(v **types.FastLaunchSnapshotConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10434,127 +13593,66 @@ func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentSummary + var sv *types.FastLaunchSnapshotConfiguration if *v == nil { - sv = &types.ComponentSummary{} + sv = &types.FastLaunchSnapshotConfiguration{} } 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 ImageBuilderArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "changeDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ChangeDescription = ptr.String(jtv) - } - - case "dateCreated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateCreated = ptr.String(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "obfuscate": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.Obfuscate = jtv - } - - case "owner": + case "targetResourceCount": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected TargetResourceCount to be json.Number, got %T instead", value) } - sv.Owner = ptr.String(jtv) - } - - case "platform": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.Platform = types.Platform(jtv) + sv.TargetResourceCount = ptr.Int32(int32(i64)) } - case "publisher": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Publisher = ptr.String(jtv) - } + default: + _, _ = key, value - case "state": - if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil { - return err - } + } + } + *v = sv + return nil +} - case "supportedOsVersions": - if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { - return err - } +func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) - } - sv.Type = types.ComponentType(jtv) - } + var sv *types.ForbiddenException + if *v == nil { + sv = &types.ForbiddenException{} + } else { + sv = *v + } - case "version": + for key, value := range shape { + switch key { + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.Version = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -10566,7 +13664,7 @@ func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary return nil } -func awsRestjson1_deserializeDocumentComponentSummaryList(v *[]types.ComponentSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10574,33 +13672,39 @@ func awsRestjson1_deserializeDocumentComponentSummaryList(v *[]types.ComponentSu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ComponentSummary + var sv *types.IdempotentParameterMismatchException if *v == nil { - cv = []types.ComponentSummary{} + sv = &types.IdempotentParameterMismatchException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ComponentSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion, value interface{}) error { +func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10613,9 +13717,9 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentVersion + var sv *types.Image if *v == nil { - sv = &types.ComponentVersion{} + sv = &types.Image{} } else { sv = *v } @@ -10631,6 +13735,20 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion sv.Arn = ptr.String(jtv) } + case "buildType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BuildType to be of type string, got %T instead", value) + } + sv.BuildType = types.BuildType(jtv) + } + + case "containerRecipe": + if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil { + return err + } + case "dateCreated": if value != nil { jtv, ok := value.(string) @@ -10640,13 +13758,47 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion sv.DateCreated = ptr.String(jtv) } - case "description": + case "distributionConfiguration": + if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil { + return err + } + + case "enhancedImageMetadataEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv) + } + + case "imageRecipe": + if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil { + return err + } + + case "imageScanningConfiguration": + if err := awsRestjson1_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil { + return err + } + + case "imageSource": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.ImageSource = types.ImageSource(jtv) + } + + case "imageTestsConfiguration": + if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil { + return err + } + + case "infrastructureConfiguration": + if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, value); err != nil { + return err } case "name": @@ -10658,13 +13810,18 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion sv.Name = ptr.String(jtv) } - case "owner": + case "osVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) + sv.OsVersion = ptr.String(jtv) + } + + case "outputResources": + if err := awsRestjson1_deserializeDocumentOutputResources(&sv.OutputResources, value); err != nil { + return err } case "platform": @@ -10676,8 +13833,36 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion sv.Platform = types.Platform(jtv) } - case "supportedOsVersions": - if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { + case "scanState": + if err := awsRestjson1_deserializeDocumentImageScanState(&sv.ScanState, value); err != nil { + return err + } + + case "sourcePipelineArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.SourcePipelineArn = ptr.String(jtv) + } + + case "sourcePipelineName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.SourcePipelineName = ptr.String(jtv) + } + + case "state": + if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -10685,9 +13870,9 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) } - sv.Type = types.ComponentType(jtv) + sv.Type = types.ImageType(jtv) } case "version": @@ -10708,41 +13893,7 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion return nil } -func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVersion, 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.ComponentVersion - if *v == nil { - cv = []types.ComponentVersion{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ComponentVersion - destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentVersion(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentContainer(v **types.Container, value interface{}) error { +func awsRestjson1_deserializeDocumentImageAggregation(v **types.ImageAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10755,27 +13906,27 @@ func awsRestjson1_deserializeDocumentContainer(v **types.Container, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Container + var sv *types.ImageAggregation if *v == nil { - sv = &types.Container{} + sv = &types.ImageAggregation{} } else { sv = *v } for key, value := range shape { switch key { - case "imageUris": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageUris, value); err != nil { - return err - } - - case "region": + case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.Region = ptr.String(jtv) + sv.ImageBuildVersionArn = ptr.String(jtv) + } + + case "severityCounts": + if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + return err } default: @@ -10787,7 +13938,7 @@ func awsRestjson1_deserializeDocumentContainer(v **types.Container, value interf return nil } -func awsRestjson1_deserializeDocumentContainerDistributionConfiguration(v **types.ContainerDistributionConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentImagePackage(v **types.ImagePackage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10800,32 +13951,31 @@ func awsRestjson1_deserializeDocumentContainerDistributionConfiguration(v **type return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ContainerDistributionConfiguration + var sv *types.ImagePackage if *v == nil { - sv = &types.ContainerDistributionConfiguration{} + sv = &types.ImagePackage{} } else { sv = *v } for key, value := range shape { switch key { - case "containerTags": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil { - return err - } - - case "description": + case "packageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.PackageName = ptr.String(jtv) } - case "targetRepository": - if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { - return err + case "packageVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PackageVersion = ptr.String(jtv) } default: @@ -10837,7 +13987,7 @@ func awsRestjson1_deserializeDocumentContainerDistributionConfiguration(v **type return nil } -func awsRestjson1_deserializeDocumentContainerList(v *[]types.Container, value interface{}) error { +func awsRestjson1_deserializeDocumentImagePackageList(v *[]types.ImagePackage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10850,17 +14000,17 @@ func awsRestjson1_deserializeDocumentContainerList(v *[]types.Container, value i return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Container + var cv []types.ImagePackage if *v == nil { - cv = []types.Container{} + cv = []types.ImagePackage{} } else { cv = *v } for _, value := range shape { - var col types.Container + var col types.ImagePackage destAddr := &col - if err := awsRestjson1_deserializeDocumentContainer(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentImagePackage(&destAddr, value); err != nil { return err } col = *destAddr @@ -10871,7 +14021,7 @@ func awsRestjson1_deserializeDocumentContainerList(v *[]types.Container, value i return nil } -func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, value interface{}) error { +func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10884,45 +14034,67 @@ func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ContainerRecipe + var sv *types.ImagePipeline if *v == nil { - sv = &types.ContainerRecipe{} + sv = &types.ImagePipeline{} } else { sv = *v } - for key, value := range shape { - switch key { - case "arn": + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "containerRecipeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ContainerRecipeArn = ptr.String(jtv) + } + + case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.DateCreated = ptr.String(jtv) } - case "components": - if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil { - return err + case "dateLastRun": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateLastRun = ptr.String(jtv) } - case "containerType": + case "dateNextRun": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.ContainerType = types.ContainerType(jtv) + sv.DateNextRun = ptr.String(jtv) } - case "dateCreated": + case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.DateCreated = ptr.String(jtv) + sv.DateUpdated = ptr.String(jtv) } case "description": @@ -10934,63 +14106,59 @@ func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, sv.Description = ptr.String(jtv) } - case "dockerfileTemplateData": + case "distributionConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DockerFileTemplate to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.DockerfileTemplateData = ptr.String(jtv) + sv.DistributionConfigurationArn = ptr.String(jtv) } - case "encrypted": + case "enhancedImageMetadataEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } - sv.Encrypted = ptr.Bool(jtv) - } - - case "instanceConfiguration": - if err := awsRestjson1_deserializeDocumentInstanceConfiguration(&sv.InstanceConfiguration, value); err != nil { - return err + sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv) } - case "kmsKeyId": + case "imageRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.KmsKeyId = ptr.String(jtv) + sv.ImageRecipeArn = ptr.String(jtv) } - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "imageScanningConfiguration": + if err := awsRestjson1_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil { + return err } - case "owner": + case "imageTestsConfiguration": + if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil { + return err + } + + case "infrastructureConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) + sv.InfrastructureConfigurationArn = ptr.String(jtv) } - case "parentImage": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } - sv.ParentImage = ptr.String(jtv) + sv.Name = ptr.String(jtv) } case "platform": @@ -11002,32 +14170,23 @@ func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, sv.Platform = types.Platform(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "targetRepository": - if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { + case "schedule": + if err := awsRestjson1_deserializeDocumentSchedule(&sv.Schedule, value); err != nil { return err } - case "version": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + return fmt.Errorf("expected PipelineStatus to be of type string, got %T instead", value) } - sv.Version = ptr.String(jtv) + sv.Status = types.PipelineStatus(jtv) } - case "workingDirectory": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.WorkingDirectory = ptr.String(jtv) + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -11039,7 +14198,7 @@ func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, return nil } -func awsRestjson1_deserializeDocumentContainerRecipeSummary(v **types.ContainerRecipeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentImagePipelineAggregation(v **types.ImagePipelineAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11052,80 +14211,26 @@ func awsRestjson1_deserializeDocumentContainerRecipeSummary(v **types.ContainerR return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ContainerRecipeSummary + var sv *types.ImagePipelineAggregation if *v == nil { - sv = &types.ContainerRecipeSummary{} + sv = &types.ImagePipelineAggregation{} } 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 ImageBuilderArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "containerType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) - } - sv.ContainerType = types.ContainerType(jtv) - } - - case "dateCreated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateCreated = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "owner": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Owner = ptr.String(jtv) - } - - case "parentImage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ParentImage = ptr.String(jtv) - } - - case "platform": + case "imagePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } - sv.Platform = types.Platform(jtv) + sv.ImagePipelineArn = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "severityCounts": + if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } @@ -11138,7 +14243,7 @@ func awsRestjson1_deserializeDocumentContainerRecipeSummary(v **types.ContainerR return nil } -func awsRestjson1_deserializeDocumentContainerRecipeSummaryList(v *[]types.ContainerRecipeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentImagePipelineList(v *[]types.ImagePipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11151,17 +14256,17 @@ func awsRestjson1_deserializeDocumentContainerRecipeSummaryList(v *[]types.Conta return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ContainerRecipeSummary + var cv []types.ImagePipeline if *v == nil { - cv = []types.ContainerRecipeSummary{} + cv = []types.ImagePipeline{} } else { cv = *v } for _, value := range shape { - var col types.ContainerRecipeSummary + var col types.ImagePipeline destAddr := &col - if err := awsRestjson1_deserializeDocumentContainerRecipeSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentImagePipeline(&destAddr, value); err != nil { return err } col = *destAddr @@ -11172,7 +14277,7 @@ func awsRestjson1_deserializeDocumentContainerRecipeSummaryList(v *[]types.Conta return nil } -func awsRestjson1_deserializeDocumentDistribution(v **types.Distribution, value interface{}) error { +func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11185,151 +14290,123 @@ func awsRestjson1_deserializeDocumentDistribution(v **types.Distribution, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Distribution + var sv *types.ImageRecipe if *v == nil { - sv = &types.Distribution{} + sv = &types.ImageRecipe{} } else { sv = *v } for key, value := range shape { switch key { - case "amiDistributionConfiguration": - if err := awsRestjson1_deserializeDocumentAmiDistributionConfiguration(&sv.AmiDistributionConfiguration, value); err != nil { + case "additionalInstanceConfiguration": + if err := awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(&sv.AdditionalInstanceConfiguration, value); err != nil { return err } - case "containerDistributionConfiguration": - if err := awsRestjson1_deserializeDocumentContainerDistributionConfiguration(&sv.ContainerDistributionConfiguration, value); err != nil { - return err + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) } - case "fastLaunchConfigurations": - if err := awsRestjson1_deserializeDocumentFastLaunchConfigurationList(&sv.FastLaunchConfigurations, value); err != nil { + case "blockDeviceMappings": + if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil { return err } - case "launchTemplateConfigurations": - if err := awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(&sv.LaunchTemplateConfigurations, value); err != nil { + case "components": + if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil { return err } - case "licenseConfigurationArns": - if err := awsRestjson1_deserializeDocumentLicenseConfigurationArnList(&sv.LicenseConfigurationArns, value); err != nil { - return err + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) } - case "region": + case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Region = ptr.String(jtv) - } - - case "s3ExportConfiguration": - if err := awsRestjson1_deserializeDocumentS3ExportConfiguration(&sv.S3ExportConfiguration, value); err != nil { - return err + sv.Description = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDistributionConfiguration(v **types.DistributionConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", 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.DistributionConfiguration - if *v == nil { - sv = &types.DistributionConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "dateCreated": + case "owner": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.DateCreated = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "dateUpdated": + case "parentImage": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.DateUpdated = ptr.String(jtv) + sv.ParentImage = ptr.String(jtv) } - case "description": + case "platform": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.Platform = types.Platform(jtv) } - case "distributions": - if err := awsRestjson1_deserializeDocumentDistributionList(&sv.Distributions, value); err != nil { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } - case "name": + case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Type = types.ImageType(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) } - case "timeoutMinutes": + case "workingDirectory": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DistributionTimeoutMinutes to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.TimeoutMinutes = ptr.Int32(int32(i64)) + sv.WorkingDirectory = ptr.String(jtv) } default: @@ -11341,7 +14418,7 @@ func awsRestjson1_deserializeDocumentDistributionConfiguration(v **types.Distrib return nil } -func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types.DistributionConfigurationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentImageRecipeSummary(v **types.ImageRecipeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11354,9 +14431,9 @@ func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DistributionConfigurationSummary + var sv *types.ImageRecipeSummary if *v == nil { - sv = &types.DistributionConfigurationSummary{} + sv = &types.ImageRecipeSummary{} } else { sv = *v } @@ -11381,36 +14458,40 @@ func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types. sv.DateCreated = ptr.String(jtv) } - case "dateUpdated": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } - sv.DateUpdated = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "description": + case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "name": + case "parentImage": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.ParentImage = ptr.String(jtv) } - case "regions": - if err := awsRestjson1_deserializeDocumentRegionList(&sv.Regions, value); err != nil { - return err + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) } case "tags": @@ -11427,41 +14508,7 @@ func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types. return nil } -func awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(v *[]types.DistributionConfigurationSummary, 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.DistributionConfigurationSummary - if *v == nil { - cv = []types.DistributionConfigurationSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DistributionConfigurationSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentDistributionList(v *[]types.Distribution, value interface{}) error { +func awsRestjson1_deserializeDocumentImageRecipeSummaryList(v *[]types.ImageRecipeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11474,17 +14521,17 @@ func awsRestjson1_deserializeDocumentDistributionList(v *[]types.Distribution, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Distribution + var cv []types.ImageRecipeSummary if *v == nil { - cv = []types.Distribution{} + cv = []types.ImageRecipeSummary{} } else { cv = *v } for _, value := range shape { - var col types.Distribution + var col types.ImageRecipeSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentDistribution(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentImageRecipeSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -11495,7 +14542,7 @@ func awsRestjson1_deserializeDocumentDistributionList(v *[]types.Distribution, v return nil } -func awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(v **types.EbsInstanceBlockDeviceSpecification, value interface{}) error { +func awsRestjson1_deserializeDocumentImageScanFinding(v **types.ImageScanFinding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11508,97 +14555,166 @@ func awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(v **typ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EbsInstanceBlockDeviceSpecification + var sv *types.ImageScanFinding if *v == nil { - sv = &types.EbsInstanceBlockDeviceSpecification{} + sv = &types.ImageScanFinding{} } else { sv = *v } for key, value := range shape { switch key { - case "deleteOnTermination": + case "awsAccountId": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.DeleteOnTermination = ptr.Bool(jtv) + sv.AwsAccountId = ptr.String(jtv) } - case "encrypted": + case "description": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Encrypted = ptr.Bool(jtv) + sv.Description = ptr.String(jtv) } - case "iops": + case "firstObservedAt": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected EbsIopsInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.FirstObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + } - sv.Iops = ptr.Int32(int32(i64)) } - case "kmsKeyId": + case "fixAvailable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.KmsKeyId = ptr.String(jtv) + sv.FixAvailable = ptr.String(jtv) } - case "snapshotId": + case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.SnapshotId = ptr.String(jtv) + sv.ImageBuildVersionArn = ptr.String(jtv) } - case "throughput": + case "imagePipelineArn": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EbsVolumeThroughput to be json.Number, got %T instead", value) + return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.ImagePipelineArn = ptr.String(jtv) + } + + case "inspectorScore": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.InspectorScore = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.InspectorScore = ptr.Float64(f64) + + default: + return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value) + } - sv.Throughput = ptr.Int32(int32(i64)) } - case "volumeSize": + case "inspectorScoreDetails": + if err := awsRestjson1_deserializeDocumentInspectorScoreDetails(&sv.InspectorScoreDetails, value); err != nil { + return err + } + + case "packageVulnerabilityDetails": + if err := awsRestjson1_deserializeDocumentPackageVulnerabilityDetails(&sv.PackageVulnerabilityDetails, value); err != nil { + return err + } + + case "remediation": + if err := awsRestjson1_deserializeDocumentRemediation(&sv.Remediation, value); err != nil { + return err + } + + case "severity": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EbsVolumeSizeInteger to be json.Number, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.Severity = ptr.String(jtv) + } + + case "title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.VolumeSize = ptr.Int32(int32(i64)) + sv.Title = ptr.String(jtv) } - case "volumeType": + case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EbsVolumeType to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + } - sv.VolumeType = types.EbsVolumeType(jtv) } default: @@ -11610,7 +14726,7 @@ func awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(v **typ return nil } -func awsRestjson1_deserializeDocumentFastLaunchConfiguration(v **types.FastLaunchConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentImageScanFindingAggregation(v **types.ImageScanFindingAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11623,53 +14739,32 @@ func awsRestjson1_deserializeDocumentFastLaunchConfiguration(v **types.FastLaunc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FastLaunchConfiguration + var sv *types.ImageScanFindingAggregation if *v == nil { - sv = &types.FastLaunchConfiguration{} + sv = &types.ImageScanFindingAggregation{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.Enabled = jtv + case "accountAggregation": + if err := awsRestjson1_deserializeDocumentAccountAggregation(&sv.AccountAggregation, value); err != nil { + return err } - case "launchTemplate": - if err := awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(&sv.LaunchTemplate, value); err != nil { + case "imageAggregation": + if err := awsRestjson1_deserializeDocumentImageAggregation(&sv.ImageAggregation, value); err != nil { return err } - case "maxParallelLaunches": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected MaxParallelLaunches to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxParallelLaunches = ptr.Int32(int32(i64)) + case "imagePipelineAggregation": + if err := awsRestjson1_deserializeDocumentImagePipelineAggregation(&sv.ImagePipelineAggregation, value); err != nil { + return err } - case "snapshotConfiguration": - if err := awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(&sv.SnapshotConfiguration, value); err != nil { + case "vulnerabilityIdAggregation": + if err := awsRestjson1_deserializeDocumentVulnerabilityIdAggregation(&sv.VulnerabilityIdAggregation, value); err != nil { return err } @@ -11682,7 +14777,7 @@ func awsRestjson1_deserializeDocumentFastLaunchConfiguration(v **types.FastLaunc return nil } -func awsRestjson1_deserializeDocumentFastLaunchConfigurationList(v *[]types.FastLaunchConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentImageScanFindingAggregationsList(v *[]types.ImageScanFindingAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11695,17 +14790,17 @@ func awsRestjson1_deserializeDocumentFastLaunchConfigurationList(v *[]types.Fast return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.FastLaunchConfiguration + var cv []types.ImageScanFindingAggregation if *v == nil { - cv = []types.FastLaunchConfiguration{} + cv = []types.ImageScanFindingAggregation{} } else { cv = *v } for _, value := range shape { - var col types.FastLaunchConfiguration + var col types.ImageScanFindingAggregation destAddr := &col - if err := awsRestjson1_deserializeDocumentFastLaunchConfiguration(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentImageScanFindingAggregation(&destAddr, value); err != nil { return err } col = *destAddr @@ -11716,7 +14811,7 @@ func awsRestjson1_deserializeDocumentFastLaunchConfigurationList(v *[]types.Fast return nil } -func awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(v **types.FastLaunchLaunchTemplateSpecification, value interface{}) error { +func awsRestjson1_deserializeDocumentImageScanFindingsList(v *[]types.ImageScanFinding, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11724,57 +14819,33 @@ func awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(v **t return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FastLaunchLaunchTemplateSpecification + var cv []types.ImageScanFinding if *v == nil { - sv = &types.FastLaunchLaunchTemplateSpecification{} + cv = []types.ImageScanFinding{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "launchTemplateId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value) - } - sv.LaunchTemplateId = ptr.String(jtv) - } - - case "launchTemplateName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.LaunchTemplateName = ptr.String(jtv) - } - - case "launchTemplateVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.LaunchTemplateVersion = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.ImageScanFinding + destAddr := &col + if err := awsRestjson1_deserializeDocumentImageScanFinding(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(v **types.FastLaunchSnapshotConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentImageScanningConfiguration(v **types.ImageScanningConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11787,26 +14858,27 @@ func awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(v **types.F return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FastLaunchSnapshotConfiguration + var sv *types.ImageScanningConfiguration if *v == nil { - sv = &types.FastLaunchSnapshotConfiguration{} + sv = &types.ImageScanningConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "targetResourceCount": + case "ecrConfiguration": + if err := awsRestjson1_deserializeDocumentEcrConfiguration(&sv.EcrConfiguration, value); err != nil { + return err + } + + case "imageScanningEnabled": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected TargetResourceCount to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } - sv.TargetResourceCount = ptr.Int32(int32(i64)) + sv.ImageScanningEnabled = ptr.Bool(jtv) } default: @@ -11818,7 +14890,7 @@ func awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(v **types.F return nil } -func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error { +func awsRestjson1_deserializeDocumentImageScanState(v **types.ImageScanState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11831,22 +14903,31 @@ func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenExcep return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ForbiddenException + var sv *types.ImageScanState if *v == nil { - sv = &types.ForbiddenException{} + sv = &types.ImageScanState{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "reason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Reason = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageScanStatus to be of type string, got %T instead", value) + } + sv.Status = types.ImageScanStatus(jtv) } default: @@ -11858,7 +14939,7 @@ func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenExcep return nil } -func awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { +func awsRestjson1_deserializeDocumentImageState(v **types.ImageState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11871,22 +14952,31 @@ func awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(v **ty return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IdempotentParameterMismatchException + var sv *types.ImageState if *v == nil { - sv = &types.IdempotentParameterMismatchException{} + sv = &types.ImageState{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "reason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Reason = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageStatus to be of type string, got %T instead", value) + } + sv.Status = types.ImageStatus(jtv) } default: @@ -11898,7 +14988,7 @@ func awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(v **ty return nil } -func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) error { +func awsRestjson1_deserializeDocumentImageSummary(v **types.ImageSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11911,9 +15001,9 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Image + var sv *types.ImageSummary if *v == nil { - sv = &types.Image{} + sv = &types.ImageSummary{} } else { sv = *v } @@ -11938,11 +15028,6 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e sv.BuildType = types.BuildType(jtv) } - case "containerRecipe": - if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil { - return err - } - case "dateCreated": if value != nil { jtv, ok := value.(string) @@ -11952,25 +15037,6 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e sv.DateCreated = ptr.String(jtv) } - case "distributionConfiguration": - if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil { - return err - } - - case "enhancedImageMetadataEnabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) - } - sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv) - } - - case "imageRecipe": - if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil { - return err - } - case "imageSource": if value != nil { jtv, ok := value.(string) @@ -11980,16 +15046,6 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e sv.ImageSource = types.ImageSource(jtv) } - case "imageTestsConfiguration": - if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil { - return err - } - - case "infrastructureConfiguration": - if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, value); err != nil { - return err - } - case "name": if value != nil { jtv, ok := value.(string) @@ -12013,31 +15069,22 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e return err } - case "platform": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) - } - sv.Platform = types.Platform(jtv) - } - - case "sourcePipelineArn": + case "owner": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.SourcePipelineArn = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "sourcePipelineName": + case "platform": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) } - sv.SourcePipelineName = ptr.String(jtv) + sv.Platform = types.Platform(jtv) } case "state": @@ -12077,7 +15124,7 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e return nil } -func awsRestjson1_deserializeDocumentImagePackage(v **types.ImagePackage, value interface{}) error { +func awsRestjson1_deserializeDocumentImageSummaryList(v *[]types.ImageSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12085,48 +15132,33 @@ func awsRestjson1_deserializeDocumentImagePackage(v **types.ImagePackage, value return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImagePackage + var cv []types.ImageSummary if *v == nil { - sv = &types.ImagePackage{} + cv = []types.ImageSummary{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "packageName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.PackageName = ptr.String(jtv) - } - - case "packageVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.PackageVersion = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.ImageSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentImageSummary(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentImagePackageList(v *[]types.ImagePackage, value interface{}) error { +func awsRestjson1_deserializeDocumentImageTestsConfiguration(v **types.ImageTestsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12134,33 +15166,52 @@ func awsRestjson1_deserializeDocumentImagePackageList(v *[]types.ImagePackage, v return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ImagePackage + var sv *types.ImageTestsConfiguration if *v == nil { - cv = []types.ImagePackage{} + sv = &types.ImageTestsConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ImagePackage - destAddr := &col - if err := awsRestjson1_deserializeDocumentImagePackage(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "imageTestsEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.ImageTestsEnabled = ptr.Bool(jtv) + } + + case "timeoutMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ImageTestsTimeoutMinutes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimeoutMinutes = ptr.Int32(int32(i64)) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, value interface{}) error { +func awsRestjson1_deserializeDocumentImageVersion(v **types.ImageVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12173,9 +15224,9 @@ func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImagePipeline + var sv *types.ImageVersion if *v == nil { - sv = &types.ImagePipeline{} + sv = &types.ImageVersion{} } else { sv = *v } @@ -12191,13 +15242,13 @@ func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, valu sv.Arn = ptr.String(jtv) } - case "containerRecipeArn": + case "buildType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected BuildType to be of type string, got %T instead", value) } - sv.ContainerRecipeArn = ptr.String(jtv) + sv.BuildType = types.BuildType(jtv) } case "dateCreated": @@ -12209,118 +15260,67 @@ func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, valu sv.DateCreated = ptr.String(jtv) } - case "dateLastRun": + case "imageSource": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value) } - sv.DateLastRun = ptr.String(jtv) + sv.ImageSource = types.ImageSource(jtv) } - case "dateNextRun": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } - sv.DateNextRun = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "dateUpdated": + case "osVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) } - sv.DateUpdated = ptr.String(jtv) + sv.OsVersion = ptr.String(jtv) } - case "description": + case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) - } - - case "distributionConfigurationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.DistributionConfigurationArn = ptr.String(jtv) - } - - case "enhancedImageMetadataEnabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) - } - sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv) - } - - case "imageRecipeArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.ImageRecipeArn = ptr.String(jtv) - } - - case "imageTestsConfiguration": - if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil { - return err - } - - case "infrastructureConfigurationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.InfrastructureConfigurationArn = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "name": + case "platform": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Platform = types.Platform(jtv) } - case "platform": + case "type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) } - sv.Platform = types.Platform(jtv) - } - - case "schedule": - if err := awsRestjson1_deserializeDocumentSchedule(&sv.Schedule, value); err != nil { - return err + sv.Type = types.ImageType(jtv) } - case "status": + case "version": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PipelineStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } - sv.Status = types.PipelineStatus(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err + sv.Version = ptr.String(jtv) } default: @@ -12332,7 +15332,7 @@ func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, valu return nil } -func awsRestjson1_deserializeDocumentImagePipelineList(v *[]types.ImagePipeline, value interface{}) error { +func awsRestjson1_deserializeDocumentImageVersionList(v *[]types.ImageVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12345,17 +15345,17 @@ func awsRestjson1_deserializeDocumentImagePipelineList(v *[]types.ImagePipeline, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ImagePipeline + var cv []types.ImageVersion if *v == nil { - cv = []types.ImagePipeline{} + cv = []types.ImageVersion{} } else { cv = *v } for _, value := range shape { - var col types.ImagePipeline + var col types.ImageVersion destAddr := &col - if err := awsRestjson1_deserializeDocumentImagePipeline(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentImageVersion(&destAddr, value); err != nil { return err } col = *destAddr @@ -12366,7 +15366,7 @@ func awsRestjson1_deserializeDocumentImagePipelineList(v *[]types.ImagePipeline, return nil } -func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, value interface{}) error { +func awsRestjson1_deserializeDocumentInfrastructureConfiguration(v **types.InfrastructureConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12379,20 +15379,15 @@ func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImageRecipe + var sv *types.InfrastructureConfiguration if *v == nil { - sv = &types.ImageRecipe{} + sv = &types.InfrastructureConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "additionalInstanceConfiguration": - if err := awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(&sv.AdditionalInstanceConfiguration, value); err != nil { - return err - } - case "arn": if value != nil { jtv, ok := value.(string) @@ -12402,16 +15397,6 @@ func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, value in sv.Arn = ptr.String(jtv) } - case "blockDeviceMappings": - if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil { - return err - } - - case "components": - if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil { - return err - } - case "dateCreated": if value != nil { jtv, ok := value.(string) @@ -12421,81 +15406,106 @@ func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, value in sv.DateCreated = ptr.String(jtv) } - case "description": + case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.DateUpdated = ptr.String(jtv) } - case "name": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "owner": + case "instanceMetadataOptions": + if err := awsRestjson1_deserializeDocumentInstanceMetadataOptions(&sv.InstanceMetadataOptions, value); err != nil { + return err + } + + case "instanceProfileName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceProfileNameType to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) + sv.InstanceProfileName = ptr.String(jtv) } - case "parentImage": + case "instanceTypes": + if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil { + return err + } + + case "keyPair": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ParentImage = ptr.String(jtv) + sv.KeyPair = ptr.String(jtv) } - case "platform": + case "logging": + if err := awsRestjson1_deserializeDocumentLogging(&sv.Logging, value); err != nil { + return err + } + + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } - sv.Platform = types.Platform(jtv) + sv.Name = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "resourceTags": + if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil { return err } - case "type": + case "securityGroupIds": + if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { + return err + } + + case "snsTopicArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Type = types.ImageType(jtv) + sv.SnsTopicArn = ptr.String(jtv) } - case "version": + case "subnetId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Version = ptr.String(jtv) + sv.SubnetId = ptr.String(jtv) } - case "workingDirectory": + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "terminateInstanceOnFailure": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } - sv.WorkingDirectory = ptr.String(jtv) + sv.TerminateInstanceOnFailure = ptr.Bool(jtv) } default: @@ -12507,7 +15517,7 @@ func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, value in return nil } -func awsRestjson1_deserializeDocumentImageRecipeSummary(v **types.ImageRecipeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(v **types.InfrastructureConfigurationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12520,9 +15530,9 @@ func awsRestjson1_deserializeDocumentImageRecipeSummary(v **types.ImageRecipeSum return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImageRecipeSummary + var sv *types.InfrastructureConfigurationSummary if *v == nil { - sv = &types.ImageRecipeSummary{} + sv = &types.InfrastructureConfigurationSummary{} } else { sv = *v } @@ -12547,40 +15557,50 @@ func awsRestjson1_deserializeDocumentImageRecipeSummary(v **types.ImageRecipeSum sv.DateCreated = ptr.String(jtv) } - case "name": + case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.DateUpdated = ptr.String(jtv) } - case "owner": + case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "parentImage": + case "instanceProfileName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceProfileNameType to be of type string, got %T instead", value) } - sv.ParentImage = ptr.String(jtv) + sv.InstanceProfileName = ptr.String(jtv) } - case "platform": + case "instanceTypes": + if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil { + return err + } + + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } - sv.Platform = types.Platform(jtv) + sv.Name = ptr.String(jtv) + } + + case "resourceTags": + if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil { + return err } case "tags": @@ -12597,7 +15617,7 @@ func awsRestjson1_deserializeDocumentImageRecipeSummary(v **types.ImageRecipeSum return nil } -func awsRestjson1_deserializeDocumentImageRecipeSummaryList(v *[]types.ImageRecipeSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(v *[]types.InfrastructureConfigurationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12610,17 +15630,17 @@ func awsRestjson1_deserializeDocumentImageRecipeSummaryList(v *[]types.ImageReci return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ImageRecipeSummary + var cv []types.InfrastructureConfigurationSummary if *v == nil { - cv = []types.ImageRecipeSummary{} + cv = []types.InfrastructureConfigurationSummary{} } else { cv = *v } for _, value := range shape { - var col types.ImageRecipeSummary + var col types.InfrastructureConfigurationSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentImageRecipeSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -12631,7 +15651,7 @@ func awsRestjson1_deserializeDocumentImageRecipeSummaryList(v *[]types.ImageReci return nil } -func awsRestjson1_deserializeDocumentImageState(v **types.ImageState, value interface{}) error { +func awsRestjson1_deserializeDocumentInspectorScoreDetails(v **types.InspectorScoreDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12644,31 +15664,18 @@ func awsRestjson1_deserializeDocumentImageState(v **types.ImageState, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImageState + var sv *types.InspectorScoreDetails if *v == nil { - sv = &types.ImageState{} + sv = &types.InspectorScoreDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Reason = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ImageStatus to be of type string, got %T instead", value) - } - sv.Status = types.ImageStatus(jtv) + case "adjustedCvss": + if err := awsRestjson1_deserializeDocumentCvssScoreDetails(&sv.AdjustedCvss, value); err != nil { + return err } default: @@ -12680,7 +15687,7 @@ func awsRestjson1_deserializeDocumentImageState(v **types.ImageState, value inte return nil } -func awsRestjson1_deserializeDocumentImageSummary(v **types.ImageSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(v **types.InstanceBlockDeviceMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12693,118 +15700,45 @@ func awsRestjson1_deserializeDocumentImageSummary(v **types.ImageSummary, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImageSummary + var sv *types.InstanceBlockDeviceMapping if *v == nil { - sv = &types.ImageSummary{} + sv = &types.InstanceBlockDeviceMapping{} } 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 ImageBuilderArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "buildType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BuildType to be of type string, got %T instead", value) - } - sv.BuildType = types.BuildType(jtv) - } - - case "dateCreated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateCreated = ptr.String(jtv) - } - - case "imageSource": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value) - } - sv.ImageSource = types.ImageSource(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "osVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) - } - sv.OsVersion = ptr.String(jtv) - } - - case "outputResources": - if err := awsRestjson1_deserializeDocumentOutputResources(&sv.OutputResources, value); err != nil { - return err - } - - case "owner": + case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Owner = ptr.String(jtv) - } - - case "platform": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) - } - sv.Platform = types.Platform(jtv) - } - - case "state": - if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { - return err + sv.DeviceName = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "ebs": + if err := awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(&sv.Ebs, value); err != nil { return err } - case "type": + case "noDevice": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) + return fmt.Errorf("expected EmptyString to be of type string, got %T instead", value) } - sv.Type = types.ImageType(jtv) + sv.NoDevice = ptr.String(jtv) } - case "version": + case "virtualName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Version = ptr.String(jtv) + sv.VirtualName = ptr.String(jtv) } default: @@ -12816,7 +15750,7 @@ func awsRestjson1_deserializeDocumentImageSummary(v **types.ImageSummary, value return nil } -func awsRestjson1_deserializeDocumentImageSummaryList(v *[]types.ImageSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(v *[]types.InstanceBlockDeviceMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12829,17 +15763,17 @@ func awsRestjson1_deserializeDocumentImageSummaryList(v *[]types.ImageSummary, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ImageSummary + var cv []types.InstanceBlockDeviceMapping if *v == nil { - cv = []types.ImageSummary{} + cv = []types.InstanceBlockDeviceMapping{} } else { cv = *v } for _, value := range shape { - var col types.ImageSummary + var col types.InstanceBlockDeviceMapping destAddr := &col - if err := awsRestjson1_deserializeDocumentImageSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(&destAddr, value); err != nil { return err } col = *destAddr @@ -12850,7 +15784,7 @@ func awsRestjson1_deserializeDocumentImageSummaryList(v *[]types.ImageSummary, v return nil } -func awsRestjson1_deserializeDocumentImageTestsConfiguration(v **types.ImageTestsConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentInstanceConfiguration(v **types.InstanceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12863,35 +15797,27 @@ func awsRestjson1_deserializeDocumentImageTestsConfiguration(v **types.ImageTest return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImageTestsConfiguration + var sv *types.InstanceConfiguration if *v == nil { - sv = &types.ImageTestsConfiguration{} + sv = &types.InstanceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "imageTestsEnabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) - } - sv.ImageTestsEnabled = ptr.Bool(jtv) + case "blockDeviceMappings": + if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil { + return err } - case "timeoutMinutes": + case "image": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageTestsTimeoutMinutes to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.TimeoutMinutes = ptr.Int32(int32(i64)) + sv.Image = ptr.String(jtv) } default: @@ -12903,7 +15829,7 @@ func awsRestjson1_deserializeDocumentImageTestsConfiguration(v **types.ImageTest return nil } -func awsRestjson1_deserializeDocumentImageVersion(v **types.ImageVersion, value interface{}) error { +func awsRestjson1_deserializeDocumentInstanceMetadataOptions(v **types.InstanceMetadataOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12916,103 +15842,35 @@ func awsRestjson1_deserializeDocumentImageVersion(v **types.ImageVersion, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ImageVersion + var sv *types.InstanceMetadataOptions if *v == nil { - sv = &types.ImageVersion{} + sv = &types.InstanceMetadataOptions{} } 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 ImageBuilderArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "buildType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BuildType to be of type string, got %T instead", value) - } - sv.BuildType = types.BuildType(jtv) - } - - case "dateCreated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateCreated = ptr.String(jtv) - } - - case "imageSource": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value) - } - sv.ImageSource = types.ImageSource(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "osVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) - } - sv.OsVersion = ptr.String(jtv) - } - - case "owner": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Owner = ptr.String(jtv) - } - - case "platform": + case "httpPutResponseHopLimit": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected HttpPutResponseHopLimit to be json.Number, got %T instead", value) } - sv.Platform = types.Platform(jtv) - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.Type = types.ImageType(jtv) + sv.HttpPutResponseHopLimit = ptr.Int32(int32(i64)) } - case "version": + case "httpTokens": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + return fmt.Errorf("expected HttpTokens to be of type string, got %T instead", value) } - sv.Version = ptr.String(jtv) + sv.HttpTokens = ptr.String(jtv) } default: @@ -13024,7 +15882,7 @@ func awsRestjson1_deserializeDocumentImageVersion(v **types.ImageVersion, value return nil } -func awsRestjson1_deserializeDocumentImageVersionList(v *[]types.ImageVersion, value interface{}) error { +func awsRestjson1_deserializeDocumentInstanceTypeList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13037,20 +15895,22 @@ func awsRestjson1_deserializeDocumentImageVersionList(v *[]types.ImageVersion, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ImageVersion + var cv []string if *v == nil { - cv = []types.ImageVersion{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.ImageVersion - destAddr := &col - if err := awsRestjson1_deserializeDocumentImageVersion(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -13058,7 +15918,7 @@ func awsRestjson1_deserializeDocumentImageVersionList(v *[]types.ImageVersion, v return nil } -func awsRestjson1_deserializeDocumentInfrastructureConfiguration(v **types.InfrastructureConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13071,133 +15931,222 @@ func awsRestjson1_deserializeDocumentInfrastructureConfiguration(v **types.Infra return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InfrastructureConfiguration + var sv *types.InvalidPaginationTokenException if *v == nil { - sv = &types.InfrastructureConfiguration{} + sv = &types.InvalidPaginationTokenException{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "dateCreated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateCreated = ptr.String(jtv) - } + default: + _, _ = key, value - case "dateUpdated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateUpdated = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } +func awsRestjson1_deserializeDocumentInvalidParameterCombinationException(v **types.InvalidParameterCombinationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "instanceMetadataOptions": - if err := awsRestjson1_deserializeDocumentInstanceMetadataOptions(&sv.InstanceMetadataOptions, value); err != nil { - return err - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "instanceProfileName": + var sv *types.InvalidParameterCombinationException + if *v == nil { + sv = &types.InvalidParameterCombinationException{} + } 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 InstanceProfileNameType to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.InstanceProfileName = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "instanceTypes": - if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil { - return err - } + default: + _, _ = key, value - case "keyPair": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.KeyPair = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "logging": - if err := awsRestjson1_deserializeDocumentLogging(&sv.Logging, value); err != nil { - return err - } +func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "name": + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidParameterException + if *v == nil { + sv = &types.InvalidParameterException{} + } 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 ResourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "resourceTags": - if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil { - return err - } + default: + _, _ = key, value - case "securityGroupIds": - if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { - return err - } + } + } + *v = sv + return nil +} - case "snsTopicArn": +func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.InvalidParameterValueException + if *v == nil { + sv = &types.InvalidParameterValueException{} + } 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 NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.SnsTopicArn = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "subnetId": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.SubnetId = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } + default: + _, _ = key, value - case "terminateInstanceOnFailure": + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidVersionNumberException(v **types.InvalidVersionNumberException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.InvalidVersionNumberException + if *v == nil { + sv = &types.InvalidVersionNumberException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.TerminateInstanceOnFailure = ptr.Bool(jtv) + sv.Message = ptr.String(jtv) } default: @@ -13209,7 +16158,7 @@ func awsRestjson1_deserializeDocumentInfrastructureConfiguration(v **types.Infra return nil } -func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(v **types.InfrastructureConfigurationSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(v **types.LaunchPermissionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13222,81 +16171,32 @@ func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(v **type return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InfrastructureConfigurationSummary + var sv *types.LaunchPermissionConfiguration if *v == nil { - sv = &types.InfrastructureConfigurationSummary{} + sv = &types.LaunchPermissionConfiguration{} } 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 ImageBuilderArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "dateCreated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateCreated = ptr.String(jtv) - } - - case "dateUpdated": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) - } - sv.DateUpdated = ptr.String(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "instanceProfileName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InstanceProfileNameType to be of type string, got %T instead", value) - } - sv.InstanceProfileName = ptr.String(jtv) - } - - case "instanceTypes": - if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil { + case "organizationalUnitArns": + if err := awsRestjson1_deserializeDocumentOrganizationalUnitArnList(&sv.OrganizationalUnitArns, value); err != nil { return err } - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "organizationArns": + if err := awsRestjson1_deserializeDocumentOrganizationArnList(&sv.OrganizationArns, value); err != nil { + return err } - case "resourceTags": - if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil { + case "userGroups": + if err := awsRestjson1_deserializeDocumentStringList(&sv.UserGroups, value); err != nil { return err } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "userIds": + if err := awsRestjson1_deserializeDocumentAccountList(&sv.UserIds, value); err != nil { return err } @@ -13309,41 +16209,7 @@ func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(v **type return nil } -func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(v *[]types.InfrastructureConfigurationSummary, 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.InfrastructureConfigurationSummary - if *v == nil { - cv = []types.InfrastructureConfigurationSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.InfrastructureConfigurationSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(v **types.InstanceBlockDeviceMapping, value interface{}) error { +func awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(v **types.LaunchTemplateConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13356,45 +16222,40 @@ func awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(v **types.Instan return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InstanceBlockDeviceMapping + var sv *types.LaunchTemplateConfiguration if *v == nil { - sv = &types.InstanceBlockDeviceMapping{} + sv = &types.LaunchTemplateConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "deviceName": + case "accountId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } - sv.DeviceName = ptr.String(jtv) - } - - case "ebs": - if err := awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(&sv.Ebs, value); err != nil { - return err + sv.AccountId = ptr.String(jtv) } - case "noDevice": + case "launchTemplateId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value) } - sv.NoDevice = ptr.String(jtv) + sv.LaunchTemplateId = ptr.String(jtv) } - case "virtualName": + case "setDefaultVersion": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.VirtualName = ptr.String(jtv) + sv.SetDefaultVersion = jtv } default: @@ -13406,7 +16267,7 @@ func awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(v **types.Instan return nil } -func awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(v *[]types.InstanceBlockDeviceMapping, value interface{}) error { +func awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(v *[]types.LaunchTemplateConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13419,17 +16280,17 @@ func awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(v *[]types.Inst return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.InstanceBlockDeviceMapping + var cv []types.LaunchTemplateConfiguration if *v == nil { - cv = []types.InstanceBlockDeviceMapping{} + cv = []types.LaunchTemplateConfiguration{} } else { cv = *v } for _, value := range shape { - var col types.InstanceBlockDeviceMapping + var col types.LaunchTemplateConfiguration destAddr := &col - if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(&destAddr, value); err != nil { return err } col = *destAddr @@ -13440,7 +16301,43 @@ func awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(v *[]types.Inst return nil } -func awsRestjson1_deserializeDocumentInstanceConfiguration(v **types.InstanceConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentLicenseConfigurationArnList(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 LicenseConfigurationArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLogging(v **types.Logging, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13453,29 +16350,20 @@ func awsRestjson1_deserializeDocumentInstanceConfiguration(v **types.InstanceCon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InstanceConfiguration + var sv *types.Logging if *v == nil { - sv = &types.InstanceConfiguration{} + sv = &types.Logging{} } else { sv = *v } for key, value := range shape { switch key { - case "blockDeviceMappings": - if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil { + case "s3Logs": + if err := awsRestjson1_deserializeDocumentS3Logs(&sv.S3Logs, value); err != nil { return err } - case "image": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Image = ptr.String(jtv) - } - default: _, _ = key, value @@ -13485,7 +16373,7 @@ func awsRestjson1_deserializeDocumentInstanceConfiguration(v **types.InstanceCon return nil } -func awsRestjson1_deserializeDocumentInstanceMetadataOptions(v **types.InstanceMetadataOptions, value interface{}) error { +func awsRestjson1_deserializeDocumentNonEmptyStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13493,52 +16381,35 @@ func awsRestjson1_deserializeDocumentInstanceMetadataOptions(v **types.InstanceM return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InstanceMetadataOptions + var cv []string if *v == nil { - sv = &types.InstanceMetadataOptions{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "httpPutResponseHopLimit": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected HttpPutResponseHopLimit to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.HttpPutResponseHopLimit = ptr.Int32(int32(i64)) - } - - case "httpTokens": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HttpTokens to be of type string, got %T instead", value) - } - sv.HttpTokens = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentInstanceTypeList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentOrganizationalUnitArnList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13563,7 +16434,7 @@ func awsRestjson1_deserializeDocumentInstanceTypeList(v *[]string, value interfa if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value) + return fmt.Errorf("expected OrganizationalUnitArn to be of type string, got %T instead", value) } col = jtv } @@ -13574,7 +16445,7 @@ func awsRestjson1_deserializeDocumentInstanceTypeList(v *[]string, value interfa return nil } -func awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, value interface{}) error { +func awsRestjson1_deserializeDocumentOrganizationArnList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13582,39 +16453,35 @@ func awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.I return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidPaginationTokenException + var cv []string if *v == nil { - sv = &types.InvalidPaginationTokenException{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OrganizationArn to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentInvalidParameterCombinationException(v **types.InvalidParameterCombinationException, value interface{}) error { +func awsRestjson1_deserializeDocumentOsVersionList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13622,39 +16489,35 @@ func awsRestjson1_deserializeDocumentInvalidParameterCombinationException(v **ty return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidParameterCombinationException + var cv []string if *v == nil { - sv = &types.InvalidParameterCombinationException{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { +func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13667,22 +16530,23 @@ func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.Invalid return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidParameterException + var sv *types.OutputResources if *v == nil { - sv = &types.InvalidParameterException{} + sv = &types.OutputResources{} } else { sv = *v } for key, value := range shape { switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "amis": + if err := awsRestjson1_deserializeDocumentAmiList(&sv.Amis, value); err != nil { + return err + } + + case "containers": + if err := awsRestjson1_deserializeDocumentContainerList(&sv.Containers, value); err != nil { + return err } default: @@ -13694,7 +16558,7 @@ func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.Invalid return nil } -func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, value interface{}) error { +func awsRestjson1_deserializeDocumentPackageVulnerabilityDetails(v **types.PackageVulnerabilityDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13707,22 +16571,101 @@ func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.In return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidParameterValueException + var sv *types.PackageVulnerabilityDetails if *v == nil { - sv = &types.InvalidParameterValueException{} + sv = &types.PackageVulnerabilityDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "cvss": + if err := awsRestjson1_deserializeDocumentCvssScoreList(&sv.Cvss, value); err != nil { + return err + } + + case "referenceUrls": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ReferenceUrls, value); err != nil { + return err + } + + case "relatedVulnerabilities": + if err := awsRestjson1_deserializeDocumentVulnerabilityIdList(&sv.RelatedVulnerabilities, value); err != nil { + return err + } + + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Source = ptr.String(jtv) + } + + case "sourceUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SourceUrl = ptr.String(jtv) + } + + case "vendorCreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.VendorCreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "vendorSeverity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VendorSeverity = ptr.String(jtv) + } + + case "vendorUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.VendorUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTimeTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "vulnerabilityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VulnerabilityId to be of type string, got %T instead", value) + } + sv.VulnerabilityId = ptr.String(jtv) + } + + case "vulnerablePackages": + if err := awsRestjson1_deserializeDocumentVulnerablePackageList(&sv.VulnerablePackages, value); err != nil { + return err } default: @@ -13734,7 +16677,7 @@ func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.In return nil } -func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { +func awsRestjson1_deserializeDocumentRegionList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13742,39 +16685,35 @@ func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRe return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidRequestException + var cv []string if *v == nil { - sv = &types.InvalidRequestException{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentInvalidVersionNumberException(v **types.InvalidVersionNumberException, value interface{}) error { +func awsRestjson1_deserializeDocumentRemediation(v **types.Remediation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13787,22 +16726,18 @@ func awsRestjson1_deserializeDocumentInvalidVersionNumberException(v **types.Inv return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidVersionNumberException + var sv *types.Remediation if *v == nil { - sv = &types.InvalidVersionNumberException{} + sv = &types.Remediation{} } else { sv = *v } for key, value := range shape { switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "recommendation": + if err := awsRestjson1_deserializeDocumentRemediationRecommendation(&sv.Recommendation, value); err != nil { + return err } default: @@ -13814,7 +16749,7 @@ func awsRestjson1_deserializeDocumentInvalidVersionNumberException(v **types.Inv return nil } -func awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(v **types.LaunchPermissionConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentRemediationRecommendation(v **types.RemediationRecommendation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13827,33 +16762,31 @@ func awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(v **types.Lau return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LaunchPermissionConfiguration + var sv *types.RemediationRecommendation if *v == nil { - sv = &types.LaunchPermissionConfiguration{} + sv = &types.RemediationRecommendation{} } else { sv = *v } for key, value := range shape { switch key { - case "organizationalUnitArns": - if err := awsRestjson1_deserializeDocumentOrganizationalUnitArnList(&sv.OrganizationalUnitArns, value); err != nil { - return err - } - - case "organizationArns": - if err := awsRestjson1_deserializeDocumentOrganizationArnList(&sv.OrganizationArns, value); err != nil { - return err - } - - case "userGroups": - if err := awsRestjson1_deserializeDocumentStringList(&sv.UserGroups, value); err != nil { - return err + case "text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) } - case "userIds": - if err := awsRestjson1_deserializeDocumentAccountList(&sv.UserIds, value); err != nil { - return err + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) } default: @@ -13865,7 +16798,7 @@ func awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(v **types.Lau return nil } -func awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(v **types.LaunchTemplateConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13878,40 +16811,22 @@ func awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(v **types.Launc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LaunchTemplateConfiguration + var sv *types.ResourceAlreadyExistsException if *v == nil { - sv = &types.LaunchTemplateConfiguration{} + sv = &types.ResourceAlreadyExistsException{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "launchTemplateId": + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value) - } - sv.LaunchTemplateId = ptr.String(jtv) - } - - case "setDefaultVersion": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.SetDefaultVersion = jtv + sv.Message = ptr.String(jtv) } default: @@ -13923,7 +16838,7 @@ func awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(v **types.Launc return nil } -func awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(v *[]types.LaunchTemplateConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceDependencyException(v **types.ResourceDependencyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13931,33 +16846,39 @@ func awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(v *[]types. return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LaunchTemplateConfiguration + var sv *types.ResourceDependencyException if *v == nil { - cv = []types.LaunchTemplateConfiguration{} + sv = &types.ResourceDependencyException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.LaunchTemplateConfiguration - destAddr := &col - if err := awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentLicenseConfigurationArnList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13965,35 +16886,39 @@ func awsRestjson1_deserializeDocumentLicenseConfigurationArnList(v *[]string, va return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.ResourceInUseException if *v == nil { - cv = []string{} + sv = &types.ResourceInUseException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LicenseConfigurationArn to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentLogging(v **types.Logging, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14006,18 +16931,22 @@ func awsRestjson1_deserializeDocumentLogging(v **types.Logging, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Logging + var sv *types.ResourceNotFoundException if *v == nil { - sv = &types.Logging{} + sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { - case "s3Logs": - if err := awsRestjson1_deserializeDocumentS3Logs(&sv.S3Logs, value); err != nil { - return err + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: @@ -14029,7 +16958,7 @@ func awsRestjson1_deserializeDocumentLogging(v **types.Logging, value interface{ return nil } -func awsRestjson1_deserializeDocumentOrganizationalUnitArnList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentResourceTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14037,35 +16966,35 @@ func awsRestjson1_deserializeDocumentOrganizationalUnitArnList(v *[]string, valu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var mv map[string]string if *v == nil { - cv = []string{} + mv = map[string]string{} } else { - cv = *v + mv = *v } - for _, value := range shape { - var col string + for key, value := range shape { + var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected OrganizationalUnitArn to be of type string, got %T instead", value) + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } - col = jtv + parsedVal = jtv } - cv = append(cv, col) + mv[key] = parsedVal } - *v = cv + *v = mv return nil } -func awsRestjson1_deserializeDocumentOrganizationArnList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentS3ExportConfiguration(v **types.S3ExportConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14073,35 +17002,66 @@ func awsRestjson1_deserializeDocumentOrganizationArnList(v *[]string, value inte return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.S3ExportConfiguration if *v == nil { - cv = []string{} + sv = &types.S3ExportConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OrganizationArn to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "diskImageFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DiskImageFormat to be of type string, got %T instead", value) + } + sv.DiskImageFormat = types.DiskImageFormat(jtv) + } + + case "roleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RoleName = ptr.String(jtv) + } + + case "s3Bucket": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.S3Bucket = ptr.String(jtv) } - col = jtv - } - cv = append(cv, col) + case "s3Prefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.S3Prefix = ptr.String(jtv) + } + + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentOsVersionList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentS3Logs(v **types.S3Logs, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14109,35 +17069,48 @@ func awsRestjson1_deserializeDocumentOsVersionList(v *[]string, value interface{ return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.S3Logs if *v == nil { - cv = []string{} + sv = &types.S3Logs{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "s3BucketName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.S3BucketName = ptr.String(jtv) + } + + case "s3KeyPrefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.S3KeyPrefix = ptr.String(jtv) } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, value interface{}) error { +func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14150,23 +17123,40 @@ func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.OutputResources + var sv *types.Schedule if *v == nil { - sv = &types.OutputResources{} + sv = &types.Schedule{} } else { sv = *v } for key, value := range shape { switch key { - case "amis": - if err := awsRestjson1_deserializeDocumentAmiList(&sv.Amis, value); err != nil { - return err + case "pipelineExecutionStartCondition": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PipelineExecutionStartCondition to be of type string, got %T instead", value) + } + sv.PipelineExecutionStartCondition = types.PipelineExecutionStartCondition(jtv) } - case "containers": - if err := awsRestjson1_deserializeDocumentContainerList(&sv.Containers, value); err != nil { - return err + case "scheduleExpression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ScheduleExpression = ptr.String(jtv) + } + + case "timezone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timezone to be of type string, got %T instead", value) + } + sv.Timezone = ptr.String(jtv) } default: @@ -14178,7 +17168,7 @@ func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, return nil } -func awsRestjson1_deserializeDocumentRegionList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentSecurityGroupIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14214,7 +17204,7 @@ func awsRestjson1_deserializeDocumentRegionList(v *[]string, value interface{}) return nil } -func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { +func awsRestjson1_deserializeDocumentServiceException(v **types.ServiceException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14227,9 +17217,9 @@ func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.Re return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceAlreadyExistsException + var sv *types.ServiceException if *v == nil { - sv = &types.ResourceAlreadyExistsException{} + sv = &types.ServiceException{} } else { sv = *v } @@ -14254,7 +17244,7 @@ func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.Re return nil } -func awsRestjson1_deserializeDocumentResourceDependencyException(v **types.ResourceDependencyException, value interface{}) error { +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14267,9 +17257,9 @@ func awsRestjson1_deserializeDocumentResourceDependencyException(v **types.Resou return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceDependencyException + var sv *types.ServiceQuotaExceededException if *v == nil { - sv = &types.ResourceDependencyException{} + sv = &types.ServiceQuotaExceededException{} } else { sv = *v } @@ -14294,7 +17284,7 @@ func awsRestjson1_deserializeDocumentResourceDependencyException(v **types.Resou return nil } -func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { +func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14307,9 +17297,9 @@ func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceIn return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceInUseException + var sv *types.ServiceUnavailableException if *v == nil { - sv = &types.ResourceInUseException{} + sv = &types.ServiceUnavailableException{} } else { sv = *v } @@ -14334,7 +17324,7 @@ func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceIn return nil } -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsRestjson1_deserializeDocumentSeverityCounts(v **types.SeverityCounts, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14347,22 +17337,65 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException + var sv *types.SeverityCounts if *v == nil { - sv = &types.ResourceNotFoundException{} + sv = &types.SeverityCounts{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "all": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) } - sv.Message = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.All = ptr.Int64(i64) + } + + case "critical": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Critical = ptr.Int64(i64) + } + + case "high": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.High = ptr.Int64(i64) + } + + case "medium": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Medium = ptr.Int64(i64) } default: @@ -14374,7 +17407,7 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } -func awsRestjson1_deserializeDocumentResourceTagMap(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14382,35 +17415,35 @@ func awsRestjson1_deserializeDocumentResourceTagMap(v *map[string]string, value return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var cv []string if *v == nil { - mv = map[string]string{} + cv = []string{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal string + for _, value := range shape { + var col string if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - parsedVal = jtv + col = jtv } - mv[key] = parsedVal + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentS3ExportConfiguration(v **types.S3ExportConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentSystemsManagerAgent(v **types.SystemsManagerAgent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14423,49 +17456,22 @@ func awsRestjson1_deserializeDocumentS3ExportConfiguration(v **types.S3ExportCon return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.S3ExportConfiguration + var sv *types.SystemsManagerAgent if *v == nil { - sv = &types.S3ExportConfiguration{} + sv = &types.SystemsManagerAgent{} } else { sv = *v } for key, value := range shape { switch key { - case "diskImageFormat": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DiskImageFormat to be of type string, got %T instead", value) - } - sv.DiskImageFormat = types.DiskImageFormat(jtv) - } - - case "roleName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.RoleName = ptr.String(jtv) - } - - case "s3Bucket": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.S3Bucket = ptr.String(jtv) - } - - case "s3Prefix": + case "uninstallAfterBuild": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } - sv.S3Prefix = ptr.String(jtv) + sv.UninstallAfterBuild = ptr.Bool(jtv) } default: @@ -14477,7 +17483,7 @@ func awsRestjson1_deserializeDocumentS3ExportConfiguration(v **types.S3ExportCon return nil } -func awsRestjson1_deserializeDocumentS3Logs(v **types.S3Logs, value interface{}) error { +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14490,31 +17496,67 @@ func awsRestjson1_deserializeDocumentS3Logs(v **types.S3Logs, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.S3Logs + var mv map[string]string if *v == nil { - sv = &types.S3Logs{} + 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_deserializeDocumentTargetContainerRepository(v **types.TargetContainerRepository, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TargetContainerRepository + if *v == nil { + sv = &types.TargetContainerRepository{} } else { sv = *v } for key, value := range shape { switch key { - case "s3BucketName": + case "repositoryName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.S3BucketName = ptr.String(jtv) + sv.RepositoryName = ptr.String(jtv) } - case "s3KeyPrefix": + case "service": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ContainerRepositoryService to be of type string, got %T instead", value) } - sv.S3KeyPrefix = ptr.String(jtv) + sv.Service = types.ContainerRepositoryService(jtv) } default: @@ -14526,7 +17568,7 @@ func awsRestjson1_deserializeDocumentS3Logs(v **types.S3Logs, value interface{}) return nil } -func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, value interface{}) error { +func awsRestjson1_deserializeDocumentVulnerabilityIdAggregation(v **types.VulnerabilityIdAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14539,40 +17581,27 @@ func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Schedule + var sv *types.VulnerabilityIdAggregation if *v == nil { - sv = &types.Schedule{} + sv = &types.VulnerabilityIdAggregation{} } else { sv = *v } for key, value := range shape { switch key { - case "pipelineExecutionStartCondition": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PipelineExecutionStartCondition to be of type string, got %T instead", value) - } - sv.PipelineExecutionStartCondition = types.PipelineExecutionStartCondition(jtv) + case "severityCounts": + if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { + return err } - case "scheduleExpression": + case "vulnerabilityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ScheduleExpression = ptr.String(jtv) - } - - case "timezone": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Timezone to be of type string, got %T instead", value) - } - sv.Timezone = ptr.String(jtv) + sv.VulnerabilityId = ptr.String(jtv) } default: @@ -14584,7 +17613,7 @@ func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, value interfac return nil } -func awsRestjson1_deserializeDocumentSecurityGroupIds(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentVulnerabilityIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14609,7 +17638,7 @@ func awsRestjson1_deserializeDocumentSecurityGroupIds(v *[]string, value interfa if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected VulnerabilityId to be of type string, got %T instead", value) } col = jtv } @@ -14620,7 +17649,7 @@ func awsRestjson1_deserializeDocumentSecurityGroupIds(v *[]string, value interfa return nil } -func awsRestjson1_deserializeDocumentServiceException(v **types.ServiceException, value interface{}) error { +func awsRestjson1_deserializeDocumentVulnerablePackage(v **types.VulnerablePackage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14633,22 +17662,107 @@ func awsRestjson1_deserializeDocumentServiceException(v **types.ServiceException return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceException + var sv *types.VulnerablePackage if *v == nil { - sv = &types.ServiceException{} + sv = &types.VulnerablePackage{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "arch": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageArchitecture to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Arch = ptr.String(jtv) + } + + case "epoch": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PackageEpoch to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Epoch = ptr.Int32(int32(i64)) + } + + case "filePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FilePath = ptr.String(jtv) + } + + case "fixedInVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FixedInVersion = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "packageManager": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PackageManager = ptr.String(jtv) + } + + case "release": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Release = ptr.String(jtv) + } + + case "remediation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Remediation = ptr.String(jtv) + } + + case "sourceLayerHash": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceLayerHash to be of type string, got %T instead", value) + } + sv.SourceLayerHash = ptr.String(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) } default: @@ -14660,7 +17774,7 @@ func awsRestjson1_deserializeDocumentServiceException(v **types.ServiceException return nil } -func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { +func awsRestjson1_deserializeDocumentVulnerablePackageList(v *[]types.VulnerablePackage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14668,39 +17782,33 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceQuotaExceededException + var cv []types.VulnerablePackage if *v == nil { - sv = &types.ServiceQuotaExceededException{} + cv = []types.VulnerablePackage{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.VulnerablePackage + destAddr := &col + if err := awsRestjson1_deserializeDocumentVulnerablePackage(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { +func awsRestjson1_deserializeDocumentWorkflowExecutionMetadata(v **types.WorkflowExecutionMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14713,24 +17821,130 @@ func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.Servi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceUnavailableException + var sv *types.WorkflowExecutionMetadata if *v == nil { - sv = &types.ServiceUnavailableException{} + sv = &types.WorkflowExecutionMetadata{} } else { sv = *v } for key, value := range shape { switch key { + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.EndTime = ptr.String(jtv) + } + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkflowExecutionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.StartTime = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowExecutionStatus to be of type string, got %T instead", value) + } + sv.Status = types.WorkflowExecutionStatus(jtv) + } + + case "totalStepCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepCount = int32(i64) + } + + case "totalStepsFailed": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepsFailed = int32(i64) + } + + case "totalStepsSkipped": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepsSkipped = int32(i64) + } + + case "totalStepsSucceeded": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalStepsSucceeded = int32(i64) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowType to be of type string, got %T instead", value) + } + sv.Type = types.WorkflowType(jtv) + } + + case "workflowBuildVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) + } + sv.WorkflowBuildVersionArn = ptr.String(jtv) + } + + case "workflowExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) + } + sv.WorkflowExecutionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -14740,7 +17954,7 @@ func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.Servi return nil } -func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentWorkflowExecutionsList(v *[]types.WorkflowExecutionMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14753,22 +17967,20 @@ func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.WorkflowExecutionMetadata if *v == nil { - cv = []string{} + cv = []types.WorkflowExecutionMetadata{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - col = jtv + var col types.WorkflowExecutionMetadata + destAddr := &col + if err := awsRestjson1_deserializeDocumentWorkflowExecutionMetadata(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -14776,7 +17988,7 @@ func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) return nil } -func awsRestjson1_deserializeDocumentSystemsManagerAgent(v **types.SystemsManagerAgent, value interface{}) error { +func awsRestjson1_deserializeDocumentWorkflowStepExecutionsList(v *[]types.WorkflowStepMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14784,39 +17996,33 @@ func awsRestjson1_deserializeDocumentSystemsManagerAgent(v **types.SystemsManage return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SystemsManagerAgent + var cv []types.WorkflowStepMetadata if *v == nil { - sv = &types.SystemsManagerAgent{} + cv = []types.WorkflowStepMetadata{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "uninstallAfterBuild": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) - } - sv.UninstallAfterBuild = ptr.Bool(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.WorkflowStepMetadata + destAddr := &col + if err := awsRestjson1_deserializeDocumentWorkflowStepMetadata(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentWorkflowStepMetadata(v **types.WorkflowStepMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14829,67 +18035,112 @@ func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var sv *types.WorkflowStepMetadata if *v == nil { - mv = map[string]string{} + sv = &types.WorkflowStepMetadata{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + switch key { + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepAction to be of type string, got %T instead", value) + } + sv.Action = ptr.String(jtv) } - parsedVal = jtv - } - mv[key] = parsedVal - } - *v = mv - return nil -} + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } -func awsRestjson1_deserializeDocumentTargetContainerRepository(v **types.TargetContainerRepository, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.EndTime = ptr.String(jtv) + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "inputs": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepInputs to be of type string, got %T instead", value) + } + sv.Inputs = ptr.String(jtv) + } - var sv *types.TargetContainerRepository - if *v == nil { - sv = &types.TargetContainerRepository{} - } else { - sv = *v - } + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "repositoryName": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } - sv.RepositoryName = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "service": + case "outputs": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ContainerRepositoryService to be of type string, got %T instead", value) + return fmt.Errorf("expected WorkflowStepOutputs to be of type string, got %T instead", value) } - sv.Service = types.ContainerRepositoryService(jtv) + sv.Outputs = ptr.String(jtv) + } + + case "rollbackStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepExecutionRollbackStatus to be of type string, got %T instead", value) + } + sv.RollbackStatus = types.WorkflowStepExecutionRollbackStatus(jtv) + } + + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.StartTime = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepExecutionStatus to be of type string, got %T instead", value) + } + sv.Status = types.WorkflowStepExecutionStatus(jtv) + } + + case "stepExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkflowStepExecutionId to be of type string, got %T instead", value) + } + sv.StepExecutionId = ptr.String(jtv) } default: diff --git a/service/imagebuilder/generated.json b/service/imagebuilder/generated.json index 385d7f49a6a..234dffafc2b 100644 --- a/service/imagebuilder/generated.json +++ b/service/imagebuilder/generated.json @@ -34,6 +34,8 @@ "api_op_GetImageRecipe.go", "api_op_GetImageRecipePolicy.go", "api_op_GetInfrastructureConfiguration.go", + "api_op_GetWorkflowExecution.go", + "api_op_GetWorkflowStepExecution.go", "api_op_ImportComponent.go", "api_op_ImportVmImage.go", "api_op_ListComponentBuildVersions.go", @@ -45,9 +47,13 @@ "api_op_ListImagePipelineImages.go", "api_op_ListImagePipelines.go", "api_op_ListImageRecipes.go", + "api_op_ListImageScanFindingAggregations.go", + "api_op_ListImageScanFindings.go", "api_op_ListImages.go", "api_op_ListInfrastructureConfigurations.go", "api_op_ListTagsForResource.go", + "api_op_ListWorkflowExecutions.go", + "api_op_ListWorkflowStepExecutions.go", "api_op_PutComponentPolicy.go", "api_op_PutContainerRecipePolicy.go", "api_op_PutImagePolicy.go", diff --git a/service/imagebuilder/serializers.go b/service/imagebuilder/serializers.go index 91abff8919e..3b3d492477f 100644 --- a/service/imagebuilder/serializers.go +++ b/service/imagebuilder/serializers.go @@ -537,6 +537,13 @@ func awsRestjson1_serializeOpDocumentCreateImageInput(v *CreateImageInput, value ok.String(*v.ImageRecipeArn) } + if v.ImageScanningConfiguration != nil { + ok := object.Key("imageScanningConfiguration") + if err := awsRestjson1_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil { + return err + } + } + if v.ImageTestsConfiguration != nil { ok := object.Key("imageTestsConfiguration") if err := awsRestjson1_serializeDocumentImageTestsConfiguration(v.ImageTestsConfiguration, ok); err != nil { @@ -649,6 +656,13 @@ func awsRestjson1_serializeOpDocumentCreateImagePipelineInput(v *CreateImagePipe ok.String(*v.ImageRecipeArn) } + if v.ImageScanningConfiguration != nil { + ok := object.Key("imageScanningConfiguration") + if err := awsRestjson1_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil { + return err + } + } + if v.ImageTestsConfiguration != nil { ok := object.Key("imageTestsConfiguration") if err := awsRestjson1_serializeDocumentImageTestsConfiguration(v.ImageTestsConfiguration, ok); err != nil { @@ -1908,6 +1922,112 @@ func awsRestjson1_serializeOpHttpBindingsGetInfrastructureConfigurationInput(v * return nil } +type awsRestjson1_serializeOpGetWorkflowExecution struct { +} + +func (*awsRestjson1_serializeOpGetWorkflowExecution) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWorkflowExecution) 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.(*GetWorkflowExecutionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetWorkflowExecution") + 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_serializeOpHttpBindingsGetWorkflowExecutionInput(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_serializeOpHttpBindingsGetWorkflowExecutionInput(v *GetWorkflowExecutionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkflowExecutionId != nil { + encoder.SetQuery("workflowExecutionId").String(*v.WorkflowExecutionId) + } + + return nil +} + +type awsRestjson1_serializeOpGetWorkflowStepExecution struct { +} + +func (*awsRestjson1_serializeOpGetWorkflowStepExecution) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWorkflowStepExecution) 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.(*GetWorkflowStepExecutionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetWorkflowStepExecution") + 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_serializeOpHttpBindingsGetWorkflowStepExecutionInput(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_serializeOpHttpBindingsGetWorkflowStepExecutionInput(v *GetWorkflowStepExecutionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.StepExecutionId != nil { + encoder.SetQuery("stepExecutionId").String(*v.StepExecutionId) + } + + return nil +} + type awsRestjson1_serializeOpImportComponent struct { } @@ -2979,6 +3099,161 @@ func awsRestjson1_serializeOpDocumentListImagesInput(v *ListImagesInput, value s return nil } +type awsRestjson1_serializeOpListImageScanFindingAggregations struct { +} + +func (*awsRestjson1_serializeOpListImageScanFindingAggregations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListImageScanFindingAggregations) 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.(*ListImageScanFindingAggregationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListImageScanFindingAggregations") + 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_serializeOpDocumentListImageScanFindingAggregationsInput(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_serializeOpHttpBindingsListImageScanFindingAggregationsInput(v *ListImageScanFindingAggregationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListImageScanFindingAggregationsInput(v *ListImageScanFindingAggregationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filter != nil { + ok := object.Key("filter") + if err := awsRestjson1_serializeDocumentFilter(v.Filter, ok); err != nil { + return err + } + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListImageScanFindings struct { +} + +func (*awsRestjson1_serializeOpListImageScanFindings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListImageScanFindings) 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.(*ListImageScanFindingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListImageScanFindings") + 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_serializeOpDocumentListImageScanFindingsInput(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_serializeOpHttpBindingsListImageScanFindingsInput(v *ListImageScanFindingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListImageScanFindingsInput(v *ListImageScanFindingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentImageScanFindingsFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListInfrastructureConfigurations struct { } @@ -3117,6 +3392,162 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } +type awsRestjson1_serializeOpListWorkflowExecutions struct { +} + +func (*awsRestjson1_serializeOpListWorkflowExecutions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWorkflowExecutions) 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.(*ListWorkflowExecutionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListWorkflowExecutions") + 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_serializeOpDocumentListWorkflowExecutionsInput(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_serializeOpHttpBindingsListWorkflowExecutionsInput(v *ListWorkflowExecutionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListWorkflowExecutionsInput(v *ListWorkflowExecutionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ImageBuildVersionArn != nil { + ok := object.Key("imageBuildVersionArn") + ok.String(*v.ImageBuildVersionArn) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListWorkflowStepExecutions struct { +} + +func (*awsRestjson1_serializeOpListWorkflowStepExecutions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWorkflowStepExecutions) 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.(*ListWorkflowStepExecutionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListWorkflowStepExecutions") + 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_serializeOpDocumentListWorkflowStepExecutionsInput(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_serializeOpHttpBindingsListWorkflowStepExecutionsInput(v *ListWorkflowStepExecutionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListWorkflowStepExecutionsInput(v *ListWorkflowStepExecutionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.WorkflowExecutionId != nil { + ok := object.Key("workflowExecutionId") + ok.String(*v.WorkflowExecutionId) + } + + return nil +} + type awsRestjson1_serializeOpPutComponentPolicy struct { } @@ -3809,6 +4240,13 @@ func awsRestjson1_serializeOpDocumentUpdateImagePipelineInput(v *UpdateImagePipe ok.String(*v.ImageRecipeArn) } + if v.ImageScanningConfiguration != nil { + ok := object.Key("imageScanningConfiguration") + if err := awsRestjson1_serializeDocumentImageScanningConfiguration(v.ImageScanningConfiguration, ok); err != nil { + return err + } + } + if v.ImageTestsConfiguration != nil { ok := object.Key("imageTestsConfiguration") if err := awsRestjson1_serializeDocumentImageTestsConfiguration(v.ImageTestsConfiguration, ok); err != nil { @@ -4262,6 +4700,25 @@ func awsRestjson1_serializeDocumentEbsInstanceBlockDeviceSpecification(v *types. return nil } +func awsRestjson1_serializeDocumentEcrConfiguration(v *types.EcrConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContainerTags != nil { + ok := object.Key("containerTags") + if err := awsRestjson1_serializeDocumentStringList(v.ContainerTags, ok); err != nil { + return err + } + } + + if v.RepositoryName != nil { + ok := object.Key("repositoryName") + ok.String(*v.RepositoryName) + } + + return nil +} + func awsRestjson1_serializeDocumentFastLaunchConfiguration(v *types.FastLaunchConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4388,6 +4845,68 @@ func awsRestjson1_serializeDocumentFilterValues(v []string, value smithyjson.Val return nil } +func awsRestjson1_serializeDocumentImageScanFindingsFilter(v *types.ImageScanFindingsFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Values != nil { + ok := object.Key("values") + if err := awsRestjson1_serializeDocumentImageScanFindingsFilterValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentImageScanFindingsFilterList(v []types.ImageScanFindingsFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentImageScanFindingsFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentImageScanFindingsFilterValues(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_serializeDocumentImageScanningConfiguration(v *types.ImageScanningConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EcrConfiguration != nil { + ok := object.Key("ecrConfiguration") + if err := awsRestjson1_serializeDocumentEcrConfiguration(v.EcrConfiguration, ok); err != nil { + return err + } + } + + if v.ImageScanningEnabled != nil { + ok := object.Key("imageScanningEnabled") + ok.Boolean(*v.ImageScanningEnabled) + } + + return nil +} + func awsRestjson1_serializeDocumentImageTestsConfiguration(v *types.ImageTestsConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/imagebuilder/types/enums.go b/service/imagebuilder/types/enums.go index 0911905ed55..5879d7c4479 100644 --- a/service/imagebuilder/types/enums.go +++ b/service/imagebuilder/types/enums.go @@ -152,6 +152,34 @@ func (EbsVolumeType) Values() []EbsVolumeType { } } +type ImageScanStatus string + +// Enum values for ImageScanStatus +const ( + ImageScanStatusPending ImageScanStatus = "PENDING" + ImageScanStatusScanning ImageScanStatus = "SCANNING" + ImageScanStatusCollecting ImageScanStatus = "COLLECTING" + ImageScanStatusCompleted ImageScanStatus = "COMPLETED" + ImageScanStatusAbandoned ImageScanStatus = "ABANDONED" + ImageScanStatusFailed ImageScanStatus = "FAILED" + ImageScanStatusTimedOut ImageScanStatus = "TIMED_OUT" +) + +// Values returns all known values for ImageScanStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ImageScanStatus) Values() []ImageScanStatus { + return []ImageScanStatus{ + "PENDING", + "SCANNING", + "COLLECTING", + "COMPLETED", + "ABANDONED", + "FAILED", + "TIMED_OUT", + } +} + type ImageSource string // Enum values for ImageSource @@ -304,3 +332,98 @@ func (Platform) Values() []Platform { "Linux", } } + +type WorkflowExecutionStatus string + +// Enum values for WorkflowExecutionStatus +const ( + WorkflowExecutionStatusPending WorkflowExecutionStatus = "PENDING" + WorkflowExecutionStatusSkipped WorkflowExecutionStatus = "SKIPPED" + WorkflowExecutionStatusRunning WorkflowExecutionStatus = "RUNNING" + WorkflowExecutionStatusCompleted WorkflowExecutionStatus = "COMPLETED" + WorkflowExecutionStatusFailed WorkflowExecutionStatus = "FAILED" + WorkflowExecutionStatusRollbackInProgress WorkflowExecutionStatus = "ROLLBACK_IN_PROGRESS" + WorkflowExecutionStatusRollbackCompleted WorkflowExecutionStatus = "ROLLBACK_COMPLETED" +) + +// Values returns all known values for WorkflowExecutionStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (WorkflowExecutionStatus) Values() []WorkflowExecutionStatus { + return []WorkflowExecutionStatus{ + "PENDING", + "SKIPPED", + "RUNNING", + "COMPLETED", + "FAILED", + "ROLLBACK_IN_PROGRESS", + "ROLLBACK_COMPLETED", + } +} + +type WorkflowStepExecutionRollbackStatus string + +// Enum values for WorkflowStepExecutionRollbackStatus +const ( + WorkflowStepExecutionRollbackStatusRunning WorkflowStepExecutionRollbackStatus = "RUNNING" + WorkflowStepExecutionRollbackStatusCompleted WorkflowStepExecutionRollbackStatus = "COMPLETED" + WorkflowStepExecutionRollbackStatusSkipped WorkflowStepExecutionRollbackStatus = "SKIPPED" + WorkflowStepExecutionRollbackStatusFailed WorkflowStepExecutionRollbackStatus = "FAILED" +) + +// Values returns all known values for WorkflowStepExecutionRollbackStatus. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (WorkflowStepExecutionRollbackStatus) Values() []WorkflowStepExecutionRollbackStatus { + return []WorkflowStepExecutionRollbackStatus{ + "RUNNING", + "COMPLETED", + "SKIPPED", + "FAILED", + } +} + +type WorkflowStepExecutionStatus string + +// Enum values for WorkflowStepExecutionStatus +const ( + WorkflowStepExecutionStatusPending WorkflowStepExecutionStatus = "PENDING" + WorkflowStepExecutionStatusSkipped WorkflowStepExecutionStatus = "SKIPPED" + WorkflowStepExecutionStatusRunning WorkflowStepExecutionStatus = "RUNNING" + WorkflowStepExecutionStatusCompleted WorkflowStepExecutionStatus = "COMPLETED" + WorkflowStepExecutionStatusFailed WorkflowStepExecutionStatus = "FAILED" +) + +// Values returns all known values for WorkflowStepExecutionStatus. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (WorkflowStepExecutionStatus) Values() []WorkflowStepExecutionStatus { + return []WorkflowStepExecutionStatus{ + "PENDING", + "SKIPPED", + "RUNNING", + "COMPLETED", + "FAILED", + } +} + +type WorkflowType string + +// Enum values for WorkflowType +const ( + WorkflowTypeBuild WorkflowType = "BUILD" + WorkflowTypeTest WorkflowType = "TEST" + WorkflowTypeDistribution WorkflowType = "DISTRIBUTION" +) + +// Values returns all known values for WorkflowType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (WorkflowType) Values() []WorkflowType { + return []WorkflowType{ + "BUILD", + "TEST", + "DISTRIBUTION", + } +} diff --git a/service/imagebuilder/types/errors.go b/service/imagebuilder/types/errors.go index 8b34a4219c6..e51dc09b02b 100644 --- a/service/imagebuilder/types/errors.go +++ b/service/imagebuilder/types/errors.go @@ -224,7 +224,7 @@ func (e *InvalidParameterValueException) ErrorCode() string { } func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You have made a request for an action that is not supported by the service. +// You have requested an action that that the service doesn't support. type InvalidRequestException struct { Message *string diff --git a/service/imagebuilder/types/types.go b/service/imagebuilder/types/types.go index 438f79e773c..6ef0bcc61c9 100644 --- a/service/imagebuilder/types/types.go +++ b/service/imagebuilder/types/types.go @@ -4,8 +4,25 @@ package types import ( smithydocument "github.com/aws/smithy-go/document" + "time" ) +// Contains counts of vulnerability findings from image scans that run when you +// create new Image Builder images, or build new versions of existing images. The +// vulnerability counts are grouped by severity level. The counts are aggregated +// across resources to create the final tally for the account that owns them. +type AccountAggregation struct { + + // Identifies the account that owns the aggregated resource findings. + AccountId *string + + // Counts by severity level for medium severity and higher level findings, plus a + // total for all of the findings. + SeverityCounts *SeverityCounts + + noSmithyDocumentSerde +} + // In addition to your infrastructure configuration, these settings provide an // extra layer of control over your build instances. You can also specify commands // to run on launch for all of your build instances. Image Builder does not @@ -52,7 +69,7 @@ type Ami struct { // The Amazon Web Services Region of the Amazon EC2 AMI. Region *string - // Image state shows the image status and the reason for that status. + // Image status and the reason for that status. State *ImageState noSmithyDocumentSerde @@ -480,6 +497,70 @@ type ContainerRecipeSummary struct { noSmithyDocumentSerde } +// Amazon Inspector generates a risk score for each finding. This score helps you +// to prioritize findings, to focus on the most critical findings and the most +// vulnerable resources. The score uses the Common Vulnerability Scoring System +// (CVSS) format. This format is a modification of the base CVSS score that the +// National Vulnerability Database (NVD) provides. For more information about +// severity levels, see Severity levels for Amazon Inspector findings +// (https://docs.aws.amazon.com/inspector/latest/user/findings-understanding-severity.html) +// in the Amazon Inspector User Guide. +type CvssScore struct { + + // The CVSS base score. + BaseScore *float64 + + // The vector string of the CVSS score. + ScoringVector *string + + // The source of the CVSS score. + Source *string + + // The CVSS version that generated the score. + Version *string + + noSmithyDocumentSerde +} + +// Details about an adjustment that Amazon Inspector made to the CVSS score for a +// finding. +type CvssScoreAdjustment struct { + + // The metric that Amazon Inspector used to adjust the CVSS score. + Metric *string + + // The reason for the CVSS score adjustment. + Reason *string + + noSmithyDocumentSerde +} + +// Details about the source of the score, and the factors that determined the +// adjustments to create the final score. +type CvssScoreDetails struct { + + // An object that contains details about an adjustment that Amazon Inspector made + // to the CVSS score for the finding. + Adjustments []CvssScoreAdjustment + + // The source of the finding. + CvssSource *string + + // The CVSS score. + Score *float64 + + // The source for the CVSS score. + ScoreSource *string + + // A vector that measures the severity of the vulnerability. + ScoringVector *string + + // The CVSS version that generated the score. + Version *string + + noSmithyDocumentSerde +} + // Defines the settings for a specific Region. type Distribution struct { @@ -603,6 +684,25 @@ type EbsInstanceBlockDeviceSpecification struct { noSmithyDocumentSerde } +// Settings that Image Builder uses to configure the ECR repository and the output +// container images that Amazon Inspector scans. +type EcrConfiguration struct { + + // Tags for Image Builder to apply to the output container image that &INS; scans. + // Tags can help you identify and manage your scanned images. + ContainerTags []string + + // The name of the container repository that Amazon Inspector scans to identify + // findings for your container images. The name includes the path for the + // repository location. If you don’t provide this information, Image Builder + // creates a repository in your account named + // image-builder-image-scanning-repository for vulnerability scans of your output + // container images. + RepositoryName *string + + noSmithyDocumentSerde +} + // Define and configure faster launching for output Windows AMIs. type FastLaunchConfiguration struct { @@ -726,6 +826,9 @@ type Image struct { // used to create the image. For container images, this is empty. ImageRecipe *ImageRecipe + // Contains settings for vulnerability scans. + ImageScanningConfiguration *ImageScanningConfiguration + // The origin of the base image that Image Builder used to build this image. ImageSource ImageSource @@ -748,6 +851,9 @@ type Image struct { // The image operating system platform, such as Linux or Windows. Platform Platform + // Contains information about the current state of scans for this image. + ScanState *ImageScanState + // The Amazon Resource Name (ARN) of the image pipeline that created this image. SourcePipelineArn *string @@ -780,6 +886,19 @@ type Image struct { noSmithyDocumentSerde } +// Contains vulnerability counts for a specific image. +type ImageAggregation struct { + + // The Amazon Resource Name (ARN) that identifies the image for this aggregation. + ImageBuildVersionArn *string + + // Counts by severity level for medium severity and higher level findings, plus a + // total for all of the findings for the specified image. + SeverityCounts *SeverityCounts + + noSmithyDocumentSerde +} + // Represents a package installed on an Image Builder image. type ImagePackage struct { @@ -830,6 +949,9 @@ type ImagePipeline struct { // pipeline. ImageRecipeArn *string + // Contains settings for vulnerability scans. + ImageScanningConfiguration *ImageScanningConfiguration + // The image tests configuration of the image pipeline. ImageTestsConfiguration *ImageTestsConfiguration @@ -855,6 +977,20 @@ type ImagePipeline struct { noSmithyDocumentSerde } +// Contains vulnerability counts for a specific image pipeline. +type ImagePipelineAggregation struct { + + // The Amazon Resource Name (ARN) that identifies the image pipeline for this + // aggregation. + ImagePipelineArn *string + + // Counts by severity level for medium severity and higher level findings, plus a + // total for all of the findings for the specified image pipeline. + SeverityCounts *SeverityCounts + + noSmithyDocumentSerde +} + // An image recipe. type ImageRecipe struct { @@ -936,10 +1072,122 @@ type ImageRecipeSummary struct { noSmithyDocumentSerde } -// Image state shows the image status and the reason for that status. +// Contains details about a vulnerability scan finding. +type ImageScanFinding struct { + + // The Amazon Web Services account ID that's associated with the finding. + AwsAccountId *string + + // The description of the finding. + Description *string + + // The date and time when the finding was first observed. + FirstObservedAt *time.Time + + // Details about whether a fix is available for any of the packages that are + // identified in the finding through a version update. + FixAvailable *string + + // The Amazon Resource Name (ARN) of the image build version that's associated with + // the finding. + ImageBuildVersionArn *string + + // The Amazon Resource Name (ARN) of the image pipeline that's associated with the + // finding. + ImagePipelineArn *string + + // The score that Amazon Inspector assigned for the finding. + InspectorScore *float64 + + // An object that contains details of the Amazon Inspector score. + InspectorScoreDetails *InspectorScoreDetails + + // An object that contains the details of a package vulnerability finding. + PackageVulnerabilityDetails *PackageVulnerabilityDetails + + // An object that contains the details about how to remediate the finding. + Remediation *Remediation + + // The severity of the finding. + Severity *string + + // The title of the finding. + Title *string + + // The type of the finding. Image Builder looks for findings of the type + // PACKAGE_VULNERABILITY that apply to output images, and excludes other types. + Type *string + + // The timestamp when the finding was last updated. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// This returns exactly one type of aggregation, based on the filter that Image +// Builder applies in its API action. +type ImageScanFindingAggregation struct { + + // Returns an object that contains severity counts based on an account ID. + AccountAggregation *AccountAggregation + + // Returns an object that contains severity counts based on the Amazon Resource + // Name (ARN) for a specific image. + ImageAggregation *ImageAggregation + + // Returns an object that contains severity counts based on an image pipeline ARN. + ImagePipelineAggregation *ImagePipelineAggregation + + // Returns an object that contains severity counts based on vulnerability ID. + VulnerabilityIdAggregation *VulnerabilityIdAggregation + + noSmithyDocumentSerde +} + +// A name value pair that Image Builder applies to streamline results from the +// vulnerability scan findings list action. +type ImageScanFindingsFilter struct { + + // The name of the image scan finding filter. Filter names are case-sensitive. + Name *string + + // The filter values. Filter values are case-sensitive. + Values []string + + noSmithyDocumentSerde +} + +// Contains settings for Image Builder image resource and container image scans. +type ImageScanningConfiguration struct { + + // Contains Amazon ECR settings for vulnerability scans. + EcrConfiguration *EcrConfiguration + + // A setting that indicates whether Image Builder keeps a snapshot of the + // vulnerability scans that Amazon Inspector runs against the build instance when + // you create a new image. + ImageScanningEnabled *bool + + noSmithyDocumentSerde +} + +// Shows the vulnerability scan status for a specific image, and the reason for +// that status. +type ImageScanState struct { + + // The reason for the scan status for the image. + Reason *string + + // The current state of vulnerability scans for the image. + Status ImageScanStatus + + noSmithyDocumentSerde +} + +// Image status and the reason for that status. type ImageState struct { - // The reason for the image's status. + // The reason for the status of the image. Reason *string // The status of the image. @@ -1184,6 +1432,17 @@ type InfrastructureConfigurationSummary struct { noSmithyDocumentSerde } +// Information about the factors that influenced the score that Amazon Inspector +// assigned for a finding. +type InspectorScoreDetails struct { + + // An object that contains details about an adjustment that Amazon Inspector made + // to the CVSS score for the finding. + AdjustedCvss *CvssScoreDetails + + noSmithyDocumentSerde +} + // Defines block device mappings for the instance used to configure your image. type InstanceBlockDeviceMapping struct { @@ -1321,6 +1580,71 @@ type OutputResources struct { noSmithyDocumentSerde } +// Information about package vulnerability findings. +type PackageVulnerabilityDetails struct { + + // A unique identifier for this vulnerability. + // + // This member is required. + VulnerabilityId *string + + // CVSS scores for one or more vulnerabilities that Amazon Inspector identified for + // a package. + Cvss []CvssScore + + // Links to web pages that contain details about the vulnerabilities that Amazon + // Inspector identified for the package. + ReferenceUrls []string + + // Vulnerabilities that are often related to the findings for the package. + RelatedVulnerabilities []string + + // The source of the vulnerability information. + Source *string + + // A link to the source of the vulnerability information. + SourceUrl *string + + // The date and time when this vulnerability was first added to the vendor's + // database. + VendorCreatedAt *time.Time + + // The severity that the vendor assigned to this vulnerability type. + VendorSeverity *string + + // The date and time when the vendor last updated this vulnerability in their + // database. + VendorUpdatedAt *time.Time + + // The packages that this vulnerability impacts. + VulnerablePackages []VulnerablePackage + + noSmithyDocumentSerde +} + +// Information about how to remediate a finding. +type Remediation struct { + + // An object that contains information about the recommended course of action to + // remediate the finding. + Recommendation *RemediationRecommendation + + noSmithyDocumentSerde +} + +// Details about the recommended course of action to remediate the finding. +type RemediationRecommendation struct { + + // The recommended course of action to remediate the finding. + Text *string + + // A link to more information about the recommended remediation for this + // vulnerability. + Url *string + + noSmithyDocumentSerde +} + // Properties that configure export from your build instance to a compatible file // format for your VM. type S3ExportConfiguration struct { @@ -1402,6 +1726,26 @@ type Schedule struct { noSmithyDocumentSerde } +// Includes counts by severity level for medium severity and higher level findings, +// plus a total for all of the findings for the specified filter. +type SeverityCounts struct { + + // The total number of findings across all severity levels for the specified + // filter. + All *int64 + + // The number of critical severity findings for the specified filter. + Critical *int64 + + // The number of high severity findings for the specified filter. + High *int64 + + // The number of medium severity findings for the specified filter. + Medium *int64 + + noSmithyDocumentSerde +} + // Contains settings for the Systems Manager agent on your build instance. type SystemsManagerAgent struct { @@ -1431,4 +1775,137 @@ type TargetContainerRepository struct { noSmithyDocumentSerde } +// Includes counts of image and pipeline resource findings by vulnerability. +type VulnerabilityIdAggregation struct { + + // Counts by severity level for medium severity and higher level findings, plus a + // total for all of the findings for the specified vulnerability. + SeverityCounts *SeverityCounts + + // The vulnerability Id for this set of counts. + VulnerabilityId *string + + noSmithyDocumentSerde +} + +// Information about a vulnerable package that Amazon Inspector identifies in a +// finding. +type VulnerablePackage struct { + + // The architecture of the vulnerable package. + Arch *string + + // The epoch of the vulnerable package. + Epoch *int32 + + // The file path of the vulnerable package. + FilePath *string + + // The version of the package that contains the vulnerability fix. + FixedInVersion *string + + // The name of the vulnerable package. + Name *string + + // The package manager of the vulnerable package. + PackageManager *string + + // The release of the vulnerable package. + Release *string + + // The code to run in your environment to update packages with a fix available. + Remediation *string + + // The source layer hash of the vulnerable package. + SourceLayerHash *string + + // The version of the vulnerable package. + Version *string + + noSmithyDocumentSerde +} + +// Metadata that includes details and status from this runtime instance of the +// workflow. +type WorkflowExecutionMetadata struct { + + // The timestamp when this runtime instance of the workflow finished. + EndTime *string + + // The runtime output message from the workflow, if applicable. + Message *string + + // The timestamp when the runtime instance of this workflow started. + StartTime *string + + // The current runtime status for this workflow. + Status WorkflowExecutionStatus + + // The total number of steps in the workflow. This should equal the sum of the step + // counts for steps that succeeded, were skipped, and failed. + TotalStepCount int32 + + // A runtime count for the number of steps in the workflow that failed. + TotalStepsFailed int32 + + // A runtime count for the number of steps in the workflow that were skipped. + TotalStepsSkipped int32 + + // A runtime count for the number of steps in the workflow that ran successfully. + TotalStepsSucceeded int32 + + // Indicates what type of workflow that Image Builder ran for this runtime instance + // of the workflow. + Type WorkflowType + + // The Amazon Resource Name (ARN) of the workflow resource build version that ran. + WorkflowBuildVersionArn *string + + // Unique identifier that Image Builder assigns to keep track of runtime resources + // each time it runs a workflow. + WorkflowExecutionId *string + + noSmithyDocumentSerde +} + +// Runtime details and status for the workflow step. +type WorkflowStepMetadata struct { + + // The step action name. + Action *string + + // Description of the workflow step. + Description *string + + // The timestamp when the workflow step finished. + EndTime *string + + // Input parameters that Image Builder provides for the workflow step. + Inputs *string + + // Detailed output message that the workflow step provides at runtime. + Message *string + + // The name of the workflow step. + Name *string + + // The file names that the workflow step created as output for this runtime + // instance of the workflow. + Outputs *string + + // Reports on the rollback status of the step, if applicable. + RollbackStatus WorkflowStepExecutionRollbackStatus + + // The timestamp when the workflow step started. + StartTime *string + + // Runtime status for the workflow step. + Status WorkflowStepExecutionStatus + + // A unique identifier for the workflow step, assigned at runtime. + StepExecutionId *string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/imagebuilder/validators.go b/service/imagebuilder/validators.go index dc2b4e5bff2..72672a7f333 100644 --- a/service/imagebuilder/validators.go +++ b/service/imagebuilder/validators.go @@ -530,6 +530,46 @@ func (m *validateOpGetInfrastructureConfiguration) HandleInitialize(ctx context. return next.HandleInitialize(ctx, in) } +type validateOpGetWorkflowExecution struct { +} + +func (*validateOpGetWorkflowExecution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWorkflowExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWorkflowExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWorkflowExecutionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWorkflowStepExecution struct { +} + +func (*validateOpGetWorkflowStepExecution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWorkflowStepExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWorkflowStepExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWorkflowStepExecutionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpImportComponent struct { } @@ -670,6 +710,46 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListWorkflowExecutions struct { +} + +func (*validateOpListWorkflowExecutions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListWorkflowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListWorkflowExecutionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListWorkflowExecutionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListWorkflowStepExecutions struct { +} + +func (*validateOpListWorkflowStepExecutions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListWorkflowStepExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListWorkflowStepExecutionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListWorkflowStepExecutionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutComponentPolicy struct { } @@ -974,6 +1054,14 @@ func addOpGetInfrastructureConfigurationValidationMiddleware(stack *middleware.S return stack.Initialize.Add(&validateOpGetInfrastructureConfiguration{}, middleware.After) } +func addOpGetWorkflowExecutionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWorkflowExecution{}, middleware.After) +} + +func addOpGetWorkflowStepExecutionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWorkflowStepExecution{}, middleware.After) +} + func addOpImportComponentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportComponent{}, middleware.After) } @@ -1002,6 +1090,14 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpListWorkflowExecutionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListWorkflowExecutions{}, middleware.After) +} + +func addOpListWorkflowStepExecutionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListWorkflowStepExecutions{}, middleware.After) +} + func addOpPutComponentPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutComponentPolicy{}, middleware.After) } @@ -1754,6 +1850,36 @@ func validateOpGetInfrastructureConfigurationInput(v *GetInfrastructureConfigura } } +func validateOpGetWorkflowExecutionInput(v *GetWorkflowExecutionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWorkflowExecutionInput"} + if v.WorkflowExecutionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkflowExecutionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWorkflowStepExecutionInput(v *GetWorkflowStepExecutionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWorkflowStepExecutionInput"} + if v.StepExecutionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("StepExecutionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpImportComponentInput(v *ImportComponentInput) error { if v == nil { return nil @@ -1886,6 +2012,36 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpListWorkflowExecutionsInput(v *ListWorkflowExecutionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListWorkflowExecutionsInput"} + if v.ImageBuildVersionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImageBuildVersionArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListWorkflowStepExecutionsInput(v *ListWorkflowStepExecutionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListWorkflowStepExecutionsInput"} + if v.WorkflowExecutionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkflowExecutionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutComponentPolicyInput(v *PutComponentPolicyInput) error { if v == nil { return nil diff --git a/service/ivs/api_op_CreateChannel.go b/service/ivs/api_op_CreateChannel.go index d510392cfd9..9b69bd70f08 100644 --- a/service/ivs/api_op_CreateChannel.go +++ b/service/ivs/api_op_CreateChannel.go @@ -33,6 +33,9 @@ type CreateChannelInput struct { // false. Authorized bool + // Whether the channel allows insecure RTMP ingest. Default: false. + InsecureIngest bool + // Channel latency mode. Use NORMAL to broadcast and deliver live video up to Full // HD. Use LOW for near-real-time interaction with viewers. (Note: In the Amazon // IVS console, LOW and NORMAL correspond to Ultra-low and Standard, respectively.) diff --git a/service/ivs/api_op_UpdateChannel.go b/service/ivs/api_op_UpdateChannel.go index 1915927a689..7f126b55ac1 100644 --- a/service/ivs/api_op_UpdateChannel.go +++ b/service/ivs/api_op_UpdateChannel.go @@ -39,6 +39,9 @@ type UpdateChannelInput struct { // Whether the channel is private (enabled for playback authorization). Authorized bool + // Whether the channel allows insecure RTMP ingest. Default: false. + InsecureIngest bool + // Channel latency mode. Use NORMAL to broadcast and deliver live video up to Full // HD. Use LOW for near-real-time interaction with viewers. (Note: In the Amazon // IVS console, LOW and NORMAL correspond to Ultra-low and Standard, respectively.) diff --git a/service/ivs/deserializers.go b/service/ivs/deserializers.go index c7f39142066..93c6a0d25cb 100644 --- a/service/ivs/deserializers.go +++ b/service/ivs/deserializers.go @@ -4550,6 +4550,15 @@ func awsRestjson1_deserializeDocumentChannel(v **types.Channel, value interface{ sv.IngestEndpoint = ptr.String(jtv) } + case "insecureIngest": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected InsecureIngest to be of type *bool, got %T instead", value) + } + sv.InsecureIngest = jtv + } + case "latencyMode": if value != nil { jtv, ok := value.(string) @@ -4757,6 +4766,15 @@ func awsRestjson1_deserializeDocumentChannelSummary(v **types.ChannelSummary, va sv.Authorized = jtv } + case "insecureIngest": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected InsecureIngest to be of type *bool, got %T instead", value) + } + sv.InsecureIngest = jtv + } + case "latencyMode": if value != nil { jtv, ok := value.(string) diff --git a/service/ivs/serializers.go b/service/ivs/serializers.go index 4b4c9bac8b1..d638865ce48 100644 --- a/service/ivs/serializers.go +++ b/service/ivs/serializers.go @@ -219,6 +219,11 @@ func awsRestjson1_serializeOpDocumentCreateChannelInput(v *CreateChannelInput, v ok.Boolean(v.Authorized) } + if v.InsecureIngest { + ok := object.Key("insecureIngest") + ok.Boolean(v.InsecureIngest) + } + if len(v.LatencyMode) > 0 { ok := object.Key("latencyMode") ok.String(string(v.LatencyMode)) @@ -2064,6 +2069,11 @@ func awsRestjson1_serializeOpDocumentUpdateChannelInput(v *UpdateChannelInput, v ok.Boolean(v.Authorized) } + if v.InsecureIngest { + ok := object.Key("insecureIngest") + ok.Boolean(v.InsecureIngest) + } + if len(v.LatencyMode) > 0 { ok := object.Key("latencyMode") ok.String(string(v.LatencyMode)) diff --git a/service/ivs/types/types.go b/service/ivs/types/types.go index 5f49a5956b7..49f1eeb9031 100644 --- a/service/ivs/types/types.go +++ b/service/ivs/types/types.go @@ -57,6 +57,9 @@ type Channel struct { // you set up streaming software. IngestEndpoint *string + // Whether the channel allows insecure RTMP ingest. Default: false. + InsecureIngest bool + // Channel latency mode. Use NORMAL to broadcast and deliver live video up to Full // HD. Use LOW for near-real-time interaction with viewers. Default: LOW. (Note: In // the Amazon IVS console, LOW and NORMAL correspond to Ultra-low and Standard, @@ -112,6 +115,9 @@ type ChannelSummary struct { // false. Authorized bool + // Whether the channel allows insecure RTMP ingest. Default: false. + InsecureIngest bool + // Channel latency mode. Use NORMAL to broadcast and deliver live video up to Full // HD. Use LOW for near-real-time interaction with viewers. Default: LOW. (Note: In // the Amazon IVS console, LOW and NORMAL correspond to Ultra-low and Standard, diff --git a/service/kendra/api_op_BatchDeleteFeaturedResultsSet.go b/service/kendra/api_op_BatchDeleteFeaturedResultsSet.go new file mode 100644 index 00000000000..9a3b490e971 --- /dev/null +++ b/service/kendra/api_op_BatchDeleteFeaturedResultsSet.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendra + +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/kendra/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes one or more sets of featured results. Features results are placed above +// all other results for certain queries. If there's an exact match of a query, +// then one or more specific documents are featured in the search results. +func (c *Client) BatchDeleteFeaturedResultsSet(ctx context.Context, params *BatchDeleteFeaturedResultsSetInput, optFns ...func(*Options)) (*BatchDeleteFeaturedResultsSetOutput, error) { + if params == nil { + params = &BatchDeleteFeaturedResultsSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDeleteFeaturedResultsSet", params, optFns, c.addOperationBatchDeleteFeaturedResultsSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDeleteFeaturedResultsSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDeleteFeaturedResultsSetInput struct { + + // The identifiers of the featured results sets that you want to delete. + // + // This member is required. + FeaturedResultsSetIds []string + + // The identifier of the index used for featuring results. + // + // This member is required. + IndexId *string + + noSmithyDocumentSerde +} + +type BatchDeleteFeaturedResultsSetOutput struct { + + // The list of errors for the featured results set IDs, explaining why they + // couldn't be removed from the index. + // + // This member is required. + Errors []types.BatchDeleteFeaturedResultsSetError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDeleteFeaturedResultsSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteFeaturedResultsSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDeleteFeaturedResultsSet{}, 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 = addOpBatchDeleteFeaturedResultsSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteFeaturedResultsSet(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_opBatchDeleteFeaturedResultsSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "kendra", + OperationName: "BatchDeleteFeaturedResultsSet", + } +} diff --git a/service/kendra/api_op_BatchPutDocument.go b/service/kendra/api_op_BatchPutDocument.go index 88011edebda..bef8921a7d3 100644 --- a/service/kendra/api_op_BatchPutDocument.go +++ b/service/kendra/api_op_BatchPutDocument.go @@ -41,15 +41,12 @@ type BatchPutDocumentInput struct { // One or more documents to add to the index. Documents have the following file // size limits. // - // * 5 MB total size for inline documents + // * 50 MB total size for any file // - // * 50 MB total size for - // files from an S3 bucket + // * 5 MB extracted text for any + // file // - // * 5 MB extracted text for any file - // - // For more - // information about file size and transaction per second quotas, see Quotas + // For more information, see Quotas // (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html). // // This member is required. @@ -69,8 +66,8 @@ type BatchPutDocumentInput struct { // (https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html). CustomDocumentEnrichmentConfiguration *types.CustomDocumentEnrichmentConfiguration - // The Amazon Resource Name (ARN) of a role that is allowed to run the - // BatchPutDocument API. For more information, see IAM Roles for Amazon Kendra + // The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 + // bucket. For more information, see IAM access roles for Amazon Kendra // (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). RoleArn *string diff --git a/service/kendra/api_op_CreateDataSource.go b/service/kendra/api_op_CreateDataSource.go index e2f836255a7..3445f8ddacf 100644 --- a/service/kendra/api_op_CreateDataSource.go +++ b/service/kendra/api_op_CreateDataSource.go @@ -17,11 +17,8 @@ import ( // data source. You also specify configuration information for the data source // connector. CreateDataSource is a synchronous operation. The operation returns // 200 if the data source was successfully created. Otherwise, an exception is -// raised. Amazon S3 and custom -// (https://docs.aws.amazon.com/kendra/latest/dg/data-source-custom.html) data -// sources are the only supported data sources in the Amazon Web Services GovCloud -// (US-West) region. For an example of creating an index and data source using the -// Python SDK, see Getting started with Python SDK +// raised. For an example of creating an index and data source using the Python +// SDK, see Getting started with Python SDK // (https://docs.aws.amazon.com/kendra/latest/dg/gs-python.html). For an example of // creating an index and data source using the Java SDK, see Getting started with // Java SDK (https://docs.aws.amazon.com/kendra/latest/dg/gs-java.html). @@ -86,25 +83,27 @@ type CreateDataSourceInput struct { // (https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html). LanguageCode *string - // The Amazon Resource Name (ARN) of a role with permission to access the data - // source and required resources. For more information, see IAM roles for Amazon - // Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). You can't - // specify the RoleArn parameter when the Type parameter is set to CUSTOM. If you - // do, you receive a ValidationException exception. The RoleArn parameter is - // required for all other data sources. + // The Amazon Resource Name (ARN) of an IAM role with permission to access the data + // source and required resources. For more information, see IAM access roles for + // Amazon Kendra. (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). + // You can't specify the RoleArn parameter when the Type parameter is set to + // CUSTOM. If you do, you receive a ValidationException exception. The RoleArn + // parameter is required for all other data sources. RoleArn *string // Sets the frequency for Amazon Kendra to check the documents in your data source // repository and update the index. If you don't set a schedule Amazon Kendra will // not periodically update the index. You can call the StartDataSourceSyncJob API - // to update the index. You can't specify the Schedule parameter when the Type - // parameter is set to CUSTOM. If you do, you receive a ValidationException - // exception. + // to update the index. Specify a cron- format schedule string or an empty string + // to indicate that the index is updated on demand. You can't specify the Schedule + // parameter when the Type parameter is set to CUSTOM. If you do, you receive a + // ValidationException exception. Schedule *string - // A list of key-value pairs that identify the data source connector. You can use - // the tags to identify and organize your resources and to control access to - // resources. + // A list of key-value pairs that identify or categorize the data source connector. + // You can also use tags to help control access to the data source connector. Tag + // keys and values can consist of Unicode letters, digits, white space, and any of + // the following symbols: _ . : / = + - @. Tags []types.Tag // Configuration information for an Amazon Virtual Private Cloud to connect to your diff --git a/service/kendra/api_op_CreateExperience.go b/service/kendra/api_op_CreateExperience.go index 6bbfe9152b4..e3ca3174999 100644 --- a/service/kendra/api_op_CreateExperience.go +++ b/service/kendra/api_op_CreateExperience.go @@ -57,10 +57,12 @@ type CreateExperienceInput struct { // A description for your Amazon Kendra experience. Description *string - // The Amazon Resource Name (ARN) of a role with permission to access Query API, - // QuerySuggestions API, SubmitFeedback API, and IAM Identity Center that stores - // your user and group information. For more information, see IAM roles for Amazon - // Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). + // The Amazon Resource Name (ARN) of an IAM role with permission to access Query + // API, GetQuerySuggestions API, and other required APIs. The role also must + // include permission to access IAM Identity Center (successor to Single Sign-On) + // that stores your user and group information. For more information, see IAM + // access roles for Amazon Kendra + // (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). RoleArn *string noSmithyDocumentSerde @@ -68,7 +70,7 @@ type CreateExperienceInput struct { type CreateExperienceOutput struct { - // The identifier for your created Amazon Kendra experience. + // The identifier of your Amazon Kendra experience. // // This member is required. Id *string diff --git a/service/kendra/api_op_CreateFaq.go b/service/kendra/api_op_CreateFaq.go index 97dd9539f9d..28484ed65e9 100644 --- a/service/kendra/api_op_CreateFaq.go +++ b/service/kendra/api_op_CreateFaq.go @@ -12,9 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates an new set of frequently asked question (FAQ) questions and answers. -// Adding FAQs to an index is an asynchronous operation. For an example of adding -// an FAQ to an index using Python and Java SDKs, see Using your FAQ file +// Creates a set of frequently ask questions (FAQs) using a specified FAQ file +// stored in an Amazon S3 bucket. Adding FAQs to an index is an asynchronous +// operation. For an example of adding an FAQ to an index using Python and Java +// SDKs, see Using your FAQ file // (https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html#using-faq-file). func (c *Client) CreateFaq(ctx context.Context, params *CreateFaqInput, optFns ...func(*Options)) (*CreateFaqOutput, error) { if params == nil { @@ -43,9 +44,9 @@ type CreateFaqInput struct { // This member is required. Name *string - // The Amazon Resource Name (ARN) of a role with permission to access the S3 bucket - // that contains the FAQs. For more information, see IAM Roles for Amazon Kendra - // (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). + // The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 + // bucket that contains the FAQs. For more information, see IAM access roles for + // Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). // // This member is required. RoleArn *string diff --git a/service/kendra/api_op_CreateFeaturedResultsSet.go b/service/kendra/api_op_CreateFeaturedResultsSet.go new file mode 100644 index 00000000000..33409601eba --- /dev/null +++ b/service/kendra/api_op_CreateFeaturedResultsSet.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendra + +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/kendra/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a set of featured results to display at the top of the search results +// page. Featured results are placed above all other results for certain queries. +// You map specific queries to specific documents for featuring in the results. If +// a query contains an exact match, then one or more specific documents are +// featured in the search results. You can create up to 50 sets of featured results +// per index. You can request to increase this limit by contacting Support +// (http://aws.amazon.com/contact-us/). +func (c *Client) CreateFeaturedResultsSet(ctx context.Context, params *CreateFeaturedResultsSetInput, optFns ...func(*Options)) (*CreateFeaturedResultsSetOutput, error) { + if params == nil { + params = &CreateFeaturedResultsSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateFeaturedResultsSet", params, optFns, c.addOperationCreateFeaturedResultsSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFeaturedResultsSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFeaturedResultsSetInput struct { + + // A name for the set of featured results. + // + // This member is required. + FeaturedResultsSetName *string + + // The identifier of the index that you want to use for featuring results. + // + // This member is required. + IndexId *string + + // A token that you provide to identify the request to create a set of featured + // results. Multiple calls to the CreateFeaturedResultsSet API with the same client + // token will create only one featured results set. + ClientToken *string + + // A description for the set of featured results. + Description *string + + // A list of document IDs for the documents you want to feature at the top of the + // search results page. For more information on the list of documents, see + // FeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html). + FeaturedDocuments []types.FeaturedDocument + + // A list of queries for featuring results. For more information on the list of + // queries, see FeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html). + QueryTexts []string + + // The current status of the set of featured results. When the value is ACTIVE, + // featured results are ready for use. You can still configure your settings before + // setting the status to ACTIVE. You can set the status to ACTIVE or INACTIVE using + // the UpdateFeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html) + // API. The queries you specify for featured results must be unique per featured + // results set for each index, whether the status is ACTIVE or INACTIVE. + Status types.FeaturedResultsSetStatus + + // A list of key-value pairs that identify or categorize the featured results set. + // You can also use tags to help control access to the featured results set. Tag + // keys and values can consist of Unicode letters, digits, white space, and any of + // the following symbols:_ . : / = + - @. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateFeaturedResultsSetOutput struct { + + // Information on the set of featured results. This includes the identifier of the + // featured results set, whether the featured results set is active or inactive, + // when the featured results set was created, and more. + FeaturedResultsSet *types.FeaturedResultsSet + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFeaturedResultsSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFeaturedResultsSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFeaturedResultsSet{}, 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 = addOpCreateFeaturedResultsSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFeaturedResultsSet(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_opCreateFeaturedResultsSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "kendra", + OperationName: "CreateFeaturedResultsSet", + } +} diff --git a/service/kendra/api_op_CreateIndex.go b/service/kendra/api_op_CreateIndex.go index b10f3650f8a..13e174c0ba2 100644 --- a/service/kendra/api_op_CreateIndex.go +++ b/service/kendra/api_op_CreateIndex.go @@ -44,10 +44,9 @@ type CreateIndexInput struct { // This member is required. Name *string - // An Identity and Access Management (IAM) role that gives Amazon Kendra - // permissions to access your Amazon CloudWatch logs and metrics. This is also the - // role you use when you call the BatchPutDocument API to index documents from an - // Amazon S3 bucket. + // The Amazon Resource Name (ARN) of an IAM role with permission to access your + // Amazon CloudWatch logs and metrics. For more information, see IAM access roles + // for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). // // This member is required. RoleArn *string @@ -62,10 +61,10 @@ type CreateIndexInput struct { // The Amazon Kendra edition to use for the index. Choose DEVELOPER_EDITION for // indexes intended for development, testing, or proof of concept. Use - // ENTERPRISE_EDITION for your production databases. Once you set the edition for - // an index, it can't be changed. The Edition parameter is optional. If you don't - // supply a value, the default is ENTERPRISE_EDITION. For more information on quota - // limits for enterprise and developer editions, see Quotas + // ENTERPRISE_EDITION for production. Once you set the edition for an index, it + // can't be changed. The Edition parameter is optional. If you don't supply a + // value, the default is ENTERPRISE_EDITION. For more information on quota limits + // for Enterprise and Developer editions, see Quotas // (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html). Edition types.IndexEdition @@ -73,8 +72,10 @@ type CreateIndexInput struct { // indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs. ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration - // A list of key-value pairs that identify the index. You can use the tags to - // identify and organize your resources and to control access to resources. + // A list of key-value pairs that identify or categorize the index. You can also + // use tags to help control access to the index. Tag keys and values can consist of + // Unicode letters, digits, white space, and any of the following symbols: _ . : / + // = + - @. Tags []types.Tag // The user context policy. ATTRIBUTE_FILTER All indexed content is searchable and @@ -86,9 +87,8 @@ type CreateIndexInput struct { // displayable. UserContextPolicy types.UserContextPolicy - // Enables fetching access levels of groups and users from an IAM Identity Center - // (successor to Single Sign-On) identity source. To configure this, see - // UserGroupResolutionConfiguration + // Gets users and groups from IAM Identity Center (successor to Single Sign-On) + // identity source. To configure this, see UserGroupResolutionConfiguration // (https://docs.aws.amazon.com/kendra/latest/dg/API_UserGroupResolutionConfiguration.html). UserGroupResolutionConfiguration *types.UserGroupResolutionConfiguration diff --git a/service/kendra/api_op_CreateQuerySuggestionsBlockList.go b/service/kendra/api_op_CreateQuerySuggestionsBlockList.go index ac34d08e149..8a25c234155 100644 --- a/service/kendra/api_op_CreateQuerySuggestionsBlockList.go +++ b/service/kendra/api_op_CreateQuerySuggestionsBlockList.go @@ -46,18 +46,17 @@ type CreateQuerySuggestionsBlockListInput struct { // This member is required. IndexId *string - // A user friendly name for the block list. For example, the block list named - // 'offensive-words' includes all offensive words that could appear in user queries - // and need to be blocked from suggestions. + // A name for the block list. For example, the name 'offensive-words', which + // includes all offensive words that could appear in user queries and need to be + // blocked from suggestions. // // This member is required. Name *string - // The IAM (Identity and Access Management) role used by Amazon Kendra to access - // the block list text file in your S3 bucket. You need permissions to the role ARN - // (Amazon Web Services Resource Name). The role needs S3 read permissions to your - // file in S3 and needs to give STS (Security Token Service) assume role - // permissions to Amazon Kendra. + // The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 + // bucket that contains the block list text file. For more information, see IAM + // access roles for Amazon Kendra + // (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). // // This member is required. RoleArn *string @@ -74,12 +73,14 @@ type CreateQuerySuggestionsBlockListInput struct { // block list. ClientToken *string - // A user-friendly description for the block list. For example, the description - // "List of all offensive words that can appear in user queries and need to be - // blocked from suggestions." + // A description for the block list. For example, the description "List of all + // offensive words that can appear in user queries and need to be blocked from + // suggestions." Description *string - // A tag that you can assign to a block list that categorizes the block list. + // A list of key-value pairs that identify or categorize the block list. Tag keys + // and values can consist of Unicode letters, digits, white space, and any of the + // following symbols: _ . : / = + - @. Tags []types.Tag noSmithyDocumentSerde @@ -87,7 +88,7 @@ type CreateQuerySuggestionsBlockListInput struct { type CreateQuerySuggestionsBlockListOutput struct { - // The identifier of the created block list. + // The identifier of the block list. Id *string // Metadata pertaining to the operation's result. diff --git a/service/kendra/api_op_CreateThesaurus.go b/service/kendra/api_op_CreateThesaurus.go index e2965b95334..355e6230a1e 100644 --- a/service/kendra/api_op_CreateThesaurus.go +++ b/service/kendra/api_op_CreateThesaurus.go @@ -43,8 +43,10 @@ type CreateThesaurusInput struct { // This member is required. Name *string - // An IAM role that gives Amazon Kendra permissions to access thesaurus file - // specified in SourceS3Path. + // The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 + // bucket that contains the thesaurus file. For more information, see IAM access + // roles for Amazon Kendra + // (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). // // This member is required. RoleArn *string @@ -62,8 +64,10 @@ type CreateThesaurusInput struct { // A description for the thesaurus. Description *string - // A list of key-value pairs that identify the thesaurus. You can use the tags to - // identify and organize your resources and to control access to resources. + // A list of key-value pairs that identify or categorize the thesaurus. You can + // also use tags to help control access to the thesaurus. Tag keys and values can + // consist of Unicode letters, digits, white space, and any of the following + // symbols: _ . : / = + - @. Tags []types.Tag noSmithyDocumentSerde diff --git a/service/kendra/api_op_DeletePrincipalMapping.go b/service/kendra/api_op_DeletePrincipalMapping.go index 87007f2fc87..60bd659b91e 100644 --- a/service/kendra/api_op_DeletePrincipalMapping.go +++ b/service/kendra/api_op_DeletePrincipalMapping.go @@ -64,11 +64,11 @@ type DeletePrincipalMappingInput struct { // the ordering ID, is the latest action you want to process and apply on top of // other actions with lower number IDs. This prevents previous actions with lower // number IDs from possibly overriding the latest action. The ordering ID can be - // the UNIX time of the last update you made to a group members list. You would + // the Unix time of the last update you made to a group members list. You would // then provide this list when calling PutPrincipalMapping. This ensures your // DELETE action for that updated group with the latest members list doesn't get // overwritten by earlier DELETE actions for the same group which are yet to be - // processed. The default ordering ID is the current UNIX time in milliseconds that + // processed. The default ordering ID is the current Unix time in milliseconds that // the action was received by Amazon Kendra. OrderingId *int64 diff --git a/service/kendra/api_op_DescribeDataSource.go b/service/kendra/api_op_DescribeDataSource.go index 60e3434b09f..36db9b38adb 100644 --- a/service/kendra/api_op_DescribeDataSource.go +++ b/service/kendra/api_op_DescribeDataSource.go @@ -50,7 +50,7 @@ type DescribeDataSourceOutput struct { // data source provider. Configuration *types.DataSourceConfiguration - // The Unix timestamp of when the data source connector was created. + // The Unix timestamp when the data source connector was created. CreatedAt *time.Time // Configuration information for altering document metadata and content during the @@ -99,7 +99,7 @@ type DescribeDataSourceOutput struct { // The type of the data source. For example, SHAREPOINT. Type types.DataSourceType - // The Unix timestamp of when the data source connector was last updated. + // The Unix timestamp when the data source connector was last updated. UpdatedAt *time.Time // Configuration information for an Amazon Virtual Private Cloud to connect to your diff --git a/service/kendra/api_op_DescribeExperience.go b/service/kendra/api_op_DescribeExperience.go index 8fe88e0f89f..f164efb097e 100644 --- a/service/kendra/api_op_DescribeExperience.go +++ b/service/kendra/api_op_DescribeExperience.go @@ -54,7 +54,7 @@ type DescribeExperienceOutput struct { // information to grant access to your Amazon Kendra experience. Configuration *types.ExperienceConfiguration - // Shows the date-time your Amazon Kendra experience was created. + // The Unix timestamp when your Amazon Kendra experience was created. CreatedAt *time.Time // Shows the description for your Amazon Kendra experience. @@ -86,7 +86,7 @@ type DescribeExperienceOutput struct { // FAILED, the ErrorMessage field contains the reason that this failed. Status types.ExperienceStatus - // Shows the date-time your Amazon Kendra experience was last updated. + // The Unix timestamp when your Amazon Kendra experience was last updated. UpdatedAt *time.Time // Metadata pertaining to the operation's result. diff --git a/service/kendra/api_op_DescribeFaq.go b/service/kendra/api_op_DescribeFaq.go index 8431ff18918..f96e69e0296 100644 --- a/service/kendra/api_op_DescribeFaq.go +++ b/service/kendra/api_op_DescribeFaq.go @@ -45,7 +45,7 @@ type DescribeFaqInput struct { type DescribeFaqOutput struct { - // The date and time that the FAQ was created. + // The Unix timestamp when the FAQ was created. CreatedAt *time.Time // The description of the FAQ that you provided when it was created. @@ -83,7 +83,7 @@ type DescribeFaqOutput struct { // The status of the FAQ. It is ready to use when the status is ACTIVE. Status types.FaqStatus - // The date and time that the FAQ was last updated. + // The Unix timestamp when the FAQ was last updated. UpdatedAt *time.Time // Metadata pertaining to the operation's result. diff --git a/service/kendra/api_op_DescribeFeaturedResultsSet.go b/service/kendra/api_op_DescribeFeaturedResultsSet.go new file mode 100644 index 00000000000..6516cb61ce4 --- /dev/null +++ b/service/kendra/api_op_DescribeFeaturedResultsSet.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendra + +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/kendra/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a set of featured results. Features results are placed +// above all other results for certain queries. If there's an exact match of a +// query, then one or more specific documents are featured in the search results. +func (c *Client) DescribeFeaturedResultsSet(ctx context.Context, params *DescribeFeaturedResultsSetInput, optFns ...func(*Options)) (*DescribeFeaturedResultsSetOutput, error) { + if params == nil { + params = &DescribeFeaturedResultsSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeFeaturedResultsSet", params, optFns, c.addOperationDescribeFeaturedResultsSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeFeaturedResultsSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeFeaturedResultsSetInput struct { + + // The identifier of the set of featured results that you want to get information + // on. + // + // This member is required. + FeaturedResultsSetId *string + + // The identifier of the index used for featuring results. + // + // This member is required. + IndexId *string + + noSmithyDocumentSerde +} + +type DescribeFeaturedResultsSetOutput struct { + + // The Unix timestamp when the set of the featured results was created. + CreationTimestamp *int64 + + // The description for the set of featured results. + Description *string + + // The list of document IDs that don't exist but you have specified as featured + // documents. Amazon Kendra cannot feature these documents if they don't exist in + // the index. You can check the status of a document and its ID or check for + // documents with status errors using the BatchGetDocumentStatus + // (https://docs.aws.amazon.com/kendra/latest/dg/API_BatchGetDocumentStatus.html) + // API. + FeaturedDocumentsMissing []types.FeaturedDocumentMissing + + // The list of document IDs for the documents you want to feature with their + // metadata information. For more information on the list of featured documents, + // see FeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html). + FeaturedDocumentsWithMetadata []types.FeaturedDocumentWithMetadata + + // The identifier of the set of featured results. + FeaturedResultsSetId *string + + // The name for the set of featured results. + FeaturedResultsSetName *string + + // The timestamp when the set of featured results was last updated. + LastUpdatedTimestamp *int64 + + // The list of queries for featuring results. For more information on the list of + // queries, see FeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html). + QueryTexts []string + + // The current status of the set of featured results. When the value is ACTIVE, + // featured results are ready for use. You can still configure your settings before + // setting the status to ACTIVE. You can set the status to ACTIVE or INACTIVE using + // the UpdateFeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html) + // API. The queries you specify for featured results must be unique per featured + // results set for each index, whether the status is ACTIVE or INACTIVE. + Status types.FeaturedResultsSetStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeFeaturedResultsSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFeaturedResultsSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFeaturedResultsSet{}, 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 = addOpDescribeFeaturedResultsSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFeaturedResultsSet(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_opDescribeFeaturedResultsSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "kendra", + OperationName: "DescribeFeaturedResultsSet", + } +} diff --git a/service/kendra/api_op_DescribeIndex.go b/service/kendra/api_op_DescribeIndex.go index 66f2138e760..fd60d8cb56d 100644 --- a/service/kendra/api_op_DescribeIndex.go +++ b/service/kendra/api_op_DescribeIndex.go @@ -48,7 +48,7 @@ type DescribeIndexOutput struct { // (https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html). CapacityUnits *types.CapacityUnitsConfiguration - // The Unix datetime that the index was created. + // The Unix timestamp when the index was created. CreatedAt *time.Time // The description for the index. @@ -90,7 +90,7 @@ type DescribeIndexOutput struct { // message that explains why. Status types.IndexStatus - // The Unix datetime that the index was last updated. + // The Unix when the index was last updated. UpdatedAt *time.Time // The user context policy for the Amazon Kendra index. diff --git a/service/kendra/api_op_DescribePrincipalMapping.go b/service/kendra/api_op_DescribePrincipalMapping.go index 8c50a4dd927..c6f9ef636f2 100644 --- a/service/kendra/api_op_DescribePrincipalMapping.go +++ b/service/kendra/api_op_DescribePrincipalMapping.go @@ -67,20 +67,19 @@ type DescribePrincipalMappingOutput struct { // Shows the following information on the processing of PUT and DELETE actions for // mapping users to their groups: // - // * Status – the status can be either PROCESSING, + // * Status—the status can be either PROCESSING, // SUCCEEDED, DELETING, DELETED, or FAILED. // - // * Last updated – the last date-time an + // * Last updated—the last date-time an // action was updated. // - // * Received – the last date-time an action was received or + // * Received—the last date-time an action was received or // submitted. // - // * Ordering ID – the latest action that should process and apply - // after other actions. + // * Ordering ID—the latest action that should process and apply after + // other actions. // - // * Failure reason – the reason an action could not be - // processed. + // * Failure reason—the reason an action could not be processed. GroupOrderingIdSummaries []types.GroupOrderingIdSummary // Shows the identifier of the index to see information on the processing of PUT diff --git a/service/kendra/api_op_DescribeQuerySuggestionsBlockList.go b/service/kendra/api_op_DescribeQuerySuggestionsBlockList.go index e139d07d353..6bbb3bf76d5 100644 --- a/service/kendra/api_op_DescribeQuerySuggestionsBlockList.go +++ b/service/kendra/api_op_DescribeQuerySuggestionsBlockList.go @@ -48,7 +48,7 @@ type DescribeQuerySuggestionsBlockListInput struct { type DescribeQuerySuggestionsBlockListOutput struct { - // The date-time a block list for query suggestions was created. + // The Unix timestamp when a block list for query suggestions was created. CreatedAt *time.Time // The description for the block list. @@ -90,7 +90,7 @@ type DescribeQuerySuggestionsBlockListOutput struct { // is ready for use. Status types.QuerySuggestionsBlockListStatus - // The date-time a block list for query suggestions was last updated. + // The Unix timestamp when a block list for query suggestions was last updated. UpdatedAt *time.Time // Metadata pertaining to the operation's result. diff --git a/service/kendra/api_op_DescribeQuerySuggestionsConfig.go b/service/kendra/api_op_DescribeQuerySuggestionsConfig.go index 9e7af3b658e..632bc888f16 100644 --- a/service/kendra/api_op_DescribeQuerySuggestionsConfig.go +++ b/service/kendra/api_op_DescribeQuerySuggestionsConfig.go @@ -48,13 +48,13 @@ type DescribeQuerySuggestionsConfigOutput struct { // information to generate the query suggestions. IncludeQueriesWithoutUserInformation *bool - // The date-time query suggestions for an index was last cleared. After you clear - // suggestions, Amazon Kendra learns new suggestions based on new queries added to - // the query log from the time you cleared suggestions. Amazon Kendra only + // The Unix timestamp when query suggestions for an index was last cleared. After + // you clear suggestions, Amazon Kendra learns new suggestions based on new queries + // added to the query log from the time you cleared suggestions. Amazon Kendra only // considers re-occurences of a query from the time you cleared suggestions. LastClearTime *time.Time - // The date-time query suggestions for an index was last updated. + // The Unix timestamp when query suggestions for an index was last updated. LastSuggestionsBuildTime *time.Time // The minimum number of unique users who must search a query in order for the diff --git a/service/kendra/api_op_DescribeThesaurus.go b/service/kendra/api_op_DescribeThesaurus.go index 35ee110b0f3..d23e7c3fb79 100644 --- a/service/kendra/api_op_DescribeThesaurus.go +++ b/service/kendra/api_op_DescribeThesaurus.go @@ -45,7 +45,7 @@ type DescribeThesaurusInput struct { type DescribeThesaurusOutput struct { - // The Unix datetime that the thesaurus was created. + // The Unix timestamp when the thesaurus was created. CreatedAt *time.Time // The thesaurus description. @@ -88,7 +88,7 @@ type DescribeThesaurusOutput struct { // a,b,c and a=>d, the term count would be 4. TermCount *int64 - // The Unix datetime that the thesaurus was last updated. + // The Unix timestamp when the thesaurus was last updated. UpdatedAt *time.Time // Metadata pertaining to the operation's result. diff --git a/service/kendra/api_op_GetSnapshots.go b/service/kendra/api_op_GetSnapshots.go index bc23b754dfb..2ac8474e54e 100644 --- a/service/kendra/api_op_GetSnapshots.go +++ b/service/kendra/api_op_GetSnapshots.go @@ -88,7 +88,7 @@ type GetSnapshotsOutput struct { // use in a later request to retrieve the next set of search metrics data. NextToken *string - // The date-time for the beginning and end of the time window for the search + // The Unix timestamp for the beginning and end of the time window for the search // metrics data. SnapShotTimeFilter *types.TimeRange diff --git a/service/kendra/api_op_ListFeaturedResultsSets.go b/service/kendra/api_op_ListFeaturedResultsSets.go new file mode 100644 index 00000000000..6ae6560f7b3 --- /dev/null +++ b/service/kendra/api_op_ListFeaturedResultsSets.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendra + +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/kendra/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all your sets of featured results for a given index. Features results are +// placed above all other results for certain queries. If there's an exact match of +// a query, then one or more specific documents are featured in the search results. +func (c *Client) ListFeaturedResultsSets(ctx context.Context, params *ListFeaturedResultsSetsInput, optFns ...func(*Options)) (*ListFeaturedResultsSetsOutput, error) { + if params == nil { + params = &ListFeaturedResultsSetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFeaturedResultsSets", params, optFns, c.addOperationListFeaturedResultsSetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFeaturedResultsSetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFeaturedResultsSetsInput struct { + + // The identifier of the index used for featuring results. + // + // This member is required. + IndexId *string + + // The maximum number of featured results sets to return. + MaxResults *int32 + + // If the response is truncated, Amazon Kendra returns a pagination token in the + // response. You can use this pagination token to retrieve the next set of featured + // results sets. + NextToken *string + + noSmithyDocumentSerde +} + +type ListFeaturedResultsSetsOutput struct { + + // An array of summary information for one or more featured results sets. + FeaturedResultsSetSummaryItems []types.FeaturedResultsSetSummary + + // If the response is truncated, Amazon Kendra returns a pagination token in the + // response. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFeaturedResultsSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListFeaturedResultsSets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListFeaturedResultsSets{}, 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 = addOpListFeaturedResultsSetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFeaturedResultsSets(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_opListFeaturedResultsSets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "kendra", + OperationName: "ListFeaturedResultsSets", + } +} diff --git a/service/kendra/api_op_PutPrincipalMapping.go b/service/kendra/api_op_PutPrincipalMapping.go index f182b140da0..d742cee74c2 100644 --- a/service/kendra/api_op_PutPrincipalMapping.go +++ b/service/kendra/api_op_PutPrincipalMapping.go @@ -22,8 +22,7 @@ import ( // documents. For more information, see Filtering on user context // (https://docs.aws.amazon.com/kendra/latest/dg/user-context-filter.html). If more // than five PUT actions for a group are currently processing, a validation -// exception is thrown. PutPrincipalMapping is currently not supported in the -// Amazon Web Services GovCloud (US-West) region. +// exception is thrown. func (c *Client) PutPrincipalMapping(ctx context.Context, params *PutPrincipalMappingInput, optFns ...func(*Options)) (*PutPrincipalMappingOutput, error) { if params == nil { params = &PutPrincipalMappingInput{} @@ -75,12 +74,12 @@ type PutPrincipalMappingInput struct { // the latest PUT action with previous actions. The highest number ID, which is the // ordering ID, is the latest action you want to process and apply on top of other // actions with lower number IDs. This prevents previous actions with lower number - // IDs from possibly overriding the latest action. The ordering ID can be the UNIX + // IDs from possibly overriding the latest action. The ordering ID can be the Unix // time of the last update you made to a group members list. You would then provide // this list when calling PutPrincipalMapping. This ensures your PUT action for // that updated group with the latest members list doesn't get overwritten by // earlier PUT actions for the same group which are yet to be processed. The - // default ordering ID is the current UNIX time in milliseconds that the action was + // default ordering ID is the current Unix time in milliseconds that the action was // received by Amazon Kendra. OrderingId *int64 diff --git a/service/kendra/api_op_Query.go b/service/kendra/api_op_Query.go index a05b0b0c3d6..f022eda8509 100644 --- a/service/kendra/api_op_Query.go +++ b/service/kendra/api_op_Query.go @@ -125,6 +125,12 @@ type QueryOutput struct { // key that was specified in the Facets input parameter. FacetResults []types.FacetResult + // The list of featured result items. Featured results are displayed at the top of + // the search results page, placed above all other results for certain queries. If + // there's an exact match of a query, then certain documents are featured in the + // search results. + FeaturedResultsItems []types.FeaturedResultsItem + // The identifier for the search. You use QueryId to identify the search when using // the feedback API. QueryId *string diff --git a/service/kendra/api_op_UpdateFeaturedResultsSet.go b/service/kendra/api_op_UpdateFeaturedResultsSet.go new file mode 100644 index 00000000000..c70e95c3c6b --- /dev/null +++ b/service/kendra/api_op_UpdateFeaturedResultsSet.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendra + +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/kendra/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a set of featured results. Features results are placed above all other +// results for certain queries. You map specific queries to specific documents for +// featuring in the results. If a query contains an exact match of a query, then +// one or more specific documents are featured in the search results. +func (c *Client) UpdateFeaturedResultsSet(ctx context.Context, params *UpdateFeaturedResultsSetInput, optFns ...func(*Options)) (*UpdateFeaturedResultsSetOutput, error) { + if params == nil { + params = &UpdateFeaturedResultsSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateFeaturedResultsSet", params, optFns, c.addOperationUpdateFeaturedResultsSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateFeaturedResultsSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateFeaturedResultsSetInput struct { + + // The identifier of the index used for featuring results. + // + // This member is required. + FeaturedResultsSetId *string + + // The identifier of the index used for featuring results. + // + // This member is required. + IndexId *string + + // A new description for the set of featured results. + Description *string + + // A list of document IDs for the documents you want to feature at the top of the + // search results page. For more information on the list of featured documents, see + // FeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html). + FeaturedDocuments []types.FeaturedDocument + + // A new name for the set of featured results. + FeaturedResultsSetName *string + + // A list of queries for featuring results. For more information on the list of + // queries, see FeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html). + QueryTexts []string + + // You can set the status to ACTIVE or INACTIVE. When the value is ACTIVE, featured + // results are ready for use. You can still configure your settings before setting + // the status to ACTIVE. The queries you specify for featured results must be + // unique per featured results set for each index, whether the status is ACTIVE or + // INACTIVE. + Status types.FeaturedResultsSetStatus + + noSmithyDocumentSerde +} + +type UpdateFeaturedResultsSetOutput struct { + + // Information on the set of featured results. This includes the identifier of the + // featured results set, whether the featured results set is active or inactive, + // when the featured results set was last updated, and more. + FeaturedResultsSet *types.FeaturedResultsSet + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateFeaturedResultsSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateFeaturedResultsSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateFeaturedResultsSet{}, 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 = addOpUpdateFeaturedResultsSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFeaturedResultsSet(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_opUpdateFeaturedResultsSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "kendra", + OperationName: "UpdateFeaturedResultsSet", + } +} diff --git a/service/kendra/deserializers.go b/service/kendra/deserializers.go index 33f9dcf7195..7b0422bb000 100644 --- a/service/kendra/deserializers.go +++ b/service/kendra/deserializers.go @@ -401,6 +401,129 @@ func awsAwsjson11_deserializeOpErrorBatchDeleteDocument(response *smithyhttp.Res } } +type awsAwsjson11_deserializeOpBatchDeleteFeaturedResultsSet struct { +} + +func (*awsAwsjson11_deserializeOpBatchDeleteFeaturedResultsSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchDeleteFeaturedResultsSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorBatchDeleteFeaturedResultsSet(response, &metadata) + } + output := &BatchDeleteFeaturedResultsSetOutput{} + 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_deserializeOpDocumentBatchDeleteFeaturedResultsSetOutput(&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_deserializeOpErrorBatchDeleteFeaturedResultsSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpBatchGetDocumentStatus struct { } @@ -1279,6 +1402,135 @@ func awsAwsjson11_deserializeOpErrorCreateFaq(response *smithyhttp.Response, met } } +type awsAwsjson11_deserializeOpCreateFeaturedResultsSet struct { +} + +func (*awsAwsjson11_deserializeOpCreateFeaturedResultsSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateFeaturedResultsSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateFeaturedResultsSet(response, &metadata) + } + output := &CreateFeaturedResultsSetOutput{} + 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_deserializeOpDocumentCreateFeaturedResultsSetOutput(&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_deserializeOpErrorCreateFeaturedResultsSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("FeaturedResultsConflictException", errorCode): + return awsAwsjson11_deserializeErrorFeaturedResultsConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateIndex struct { } @@ -3034,14 +3286,14 @@ func awsAwsjson11_deserializeOpErrorDescribeFaq(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpDescribeIndex struct { +type awsAwsjson11_deserializeOpDescribeFeaturedResultsSet struct { } -func (*awsAwsjson11_deserializeOpDescribeIndex) ID() string { +func (*awsAwsjson11_deserializeOpDescribeFeaturedResultsSet) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeFeaturedResultsSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3055,9 +3307,9 @@ func (m *awsAwsjson11_deserializeOpDescribeIndex) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeIndex(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeFeaturedResultsSet(response, &metadata) } - output := &DescribeIndexOutput{} + output := &DescribeFeaturedResultsSetOutput{} out.Result = output var buff [1024]byte @@ -3077,7 +3329,7 @@ func (m *awsAwsjson11_deserializeOpDescribeIndex) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeIndexOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeFeaturedResultsSetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3091,7 +3343,7 @@ func (m *awsAwsjson11_deserializeOpDescribeIndex) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeFeaturedResultsSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3157,14 +3409,14 @@ func awsAwsjson11_deserializeOpErrorDescribeIndex(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpDescribePrincipalMapping struct { +type awsAwsjson11_deserializeOpDescribeIndex struct { } -func (*awsAwsjson11_deserializeOpDescribePrincipalMapping) ID() string { +func (*awsAwsjson11_deserializeOpDescribeIndex) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribePrincipalMapping) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3178,9 +3430,9 @@ func (m *awsAwsjson11_deserializeOpDescribePrincipalMapping) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribePrincipalMapping(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeIndex(response, &metadata) } - output := &DescribePrincipalMappingOutput{} + output := &DescribeIndexOutput{} out.Result = output var buff [1024]byte @@ -3200,7 +3452,7 @@ func (m *awsAwsjson11_deserializeOpDescribePrincipalMapping) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribePrincipalMappingOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeIndexOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3214,7 +3466,130 @@ func (m *awsAwsjson11_deserializeOpDescribePrincipalMapping) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribePrincipalMapping(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDescribePrincipalMapping struct { +} + +func (*awsAwsjson11_deserializeOpDescribePrincipalMapping) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribePrincipalMapping) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDescribePrincipalMapping(response, &metadata) + } + output := &DescribePrincipalMappingOutput{} + 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_deserializeOpDocumentDescribePrincipalMappingOutput(&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_deserializeOpErrorDescribePrincipalMapping(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5008,6 +5383,129 @@ func awsAwsjson11_deserializeOpErrorListFaqs(response *smithyhttp.Response, meta } } +type awsAwsjson11_deserializeOpListFeaturedResultsSets struct { +} + +func (*awsAwsjson11_deserializeOpListFeaturedResultsSets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListFeaturedResultsSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListFeaturedResultsSets(response, &metadata) + } + output := &ListFeaturedResultsSetsOutput{} + 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_deserializeOpDocumentListFeaturedResultsSetsOutput(&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_deserializeOpErrorListFeaturedResultsSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListGroupsOlderThanOrderingId struct { } @@ -6776,14 +7274,14 @@ func awsAwsjson11_deserializeOpErrorUpdateExperience(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpUpdateIndex struct { +type awsAwsjson11_deserializeOpUpdateFeaturedResultsSet struct { } -func (*awsAwsjson11_deserializeOpUpdateIndex) ID() string { +func (*awsAwsjson11_deserializeOpUpdateFeaturedResultsSet) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateFeaturedResultsSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6797,21 +7295,147 @@ func (m *awsAwsjson11_deserializeOpUpdateIndex) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateIndex(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateFeaturedResultsSet(response, &metadata) } - output := &UpdateIndexOutput{} + output := &UpdateFeaturedResultsSetOutput{} 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 -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsAwsjson11_deserializeOpErrorUpdateIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { + 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_deserializeOpDocumentUpdateFeaturedResultsSetOutput(&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_deserializeOpErrorUpdateFeaturedResultsSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("FeaturedResultsConflictException", errorCode): + return awsAwsjson11_deserializeErrorFeaturedResultsConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateIndex struct { +} + +func (*awsAwsjson11_deserializeOpUpdateIndex) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateIndex(response, &metadata) + } + output := &UpdateIndexOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7265,6 +7889,41 @@ func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Respons return output } +func awsAwsjson11_deserializeErrorFeaturedResultsConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.FeaturedResultsConflictException{} + err := awsAwsjson11_deserializeDocumentFeaturedResultsConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -8272,6 +8931,98 @@ func awsAwsjson11_deserializeDocumentBatchDeleteDocumentResponseFailedDocuments( return nil } +func awsAwsjson11_deserializeDocumentBatchDeleteFeaturedResultsSetError(v **types.BatchDeleteFeaturedResultsSetError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BatchDeleteFeaturedResultsSetError + if *v == nil { + sv = &types.BatchDeleteFeaturedResultsSetError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.ErrorCode(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBatchDeleteFeaturedResultsSetErrors(v *[]types.BatchDeleteFeaturedResultsSetError, 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.BatchDeleteFeaturedResultsSetError + if *v == nil { + cv = []types.BatchDeleteFeaturedResultsSetError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchDeleteFeaturedResultsSetError + destAddr := &col + if err := awsAwsjson11_deserializeDocumentBatchDeleteFeaturedResultsSetError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentBatchGetDocumentStatusResponseError(v **types.BatchGetDocumentStatusResponseError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8777,7 +9528,7 @@ func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsAwsjson11_deserializeDocumentConfluenceAttachmentConfiguration(v **types.ConfluenceAttachmentConfiguration, value interface{}) error { +func awsAwsjson11_deserializeDocumentConflictingItem(v **types.ConflictingItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8790,25 +9541,117 @@ func awsAwsjson11_deserializeDocumentConfluenceAttachmentConfiguration(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ConfluenceAttachmentConfiguration + var sv *types.ConflictingItem if *v == nil { - sv = &types.ConfluenceAttachmentConfiguration{} + sv = &types.ConflictingItem{} } else { sv = *v } for key, value := range shape { switch key { - case "AttachmentFieldMappings": - if err := awsAwsjson11_deserializeDocumentConfluenceAttachmentFieldMappingsList(&sv.AttachmentFieldMappings, value); err != nil { - return err - } - - case "CrawlAttachments": + case "QueryText": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected QueryText to be of type string, got %T instead", value) + } + sv.QueryText = ptr.String(jtv) + } + + case "SetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SetId = ptr.String(jtv) + } + + case "SetName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SetName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentConflictingItems(v *[]types.ConflictingItem, 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.ConflictingItem + if *v == nil { + cv = []types.ConflictingItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConflictingItem + destAddr := &col + if err := awsAwsjson11_deserializeDocumentConflictingItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentConfluenceAttachmentConfiguration(v **types.ConfluenceAttachmentConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ConfluenceAttachmentConfiguration + if *v == nil { + sv = &types.ConfluenceAttachmentConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AttachmentFieldMappings": + if err := awsAwsjson11_deserializeDocumentConfluenceAttachmentFieldMappingsList(&sv.AttachmentFieldMappings, value); err != nil { + return err + } + + case "CrawlAttachments": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CrawlAttachments = jtv } @@ -11693,7 +12536,552 @@ func awsAwsjson11_deserializeDocumentFacetResultList(v *[]types.FacetResult, val for _, value := range shape { var col types.FacetResult destAddr := &col - if err := awsAwsjson11_deserializeDocumentFacetResult(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentFacetResult(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFailedEntity(v **types.FailedEntity, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FailedEntity + if *v == nil { + sv = &types.FailedEntity{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EntityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) + } + sv.EntityId = ptr.String(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFailedEntityList(v *[]types.FailedEntity, 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.FailedEntity + if *v == nil { + cv = []types.FailedEntity{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FailedEntity + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFailedEntity(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFaqIdsList(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 FaqId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFaqStatistics(v **types.FaqStatistics, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FaqStatistics + if *v == nil { + sv = &types.FaqStatistics{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IndexedQuestionAnswersCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IndexedQuestionAnswersCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.IndexedQuestionAnswersCount = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFaqSummary(v **types.FaqSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FaqSummary + if *v == nil { + sv = &types.FaqSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "FileFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FaqFileFormat to be of type string, got %T instead", value) + } + sv.FileFormat = types.FaqFileFormat(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FaqId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LanguageCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) + } + sv.LanguageCode = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FaqName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FaqStatus to be of type string, got %T instead", value) + } + sv.Status = types.FaqStatus(jtv) + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFaqSummaryItems(v *[]types.FaqSummary, 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.FaqSummary + if *v == nil { + cv = []types.FaqSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FaqSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFaqSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFeaturedDocument(v **types.FeaturedDocument, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FeaturedDocument + if *v == nil { + sv = &types.FeaturedDocument{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFeaturedDocumentList(v *[]types.FeaturedDocument, 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.FeaturedDocument + if *v == nil { + cv = []types.FeaturedDocument{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FeaturedDocument + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFeaturedDocument(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFeaturedDocumentMissing(v **types.FeaturedDocumentMissing, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FeaturedDocumentMissing + if *v == nil { + sv = &types.FeaturedDocumentMissing{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFeaturedDocumentMissingList(v *[]types.FeaturedDocumentMissing, 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.FeaturedDocumentMissing + if *v == nil { + cv = []types.FeaturedDocumentMissing{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FeaturedDocumentMissing + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFeaturedDocumentMissing(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFeaturedDocumentWithMetadata(v **types.FeaturedDocumentWithMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FeaturedDocumentWithMetadata + if *v == nil { + sv = &types.FeaturedDocumentWithMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + case "URI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.URI = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFeaturedDocumentWithMetadataList(v *[]types.FeaturedDocumentWithMetadata, 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.FeaturedDocumentWithMetadata + if *v == nil { + cv = []types.FeaturedDocumentWithMetadata{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FeaturedDocumentWithMetadata + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFeaturedDocumentWithMetadata(&destAddr, value); err != nil { return err } col = *destAddr @@ -11704,7 +13092,7 @@ func awsAwsjson11_deserializeDocumentFacetResultList(v *[]types.FacetResult, val return nil } -func awsAwsjson11_deserializeDocumentFailedEntity(v **types.FailedEntity, value interface{}) error { +func awsAwsjson11_deserializeDocumentFeaturedResultsConflictException(v **types.FeaturedResultsConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11717,31 +13105,27 @@ func awsAwsjson11_deserializeDocumentFailedEntity(v **types.FailedEntity, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FailedEntity + var sv *types.FeaturedResultsConflictException if *v == nil { - sv = &types.FailedEntity{} + sv = &types.FeaturedResultsConflictException{} } else { sv = *v } for key, value := range shape { switch key { - case "EntityId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) - } - sv.EntityId = ptr.String(jtv) + case "ConflictingItems": + if err := awsAwsjson11_deserializeDocumentConflictingItems(&sv.ConflictingItems, value); err != nil { + return err } - case "ErrorMessage": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ErrorMessage = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -11753,7 +13137,7 @@ func awsAwsjson11_deserializeDocumentFailedEntity(v **types.FailedEntity, value return nil } -func awsAwsjson11_deserializeDocumentFailedEntityList(v *[]types.FailedEntity, value interface{}) error { +func awsAwsjson11_deserializeDocumentFeaturedResultsItem(v **types.FeaturedResultsItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11761,33 +13145,95 @@ func awsAwsjson11_deserializeDocumentFailedEntityList(v *[]types.FailedEntity, v return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.FailedEntity + var sv *types.FeaturedResultsItem if *v == nil { - cv = []types.FailedEntity{} + sv = &types.FeaturedResultsItem{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.FailedEntity - destAddr := &col - if err := awsAwsjson11_deserializeDocumentFailedEntity(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "AdditionalAttributes": + if err := awsAwsjson11_deserializeDocumentAdditionalResultAttributeList(&sv.AdditionalAttributes, value); err != nil { + return err + } + + case "DocumentAttributes": + if err := awsAwsjson11_deserializeDocumentDocumentAttributeList(&sv.DocumentAttributes, value); err != nil { + return err + } + + case "DocumentExcerpt": + if err := awsAwsjson11_deserializeDocumentTextWithHighlights(&sv.DocumentExcerpt, value); err != nil { + return err + } + + case "DocumentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentId to be of type string, got %T instead", value) + } + sv.DocumentId = ptr.String(jtv) + } + + case "DocumentTitle": + if err := awsAwsjson11_deserializeDocumentTextWithHighlights(&sv.DocumentTitle, value); err != nil { + return err + } + + case "DocumentURI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.DocumentURI = ptr.String(jtv) + } + + case "FeedbackToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeedbackToken to be of type string, got %T instead", value) + } + sv.FeedbackToken = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResultId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryResultType to be of type string, got %T instead", value) + } + sv.Type = types.QueryResultType(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentFaqIdsList(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentFeaturedResultsItemList(v *[]types.FeaturedResultsItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11800,22 +13246,20 @@ func awsAwsjson11_deserializeDocumentFaqIdsList(v *[]string, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.FeaturedResultsItem if *v == nil { - cv = []string{} + cv = []types.FeaturedResultsItem{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FaqId to be of type string, got %T instead", value) - } - col = jtv + var col types.FeaturedResultsItem + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFeaturedResultsItem(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -11823,7 +13267,7 @@ func awsAwsjson11_deserializeDocumentFaqIdsList(v *[]string, value interface{}) return nil } -func awsAwsjson11_deserializeDocumentFaqStatistics(v **types.FaqStatistics, value interface{}) error { +func awsAwsjson11_deserializeDocumentFeaturedResultsSet(v **types.FeaturedResultsSet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11836,26 +13280,85 @@ func awsAwsjson11_deserializeDocumentFaqStatistics(v **types.FaqStatistics, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FaqStatistics + var sv *types.FeaturedResultsSet if *v == nil { - sv = &types.FaqStatistics{} + sv = &types.FeaturedResultsSet{} } else { sv = *v } for key, value := range shape { switch key { - case "IndexedQuestionAnswersCount": + case "CreationTimestamp": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected IndexedQuestionAnswersCount to be json.Number, got %T instead", value) + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.IndexedQuestionAnswersCount = int32(i64) + sv.CreationTimestamp = ptr.Int64(i64) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "FeaturedDocuments": + if err := awsAwsjson11_deserializeDocumentFeaturedDocumentList(&sv.FeaturedDocuments, value); err != nil { + return err + } + + case "FeaturedResultsSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetId to be of type string, got %T instead", value) + } + sv.FeaturedResultsSetId = ptr.String(jtv) + } + + case "FeaturedResultsSetName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetName to be of type string, got %T instead", value) + } + sv.FeaturedResultsSetName = ptr.String(jtv) + } + + case "LastUpdatedTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastUpdatedTimestamp = ptr.Int64(i64) + } + + case "QueryTexts": + if err := awsAwsjson11_deserializeDocumentQueryTextList(&sv.QueryTexts, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetStatus to be of type string, got %T instead", value) + } + sv.Status = types.FeaturedResultsSetStatus(jtv) } default: @@ -11867,7 +13370,7 @@ func awsAwsjson11_deserializeDocumentFaqStatistics(v **types.FaqStatistics, valu return nil } -func awsAwsjson11_deserializeDocumentFaqSummary(v **types.FaqSummary, value interface{}) error { +func awsAwsjson11_deserializeDocumentFeaturedResultsSetSummary(v **types.FeaturedResultsSetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11880,90 +13383,66 @@ func awsAwsjson11_deserializeDocumentFaqSummary(v **types.FaqSummary, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FaqSummary + var sv *types.FeaturedResultsSetSummary if *v == nil { - sv = &types.FaqSummary{} + sv = &types.FeaturedResultsSetSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "CreatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "FileFormat": + case "CreationTimestamp": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected FaqFileFormat to be of type string, got %T instead", value) + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } - sv.FileFormat = types.FaqFileFormat(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Int64(i64) } - case "Id": + case "FeaturedResultsSetId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FaqId to be of type string, got %T instead", value) + return fmt.Errorf("expected FeaturedResultsSetId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.FeaturedResultsSetId = ptr.String(jtv) } - case "LanguageCode": + case "FeaturedResultsSetName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) + return fmt.Errorf("expected FeaturedResultsSetName to be of type string, got %T instead", value) } - sv.LanguageCode = ptr.String(jtv) + sv.FeaturedResultsSetName = ptr.String(jtv) } - case "Name": + case "LastUpdatedTimestamp": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected FaqName to be of type string, got %T instead", value) + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } - sv.Name = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastUpdatedTimestamp = ptr.Int64(i64) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FaqStatus to be of type string, got %T instead", value) - } - sv.Status = types.FaqStatus(jtv) - } - - case "UpdatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected FeaturedResultsSetStatus to be of type string, got %T instead", value) } + sv.Status = types.FeaturedResultsSetStatus(jtv) } default: @@ -11975,7 +13454,7 @@ func awsAwsjson11_deserializeDocumentFaqSummary(v **types.FaqSummary, value inte return nil } -func awsAwsjson11_deserializeDocumentFaqSummaryItems(v *[]types.FaqSummary, value interface{}) error { +func awsAwsjson11_deserializeDocumentFeaturedResultsSetSummaryItems(v *[]types.FeaturedResultsSetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11988,17 +13467,17 @@ func awsAwsjson11_deserializeDocumentFaqSummaryItems(v *[]types.FaqSummary, valu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.FaqSummary + var cv []types.FeaturedResultsSetSummary if *v == nil { - cv = []types.FaqSummary{} + cv = []types.FeaturedResultsSetSummary{} } else { cv = *v } for _, value := range shape { - var col types.FaqSummary + var col types.FeaturedResultsSetSummary destAddr := &col - if err := awsAwsjson11_deserializeDocumentFaqSummary(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentFeaturedResultsSetSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -14438,11 +15917,45 @@ func awsAwsjson11_deserializeDocumentQuerySuggestionsBlockListSummary(v **types. } } - *v = sv + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentQuerySuggestionsBlockListSummaryItems(v *[]types.QuerySuggestionsBlockListSummary, 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.QuerySuggestionsBlockListSummary + if *v == nil { + cv = []types.QuerySuggestionsBlockListSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QuerySuggestionsBlockListSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentQuerySuggestionsBlockListSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } -func awsAwsjson11_deserializeDocumentQuerySuggestionsBlockListSummaryItems(v *[]types.QuerySuggestionsBlockListSummary, value interface{}) error { +func awsAwsjson11_deserializeDocumentQueryTextList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14455,20 +15968,22 @@ func awsAwsjson11_deserializeDocumentQuerySuggestionsBlockListSummaryItems(v *[] return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.QuerySuggestionsBlockListSummary + var cv []string if *v == nil { - cv = []types.QuerySuggestionsBlockListSummary{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.QuerySuggestionsBlockListSummary - destAddr := &col - if err := awsAwsjson11_deserializeDocumentQuerySuggestionsBlockListSummary(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryText to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -18480,6 +19995,42 @@ func awsAwsjson11_deserializeOpDocumentBatchDeleteDocumentOutput(v **BatchDelete return nil } +func awsAwsjson11_deserializeOpDocumentBatchDeleteFeaturedResultsSetOutput(v **BatchDeleteFeaturedResultsSetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchDeleteFeaturedResultsSetOutput + if *v == nil { + sv = &BatchDeleteFeaturedResultsSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Errors": + if err := awsAwsjson11_deserializeDocumentBatchDeleteFeaturedResultsSetErrors(&sv.Errors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentBatchGetDocumentStatusOutput(v **BatchGetDocumentStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18717,6 +20268,42 @@ func awsAwsjson11_deserializeOpDocumentCreateFaqOutput(v **CreateFaqOutput, valu return nil } +func awsAwsjson11_deserializeOpDocumentCreateFeaturedResultsSetOutput(v **CreateFeaturedResultsSetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateFeaturedResultsSetOutput + if *v == nil { + sv = &CreateFeaturedResultsSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FeaturedResultsSet": + if err := awsAwsjson11_deserializeDocumentFeaturedResultsSet(&sv.FeaturedResultsSet, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateIndexOutput(v **CreateIndexOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19420,6 +21007,114 @@ func awsAwsjson11_deserializeOpDocumentDescribeFaqOutput(v **DescribeFaqOutput, return nil } +func awsAwsjson11_deserializeOpDocumentDescribeFeaturedResultsSetOutput(v **DescribeFeaturedResultsSetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeFeaturedResultsSetOutput + if *v == nil { + sv = &DescribeFeaturedResultsSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreationTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Int64(i64) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "FeaturedDocumentsMissing": + if err := awsAwsjson11_deserializeDocumentFeaturedDocumentMissingList(&sv.FeaturedDocumentsMissing, value); err != nil { + return err + } + + case "FeaturedDocumentsWithMetadata": + if err := awsAwsjson11_deserializeDocumentFeaturedDocumentWithMetadataList(&sv.FeaturedDocumentsWithMetadata, value); err != nil { + return err + } + + case "FeaturedResultsSetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetId to be of type string, got %T instead", value) + } + sv.FeaturedResultsSetId = ptr.String(jtv) + } + + case "FeaturedResultsSetName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetName to be of type string, got %T instead", value) + } + sv.FeaturedResultsSetName = ptr.String(jtv) + } + + case "LastUpdatedTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastUpdatedTimestamp = ptr.Int64(i64) + } + + case "QueryTexts": + if err := awsAwsjson11_deserializeDocumentQueryTextList(&sv.QueryTexts, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeaturedResultsSetStatus to be of type string, got %T instead", value) + } + sv.Status = types.FeaturedResultsSetStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeIndexOutput(v **DescribeIndexOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -20604,6 +22299,51 @@ func awsAwsjson11_deserializeOpDocumentListFaqsOutput(v **ListFaqsOutput, value return nil } +func awsAwsjson11_deserializeOpDocumentListFeaturedResultsSetsOutput(v **ListFeaturedResultsSetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFeaturedResultsSetsOutput + if *v == nil { + sv = &ListFeaturedResultsSetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FeaturedResultsSetSummaryItems": + if err := awsAwsjson11_deserializeDocumentFeaturedResultsSetSummaryItems(&sv.FeaturedResultsSetSummaryItems, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListGroupsOlderThanOrderingIdOutput(v **ListGroupsOlderThanOrderingIdOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -20847,6 +22587,11 @@ func awsAwsjson11_deserializeOpDocumentQueryOutput(v **QueryOutput, value interf return err } + case "FeaturedResultsItems": + if err := awsAwsjson11_deserializeDocumentFeaturedResultsItemList(&sv.FeaturedResultsItems, value); err != nil { + return err + } + case "QueryId": if value != nil { jtv, ok := value.(string) @@ -21025,3 +22770,39 @@ func awsAwsjson11_deserializeOpDocumentUpdateAccessControlConfigurationOutput(v *v = sv return nil } + +func awsAwsjson11_deserializeOpDocumentUpdateFeaturedResultsSetOutput(v **UpdateFeaturedResultsSetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateFeaturedResultsSetOutput + if *v == nil { + sv = &UpdateFeaturedResultsSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FeaturedResultsSet": + if err := awsAwsjson11_deserializeDocumentFeaturedResultsSet(&sv.FeaturedResultsSet, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/kendra/generated.json b/service/kendra/generated.json index 3c2a6ebe966..3990101bf70 100644 --- a/service/kendra/generated.json +++ b/service/kendra/generated.json @@ -11,6 +11,7 @@ "api_op_AssociateEntitiesToExperience.go", "api_op_AssociatePersonasToEntities.go", "api_op_BatchDeleteDocument.go", + "api_op_BatchDeleteFeaturedResultsSet.go", "api_op_BatchGetDocumentStatus.go", "api_op_BatchPutDocument.go", "api_op_ClearQuerySuggestions.go", @@ -18,6 +19,7 @@ "api_op_CreateDataSource.go", "api_op_CreateExperience.go", "api_op_CreateFaq.go", + "api_op_CreateFeaturedResultsSet.go", "api_op_CreateIndex.go", "api_op_CreateQuerySuggestionsBlockList.go", "api_op_CreateThesaurus.go", @@ -33,6 +35,7 @@ "api_op_DescribeDataSource.go", "api_op_DescribeExperience.go", "api_op_DescribeFaq.go", + "api_op_DescribeFeaturedResultsSet.go", "api_op_DescribeIndex.go", "api_op_DescribePrincipalMapping.go", "api_op_DescribeQuerySuggestionsBlockList.go", @@ -49,6 +52,7 @@ "api_op_ListExperienceEntities.go", "api_op_ListExperiences.go", "api_op_ListFaqs.go", + "api_op_ListFeaturedResultsSets.go", "api_op_ListGroupsOlderThanOrderingId.go", "api_op_ListIndices.go", "api_op_ListQuerySuggestionsBlockLists.go", @@ -64,6 +68,7 @@ "api_op_UpdateAccessControlConfiguration.go", "api_op_UpdateDataSource.go", "api_op_UpdateExperience.go", + "api_op_UpdateFeaturedResultsSet.go", "api_op_UpdateIndex.go", "api_op_UpdateQuerySuggestionsBlockList.go", "api_op_UpdateQuerySuggestionsConfig.go", diff --git a/service/kendra/serializers.go b/service/kendra/serializers.go index 33c2d5fb00d..ed1b3bb8b44 100644 --- a/service/kendra/serializers.go +++ b/service/kendra/serializers.go @@ -184,6 +184,61 @@ func (m *awsAwsjson11_serializeOpBatchDeleteDocument) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpBatchDeleteFeaturedResultsSet struct { +} + +func (*awsAwsjson11_serializeOpBatchDeleteFeaturedResultsSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchDeleteFeaturedResultsSet) 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.(*BatchDeleteFeaturedResultsSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("AWSKendraFrontendService.BatchDeleteFeaturedResultsSet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchDeleteFeaturedResultsSetInput(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_serializeOpBatchGetDocumentStatus struct { } @@ -569,6 +624,61 @@ func (m *awsAwsjson11_serializeOpCreateFaq) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateFeaturedResultsSet struct { +} + +func (*awsAwsjson11_serializeOpCreateFeaturedResultsSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateFeaturedResultsSet) 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.(*CreateFeaturedResultsSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("AWSKendraFrontendService.CreateFeaturedResultsSet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateFeaturedResultsSetInput(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_serializeOpCreateIndex struct { } @@ -1394,6 +1504,61 @@ func (m *awsAwsjson11_serializeOpDescribeFaq) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeFeaturedResultsSet struct { +} + +func (*awsAwsjson11_serializeOpDescribeFeaturedResultsSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeFeaturedResultsSet) 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.(*DescribeFeaturedResultsSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("AWSKendraFrontendService.DescribeFeaturedResultsSet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeFeaturedResultsSetInput(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_serializeOpDescribeIndex struct { } @@ -2274,6 +2439,61 @@ func (m *awsAwsjson11_serializeOpListFaqs) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListFeaturedResultsSets struct { +} + +func (*awsAwsjson11_serializeOpListFeaturedResultsSets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListFeaturedResultsSets) 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.(*ListFeaturedResultsSetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("AWSKendraFrontendService.ListFeaturedResultsSets") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListFeaturedResultsSetsInput(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_serializeOpListGroupsOlderThanOrderingId struct { } @@ -3099,6 +3319,61 @@ func (m *awsAwsjson11_serializeOpUpdateExperience) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateFeaturedResultsSet struct { +} + +func (*awsAwsjson11_serializeOpUpdateFeaturedResultsSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateFeaturedResultsSet) 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.(*UpdateFeaturedResultsSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.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("AWSKendraFrontendService.UpdateFeaturedResultsSet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateFeaturedResultsSetInput(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_serializeOpUpdateIndex struct { } @@ -4996,6 +5271,42 @@ func awsAwsjson11_serializeDocumentFaqIdsList(v []string, value smithyjson.Value return nil } +func awsAwsjson11_serializeDocumentFeaturedDocument(v *types.FeaturedDocument, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + return nil +} + +func awsAwsjson11_serializeDocumentFeaturedDocumentList(v []types.FeaturedDocument, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentFeaturedDocument(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentFeaturedResultsSetIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentFolderIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5891,6 +6202,17 @@ func awsAwsjson11_serializeDocumentPublicChannelFilter(v []string, value smithyj return nil } +func awsAwsjson11_serializeDocumentQueryTextList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentQuipConfiguration(v *types.QuipConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7304,6 +7626,25 @@ func awsAwsjson11_serializeOpDocumentBatchDeleteDocumentInput(v *BatchDeleteDocu return nil } +func awsAwsjson11_serializeOpDocumentBatchDeleteFeaturedResultsSetInput(v *BatchDeleteFeaturedResultsSetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FeaturedResultsSetIds != nil { + ok := object.Key("FeaturedResultsSetIds") + if err := awsAwsjson11_serializeDocumentFeaturedResultsSetIdList(v.FeaturedResultsSetIds, ok); err != nil { + return err + } + } + + if v.IndexId != nil { + ok := object.Key("IndexId") + ok.String(*v.IndexId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentBatchGetDocumentStatusInput(v *BatchGetDocumentStatusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7577,6 +7918,59 @@ func awsAwsjson11_serializeOpDocumentCreateFaqInput(v *CreateFaqInput, value smi return nil } +func awsAwsjson11_serializeOpDocumentCreateFeaturedResultsSetInput(v *CreateFeaturedResultsSetInput, 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.FeaturedDocuments != nil { + ok := object.Key("FeaturedDocuments") + if err := awsAwsjson11_serializeDocumentFeaturedDocumentList(v.FeaturedDocuments, ok); err != nil { + return err + } + } + + if v.FeaturedResultsSetName != nil { + ok := object.Key("FeaturedResultsSetName") + ok.String(*v.FeaturedResultsSetName) + } + + if v.IndexId != nil { + ok := object.Key("IndexId") + ok.String(*v.IndexId) + } + + if v.QueryTexts != nil { + ok := object.Key("QueryTexts") + if err := awsAwsjson11_serializeDocumentQueryTextList(v.QueryTexts, ok); err != nil { + return err + } + } + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateIndexInput(v *CreateIndexInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7943,6 +8337,23 @@ func awsAwsjson11_serializeOpDocumentDescribeFaqInput(v *DescribeFaqInput, value return nil } +func awsAwsjson11_serializeOpDocumentDescribeFeaturedResultsSetInput(v *DescribeFeaturedResultsSetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FeaturedResultsSetId != nil { + ok := object.Key("FeaturedResultsSetId") + ok.String(*v.FeaturedResultsSetId) + } + + if v.IndexId != nil { + ok := object.Key("IndexId") + ok.String(*v.IndexId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeIndexInput(v *DescribeIndexInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8301,6 +8712,28 @@ func awsAwsjson11_serializeOpDocumentListFaqsInput(v *ListFaqsInput, value smith return nil } +func awsAwsjson11_serializeOpDocumentListFeaturedResultsSetsInput(v *ListFeaturedResultsSetsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IndexId != nil { + ok := object.Key("IndexId") + ok.String(*v.IndexId) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListGroupsOlderThanOrderingIdInput(v *ListGroupsOlderThanOrderingIdInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8777,6 +9210,52 @@ func awsAwsjson11_serializeOpDocumentUpdateExperienceInput(v *UpdateExperienceIn return nil } +func awsAwsjson11_serializeOpDocumentUpdateFeaturedResultsSetInput(v *UpdateFeaturedResultsSetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.FeaturedDocuments != nil { + ok := object.Key("FeaturedDocuments") + if err := awsAwsjson11_serializeDocumentFeaturedDocumentList(v.FeaturedDocuments, ok); err != nil { + return err + } + } + + if v.FeaturedResultsSetId != nil { + ok := object.Key("FeaturedResultsSetId") + ok.String(*v.FeaturedResultsSetId) + } + + if v.FeaturedResultsSetName != nil { + ok := object.Key("FeaturedResultsSetName") + ok.String(*v.FeaturedResultsSetName) + } + + if v.IndexId != nil { + ok := object.Key("IndexId") + ok.String(*v.IndexId) + } + + if v.QueryTexts != nil { + ok := object.Key("QueryTexts") + if err := awsAwsjson11_serializeDocumentQueryTextList(v.QueryTexts, ok); err != nil { + return err + } + } + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateIndexInput(v *UpdateIndexInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/kendra/types/enums.go b/service/kendra/types/enums.go index 83caac41b6f..9acbd0eeefa 100644 --- a/service/kendra/types/enums.go +++ b/service/kendra/types/enums.go @@ -570,6 +570,24 @@ func (FaqStatus) Values() []FaqStatus { } } +type FeaturedResultsSetStatus string + +// Enum values for FeaturedResultsSetStatus +const ( + FeaturedResultsSetStatusActive FeaturedResultsSetStatus = "ACTIVE" + FeaturedResultsSetStatusInactive FeaturedResultsSetStatus = "INACTIVE" +) + +// Values returns all known values for FeaturedResultsSetStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (FeaturedResultsSetStatus) Values() []FeaturedResultsSetStatus { + return []FeaturedResultsSetStatus{ + "ACTIVE", + "INACTIVE", + } +} + type FsxFileSystemType string // Enum values for FsxFileSystemType diff --git a/service/kendra/types/errors.go b/service/kendra/types/errors.go index a9cb3fbc1f7..ab501f85848 100644 --- a/service/kendra/types/errors.go +++ b/service/kendra/types/errors.go @@ -61,9 +61,40 @@ func (e *ConflictException) ErrorCode() string { } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// An error message with a list of conflicting queries used across different sets +// of featured results. This occurred with the request for a new featured results +// set. Check that the queries you specified for featured results are unique per +// featured results set for each index. +type FeaturedResultsConflictException struct { + Message *string + + ErrorCodeOverride *string + + ConflictingItems []ConflictingItem + + noSmithyDocumentSerde +} + +func (e *FeaturedResultsConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *FeaturedResultsConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *FeaturedResultsConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "FeaturedResultsConflictException" + } + return *e.ErrorCodeOverride +} +func (e *FeaturedResultsConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // An issue occurred with the internal server used for your Amazon Kendra service. -// Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/aws.amazon.com/contact-us) for help. +// Please wait a few minutes and try again, or contact Support +// (http://aws.amazon.com/contact-us/) for help. type InternalServerException struct { Message *string @@ -225,9 +256,9 @@ func (e *ResourceUnavailableException) ErrorCode() string { func (e *ResourceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You have exceeded the set limits for your Amazon Kendra service. Please see -// Quotas[hyperlink Kendra Quotas pg] for more information, or contact Support -// (http://aws.amazon.com/aws.amazon.com/contact-us) to inquire about an increase -// of limits. +// Quotas (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) for more +// information, or contact Support (http://aws.amazon.com/contact-us/) to inquire +// about an increase of limits. type ServiceQuotaExceededException struct { Message *string diff --git a/service/kendra/types/types.go b/service/kendra/types/types.go index dd2971684b9..4c585ba01a8 100644 --- a/service/kendra/types/types.go +++ b/service/kendra/types/types.go @@ -278,6 +278,33 @@ type BatchDeleteDocumentResponseFailedDocument struct { noSmithyDocumentSerde } +// Provides information about a set of featured results that couldn't be removed +// from an index by the BatchDeleteFeaturedResultsSet +// (https://docs.aws.amazon.com/kendra/latest/dg/API_BatchDeleteFeaturedResultsSet.html) +// API. +type BatchDeleteFeaturedResultsSetError struct { + + // The error code for why the set of featured results couldn't be removed from the + // index. + // + // This member is required. + ErrorCode ErrorCode + + // An explanation for why the set of featured results couldn't be removed from the + // index. + // + // This member is required. + ErrorMessage *string + + // The identifier of the set of featured results that couldn't be removed from the + // index. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + // Provides a response when the status of a document could not be retrieved. type BatchGetDocumentStatusResponseError struct { @@ -449,7 +476,7 @@ type CapacityUnitsConfiguration struct { // application uses the SubmitFeedback API to provide click information. type ClickFeedback struct { - // The Unix timestamp of the date and time that the result was clicked. + // The Unix timestamp when the result was clicked. // // This member is required. ClickTime *time.Time @@ -492,6 +519,24 @@ type ColumnConfiguration struct { noSmithyDocumentSerde } +// Information about a conflicting query used across different sets of featured +// results. When you create a featured results set, you must check that the queries +// are unique per featured results set for each index. +type ConflictingItem struct { + + // The text of the conflicting query. + QueryText *string + + // The identifier of the set of featured results that the conflicting query belongs + // to. + SetId *string + + // The name for the set of featured results that the conflicting query belongs to. + SetName *string + + noSmithyDocumentSerde +} + // Configuration of attachment settings for the Confluence data source. Attachment // settings are optional, if you don't specify settings attachments, Amazon Kendra // won't index them. @@ -994,7 +1039,7 @@ type DataSourceGroup struct { // Summary information for a Amazon Kendra data source. type DataSourceSummary struct { - // The UNIX datetime that the data source was created. + // The Unix timestamp when the data source connector was created. CreatedAt *time.Time // The identifier for the data source. @@ -1017,7 +1062,7 @@ type DataSourceSummary struct { // The type of the data source. Type DataSourceType - // The UNIX datetime that the data source was lasted updated. + // The Unix timestamp when the data source connector was last updated. UpdatedAt *time.Time noSmithyDocumentSerde @@ -1030,7 +1075,7 @@ type DataSourceSyncJob struct { // underlying data source, this field contains a code that identifies the error. DataSourceErrorCode *string - // The UNIX datetime that the synchronization job completed. + // The Unix timestamp when the synchronization job completed. EndTime *time.Time // If the Status field is set to FAILED, the ErrorCode field indicates the reason @@ -1049,7 +1094,7 @@ type DataSourceSyncJob struct { // connector. Metrics *DataSourceSyncJobMetrics - // The UNIX datetime that the synchronization job started. + // The Unix timestamp when the synchronization job started. StartTime *time.Time // The execution status of the synchronization job. When the Status field is set to @@ -1543,7 +1588,7 @@ type ExperienceEntitiesSummary struct { // (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html). type ExperiencesSummary struct { - // The date-time your Amazon Kendra experience was created. + // The Unix timestamp when your Amazon Kendra experience was created. CreatedAt *time.Time // The endpoint URLs for your Amazon Kendra experiences. The URLs are unique and @@ -1641,7 +1686,7 @@ type FaqStatistics struct { // index. type FaqSummary struct { - // The UNIX datetime that the FAQ was added to the index. + // The Unix timestamp when the FAQ was created. CreatedAt *time.Time // The file type used to create the FAQ. @@ -1664,12 +1709,190 @@ type FaqSummary struct { // use. Status FaqStatus - // The UNIX datetime that the FAQ was last updated. + // The Unix timestamp when the FAQ was last updated. UpdatedAt *time.Time noSmithyDocumentSerde } +// A featured document. This document is displayed at the top of the search results +// page, placed above all other results for certain queries. If there's an exact +// match of a query, then the document is featured in the search results. +type FeaturedDocument struct { + + // The identifier of the document to feature in the search results. You can use the + // Query (https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html) API to + // search for specific documents with their document IDs included in the result + // items, or you can use the console. + Id *string + + noSmithyDocumentSerde +} + +// A document ID doesn't exist but you have specified as a featured document. +// Amazon Kendra cannot feature the document if it doesn't exist in the index. You +// can check the status of a document and its ID or check for documents with status +// errors using the BatchGetDocumentStatus +// (https://docs.aws.amazon.com/kendra/latest/dg/API_BatchGetDocumentStatus.html) +// API. +type FeaturedDocumentMissing struct { + + // The identifier of the document that doesn't exist but you have specified as a + // featured document. + Id *string + + noSmithyDocumentSerde +} + +// A featured document with its metadata information. This document is displayed at +// the top of the search results page, placed above all other results for certain +// queries. If there's an exact match of a query, then the document is featured in +// the search results. +type FeaturedDocumentWithMetadata struct { + + // The identifier of the featured document with its metadata. You can use the Query + // (https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html) API to search for + // specific documents with their document IDs included in the result items, or you + // can use the console. + Id *string + + // The main title of the featured document. + Title *string + + // The source URI location of the featured document. + URI *string + + noSmithyDocumentSerde +} + +// A single featured result item. A featured result is displayed at the top of the +// search results page, placed above all other results for certain queries. If +// there's an exact match of a query, then certain documents are featured in the +// search results. +type FeaturedResultsItem struct { + + // One or more additional attributes associated with the featured result. + AdditionalAttributes []AdditionalResultAttribute + + // An array of document attributes assigned to a featured document in the search + // results. For example, the document author (_author) or the source URI + // (_source_uri) of the document. + DocumentAttributes []DocumentAttribute + + // Provides text and information about where to highlight the text. + DocumentExcerpt *TextWithHighlights + + // The identifier of the featured document. + DocumentId *string + + // Provides text and information about where to highlight the text. + DocumentTitle *TextWithHighlights + + // The source URI location of the featured document. + DocumentURI *string + + // A token that identifies a particular featured result from a particular query. + // Use this token to provide click-through feedback for the result. For more + // information, see Submitting feedback + // (https://docs.aws.amazon.com/kendra/latest/dg/submitting-feedback.html). + FeedbackToken *string + + // The identifier of the featured result. + Id *string + + // The type of document within the featured result response. For example, a + // response could include a question-answer type that's relevant to the query. + Type QueryResultType + + noSmithyDocumentSerde +} + +// A set of featured results that are displayed at the top of your search results. +// Featured results are placed above all other results for certain queries. If +// there's an exact match of a query, then one or more specific documents are +// featured in the search results. +type FeaturedResultsSet struct { + + // The Unix timestamp when the set of featured results was created. + CreationTimestamp *int64 + + // The description for the set of featured results. + Description *string + + // The list of document IDs for the documents you want to feature at the top of the + // search results page. You can use the Query + // (https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html) API to search for + // specific documents with their document IDs included in the result items, or you + // can use the console. You can add up to four featured documents. You can request + // to increase this limit by contacting Support + // (http://aws.amazon.com/contact-us/). Specific queries are mapped to specific + // documents for featuring in the results. If a query contains an exact match, then + // one or more specific documents are featured in the results. The exact match + // applies to the full query. For example, if you only specify 'Kendra', queries + // such as 'How does kendra semantically rank results?' will not render the + // featured results. Featured results are designed for specific queries, rather + // than queries that are too broad in scope. + FeaturedDocuments []FeaturedDocument + + // The identifier of the set of featured results. + FeaturedResultsSetId *string + + // The name for the set of featured results. + FeaturedResultsSetName *string + + // The Unix timestamp when the set of featured results was last updated. + LastUpdatedTimestamp *int64 + + // The list of queries for featuring results. Specific queries are mapped to + // specific documents for featuring in the results. If a query contains an exact + // match, then one or more specific documents are featured in the results. The + // exact match applies to the full query. For example, if you only specify + // 'Kendra', queries such as 'How does kendra semantically rank results?' will not + // render the featured results. Featured results are designed for specific queries, + // rather than queries that are too broad in scope. + QueryTexts []string + + // The current status of the set of featured results. When the value is ACTIVE, + // featured results are ready for use. You can still configure your settings before + // setting the status to ACTIVE. You can set the status to ACTIVE or INACTIVE using + // the UpdateFeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html) + // API. The queries you specify for featured results must be unique per featured + // results set for each index, whether the status is ACTIVE or INACTIVE. + Status FeaturedResultsSetStatus + + noSmithyDocumentSerde +} + +// Summary information for a set of featured results. Featured results are placed +// above all other results for certain queries. If there's an exact match of a +// query, then one or more specific documents are featured in the search results. +type FeaturedResultsSetSummary struct { + + // The Unix timestamp when the set of featured results was created. + CreationTimestamp *int64 + + // The identifier of the set of featured results. + FeaturedResultsSetId *string + + // The name for the set of featured results. + FeaturedResultsSetName *string + + // The Unix timestamp when the set of featured results was last updated. + LastUpdatedTimestamp *int64 + + // The current status of the set of featured results. When the value is ACTIVE, + // featured results are ready for use. You can still configure your settings before + // setting the status to ACTIVE. You can set the status to ACTIVE or INACTIVE using + // the UpdateFeaturedResultsSet + // (https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html) + // API. The queries you specify for featured results must be unique per featured + // results set for each index, whether the status is ACTIVE or INACTIVE. + Status FeaturedResultsSetStatus + + noSmithyDocumentSerde +} + // Provides the configuration information to connect to Amazon FSx as your data // source. type FsxConfiguration struct { @@ -2005,16 +2228,16 @@ type GroupOrderingIdSummary struct { // action for mapping users to their groups. FailureReason *string - // The last date-time an action was updated. An action can be a PUT or DELETE - // action for mapping users to their groups. + // The Unix timestamp when an action was last updated. An action can be a PUT or + // DELETE action for mapping users to their groups. LastUpdatedAt *time.Time // The order in which actions should complete processing. An action can be a PUT or // DELETE action for mapping users to their groups. OrderingId *int64 - // The date-time an action was received by Amazon Kendra. An action can be a PUT or - // DELETE action for mapping users to their groups. + // The Unix timestamp when an action was received by Amazon Kendra. An action can + // be a PUT or DELETE action for mapping users to their groups. ReceivedAt *time.Time // The current processing status of actions for mapping users to their groups. The @@ -2129,7 +2352,7 @@ type IndexConfigurationSummary struct { // This member is required. Status IndexStatus - // The Unix timestamp when the index was last updated by the UpdateIndex API. + // The Unix timestamp when the index was last updated. // // This member is required. UpdatedAt *time.Time @@ -2470,7 +2693,7 @@ type OnPremiseConfiguration struct { // (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html). type PersonasSummary struct { - // The date-time the summary information was created. + // The Unix timestamp when the summary information was created. CreatedAt *time.Time // The identifier of a user or group in your IAM Identity Center identity source. @@ -2484,7 +2707,7 @@ type PersonasSummary struct { // (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html#access-search-experience). Persona Persona - // The date-time the summary information was last updated. + // The Unix timestamp when the summary information was last updated. UpdatedAt *time.Time noSmithyDocumentSerde @@ -2611,8 +2834,7 @@ type QueryResultItem struct { // for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html). type QuerySuggestionsBlockListSummary struct { - // The date-time summary information for a query suggestions block list was last - // created. + // The Unix timestamp when the block list was created. CreatedAt *time.Time // The identifier of a block list. @@ -2627,7 +2849,7 @@ type QuerySuggestionsBlockListSummary struct { // The status of the block list. Status QuerySuggestionsBlockListStatus - // The date-time the block list was last updated. + // The Unix timestamp when the block list was last updated. UpdatedAt *time.Time noSmithyDocumentSerde @@ -2763,7 +2985,7 @@ type Relevance struct { // uses the SubmitFeedback API to provide relevance information. type RelevanceFeedback struct { - // Whether to document was relevant or not relevant to the search. + // Whether the document was relevant or not relevant to the search. // // This member is required. RelevanceValue RelevanceType @@ -2917,10 +3139,10 @@ type SalesforceConfiguration struct { // the user logging in to the Salesforce instance. // // * securityToken - The token - // associated with the user account logging in to the Salesforce instance. + // associated with the user logging in to the Salesforce instance. // - // * - // username - The user name of the user logging in to the Salesforce instance. + // * username - + // The user name of the user logging in to the Salesforce instance. // // This member is required. SecretArn *string @@ -3122,8 +3344,8 @@ type Search struct { // Provides the configuration information for the seed or starting point URLs to // crawl. When selecting websites to index, you must adhere to the Amazon // Acceptable Use Policy (https://aws.amazon.com/aup/) and all other Amazon terms. -// Remember that you must only use Amazon Kendra Web Crawler to index your own -// webpages, or webpages that you have authorization to index. +// Remember that you must only use Amazon Kendra Web Crawler to index your own web +// pages, or web pages that you have authorization to index. type SeedUrlConfiguration struct { // The list of seed or starting point URLs of the websites you want to crawl. The @@ -3143,8 +3365,8 @@ type SeedUrlConfiguration struct { // then "a.abc.example.com" and "b.abc.example.com" are also crawled. // // * EVERYTHING - // – crawl the website host names with subdomains and other domains that the - // webpages link to. + // – crawl the website host names with subdomains and other domains that the web + // pages link to. // // The default mode is set to HOST_ONLY. WebCrawlerMode WebCrawlerMode @@ -3307,13 +3529,8 @@ type ServiceNowServiceCatalogConfiguration struct { type SharePointConfiguration struct { // The Amazon Resource Name (ARN) of an Secrets Manager secret that contains the - // user name and password required to connect to the SharePoint instance. If you - // use SharePoint Server, you also need to provide the sever domain name as part of - // the credentials. For more information, see Using a Microsoft SharePoint Data - // Source - // (https://docs.aws.amazon.com/kendra/latest/dg/data-source-sharepoint.html). You - // can also provide OAuth authentication credentials of user name, password, client - // ID, and client secret. For more information, see Using a SharePoint data source + // user name and password required to connect to the SharePoint instance. For more + // information, see Microsoft SharePoint // (https://docs.aws.amazon.com/kendra/latest/dg/data-source-sharepoint.html). // // This member is required. @@ -3329,9 +3546,9 @@ type SharePointConfiguration struct { // This member is required. Urls []string - // Whether you want to connect to SharePoint using basic authentication of user - // name and password, or OAuth authentication of user name, password, client ID, - // and client secret. You can use OAuth authentication for SharePoint Online. + // Whether you want to connect to SharePoint Online using basic authentication of + // user name and password, or OAuth authentication of user name, password, client + // ID, and client secret, or AD App-only authentication of client secret. AuthenticationType SharePointOnlineAuthenticationType // TRUE to index document attachments. @@ -3386,9 +3603,9 @@ type SharePointConfiguration struct { // The path to the SSL certificate stored in an Amazon S3 bucket. You use this to // connect to SharePoint Server if you require a secure SSL connection. You can - // simply generate a self-signed X509 certificate on any computer using OpenSSL. - // For an example of using OpenSSL to create an X509 certificate, see Create and - // sign an X509 certificate + // generate a self-signed X509 certificate on any computer using OpenSSL. For an + // example of using OpenSSL to create an X509 certificate, see Create and sign an + // X509 certificate // (https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-ssl.html). SslCertificateS3Path *S3Path @@ -3409,8 +3626,8 @@ type SharePointConfiguration struct { // Provides the configuration information for the sitemap URLs to crawl. When // selecting websites to index, you must adhere to the Amazon Acceptable Use Policy // (https://aws.amazon.com/aup/) and all other Amazon terms. Remember that you must -// only use Amazon Kendra Web Crawler to index your own webpages, or webpages that -// you have authorization to index. +// only use Amazon Kendra Web Crawler to index your own web pages, or web pages +// that you have authorization to index. type SiteMapsConfiguration struct { // The list of sitemap URLs of the websites you want to crawl. The list can include @@ -3786,7 +4003,7 @@ type TextWithHighlights struct { // An array of summary information for a thesaurus or multiple thesauri. type ThesaurusSummary struct { - // The Unix datetime that the thesaurus was created. + // The Unix timestamp when the thesaurus was created. CreatedAt *time.Time // The identifier of the thesaurus. @@ -3798,7 +4015,7 @@ type ThesaurusSummary struct { // The status of the thesaurus. Status ThesaurusStatus - // The Unix datetime that the thesaurus was last updated. + // The Unix timestamp when the thesaurus was last updated. UpdatedAt *time.Time noSmithyDocumentSerde @@ -3807,10 +4024,10 @@ type ThesaurusSummary struct { // Provides a range of time. type TimeRange struct { - // The UNIX datetime of the end of the time range. + // The Unix timestamp for the end of the time range. EndTime *time.Time - // The UNIX datetime of the beginning of the time range. + // The Unix timestamp for the beginning of the time range. StartTime *time.Time noSmithyDocumentSerde @@ -3822,14 +4039,14 @@ type TimeRange struct { // that the website is blocked from crawling. When selecting websites to index, you // must adhere to the Amazon Acceptable Use Policy (https://aws.amazon.com/aup/) // and all other Amazon terms. Remember that you must only use Amazon Kendra Web -// Crawler to index your own webpages, or webpages that you have authorization to +// Crawler to index your own web pages, or web pages that you have authorization to // index. type Urls struct { // Configuration of the seed or starting point URLs of the websites you want to // crawl. You can choose to crawl only the website host names, or the website host // names with subdomains, or the website host names with subdomains and other - // domains that the webpages link to. You can list up to 100 seed URLs. + // domains that the web pages link to. You can list up to 100 seed URLs. SeedUrlConfiguration *SeedUrlConfiguration // Configuration of the sitemap URLs of the websites you want to crawl. Only URLs @@ -3876,11 +4093,10 @@ type UserContext struct { noSmithyDocumentSerde } -// Provides the configuration information to fetch access levels of groups and -// users from an IAM Identity Center (successor to Single Sign-On) identity source. -// This is useful for user context filtering, where search results are filtered -// based on the user or their group access to documents. You can also use the -// PutPrincipalMapping +// Provides the configuration information to get users and groups from an IAM +// Identity Center (successor to Single Sign-On) identity source. This is useful +// for user context filtering, where search results are filtered based on the user +// or their group access to documents. You can also use the PutPrincipalMapping // (https://docs.aws.amazon.com/kendra/latest/dg/API_PutPrincipalMapping.html) API // to map users to their groups so that you only need to provide the user ID when // you issue the query. To set up an IAM Identity Center identity source in the @@ -3896,10 +4112,10 @@ type UserContext struct { // the organization in order to use UserGroupResolutionConfiguration. type UserGroupResolutionConfiguration struct { - // The identity store provider (mode) you want to use to fetch access levels of - // groups and users. IAM Identity Center (successor to Single Sign-On) is currently - // the only available mode. Your users and groups must exist in an IAM Identity - // Center identity source in order to use this mode. + // The identity store provider (mode) you want to use to get users and groups. IAM + // Identity Center (successor to Single Sign-On) is currently the only available + // mode. Your users and groups must exist in an IAM Identity Center identity source + // in order to use this mode. // // This member is required. UserGroupResolutionMode UserGroupResolutionMode @@ -3958,7 +4174,7 @@ type WebCrawlerConfiguration struct { // website is blocked from crawling. When selecting websites to index, you must // adhere to the Amazon Acceptable Use Policy (https://aws.amazon.com/aup/) and all // other Amazon terms. Remember that you must only use Amazon Kendra Web Crawler to - // index your own webpages, or webpages that you have authorization to index. + // index your own web pages, or web pages that you have authorization to index. // // This member is required. Urls *Urls @@ -3974,20 +4190,20 @@ type WebCrawlerConfiguration struct { // Specifies the number of levels in a website that you want to crawl. The first // level begins from the website seed or starting point URL. For example, if a - // website has 3 levels – index level (i.e. seed in this example), sections level, - // and subsections level – and you are only interested in crawling information up - // to the sections level (i.e. levels 0-1), you can set your depth to 1. The - // default crawl depth is set to 2. + // website has three levels—index level (the seed in this example), sections level, + // and subsections level—and you are only interested in crawling information up to + // the sections level (levels 0-1), you can set your depth to 1. The default crawl + // depth is set to 2. CrawlDepth *int32 - // The maximum size (in MB) of a webpage or attachment to crawl. Files larger than - // this size (in MB) are skipped/not crawled. The default maximum size of a webpage - // or attachment is set to 50 MB. + // The maximum size (in MB) of a web page or attachment to crawl. Files larger than + // this size (in MB) are skipped/not crawled. The default maximum size of a web + // page or attachment is set to 50 MB. MaxContentSizePerPageInMegaBytes *float32 - // The maximum number of URLs on a webpage to include when crawling a website. This - // number is per webpage. As a website’s webpages are crawled, any URLs the - // webpages link to are also crawled. URLs on a webpage are crawled in order of + // The maximum number of URLs on a web page to include when crawling a website. + // This number is per web page. As a website’s web pages are crawled, any URLs the + // web pages link to are also crawled. URLs on a web page are crawled in order of // appearance. The default maximum links per page is 100. MaxLinksPerPage *int32 diff --git a/service/kendra/validators.go b/service/kendra/validators.go index 5ff60dc11e8..6fbd9b4e8b8 100644 --- a/service/kendra/validators.go +++ b/service/kendra/validators.go @@ -70,6 +70,26 @@ func (m *validateOpBatchDeleteDocument) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpBatchDeleteFeaturedResultsSet struct { +} + +func (*validateOpBatchDeleteFeaturedResultsSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDeleteFeaturedResultsSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDeleteFeaturedResultsSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDeleteFeaturedResultsSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpBatchGetDocumentStatus struct { } @@ -210,6 +230,26 @@ func (m *validateOpCreateFaq) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpCreateFeaturedResultsSet struct { +} + +func (*validateOpCreateFeaturedResultsSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateFeaturedResultsSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFeaturedResultsSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFeaturedResultsSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateIndex struct { } @@ -510,6 +550,26 @@ func (m *validateOpDescribeFaq) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDescribeFeaturedResultsSet struct { +} + +func (*validateOpDescribeFeaturedResultsSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeFeaturedResultsSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeFeaturedResultsSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeFeaturedResultsSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeIndex struct { } @@ -830,6 +890,26 @@ func (m *validateOpListFaqs) HandleInitialize(ctx context.Context, in middleware return next.HandleInitialize(ctx, in) } +type validateOpListFeaturedResultsSets struct { +} + +func (*validateOpListFeaturedResultsSets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFeaturedResultsSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFeaturedResultsSetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFeaturedResultsSetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListGroupsOlderThanOrderingId struct { } @@ -1110,6 +1190,26 @@ func (m *validateOpUpdateExperience) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpUpdateFeaturedResultsSet struct { +} + +func (*validateOpUpdateFeaturedResultsSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateFeaturedResultsSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateFeaturedResultsSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateFeaturedResultsSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateIndex struct { } @@ -1202,6 +1302,10 @@ func addOpBatchDeleteDocumentValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpBatchDeleteDocument{}, middleware.After) } +func addOpBatchDeleteFeaturedResultsSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDeleteFeaturedResultsSet{}, middleware.After) +} + func addOpBatchGetDocumentStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchGetDocumentStatus{}, middleware.After) } @@ -1230,6 +1334,10 @@ func addOpCreateFaqValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateFaq{}, middleware.After) } +func addOpCreateFeaturedResultsSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateFeaturedResultsSet{}, middleware.After) +} + func addOpCreateIndexValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateIndex{}, middleware.After) } @@ -1290,6 +1398,10 @@ func addOpDescribeFaqValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeFaq{}, middleware.After) } +func addOpDescribeFeaturedResultsSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeFeaturedResultsSet{}, middleware.After) +} + func addOpDescribeIndexValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeIndex{}, middleware.After) } @@ -1354,6 +1466,10 @@ func addOpListFaqsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListFaqs{}, middleware.After) } +func addOpListFeaturedResultsSetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFeaturedResultsSets{}, middleware.After) +} + func addOpListGroupsOlderThanOrderingIdValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListGroupsOlderThanOrderingId{}, middleware.After) } @@ -1410,6 +1526,10 @@ func addOpUpdateExperienceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateExperience{}, middleware.After) } +func addOpUpdateFeaturedResultsSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateFeaturedResultsSet{}, middleware.After) +} + func addOpUpdateIndexValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateIndex{}, middleware.After) } @@ -3661,6 +3781,24 @@ func validateOpBatchDeleteDocumentInput(v *BatchDeleteDocumentInput) error { } } +func validateOpBatchDeleteFeaturedResultsSetInput(v *BatchDeleteFeaturedResultsSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteFeaturedResultsSetInput"} + if v.IndexId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexId")) + } + if v.FeaturedResultsSetIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("FeaturedResultsSetIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchGetDocumentStatusInput(v *BatchGetDocumentStatusInput) error { if v == nil { return nil @@ -3845,6 +3983,29 @@ func validateOpCreateFaqInput(v *CreateFaqInput) error { } } +func validateOpCreateFeaturedResultsSetInput(v *CreateFeaturedResultsSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFeaturedResultsSetInput"} + if v.IndexId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexId")) + } + if v.FeaturedResultsSetName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FeaturedResultsSetName")) + } + 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 validateOpCreateIndexInput(v *CreateIndexInput) error { if v == nil { return nil @@ -4157,6 +4318,24 @@ func validateOpDescribeFaqInput(v *DescribeFaqInput) error { } } +func validateOpDescribeFeaturedResultsSetInput(v *DescribeFeaturedResultsSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeFeaturedResultsSetInput"} + if v.IndexId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexId")) + } + if v.FeaturedResultsSetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FeaturedResultsSetId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeIndexInput(v *DescribeIndexInput) error { if v == nil { return nil @@ -4440,6 +4619,21 @@ func validateOpListFaqsInput(v *ListFaqsInput) error { } } +func validateOpListFeaturedResultsSetsInput(v *ListFeaturedResultsSetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFeaturedResultsSetsInput"} + if v.IndexId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListGroupsOlderThanOrderingIdInput(v *ListGroupsOlderThanOrderingIdInput) error { if v == nil { return nil @@ -4751,6 +4945,24 @@ func validateOpUpdateExperienceInput(v *UpdateExperienceInput) error { } } +func validateOpUpdateFeaturedResultsSetInput(v *UpdateFeaturedResultsSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateFeaturedResultsSetInput"} + if v.IndexId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IndexId")) + } + if v.FeaturedResultsSetId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FeaturedResultsSetId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateIndexInput(v *UpdateIndexInput) error { if v == nil { return nil diff --git a/service/lakeformation/internal/endpoints/endpoints.go b/service/lakeformation/internal/endpoints/endpoints.go index b95e1bd4d08..ea62692d847 100644 --- a/service/lakeformation/internal/endpoints/endpoints.go +++ b/service/lakeformation/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/networkfirewall/api_op_CreateTLSInspectionConfiguration.go b/service/networkfirewall/api_op_CreateTLSInspectionConfiguration.go new file mode 100644 index 00000000000..906b713044d --- /dev/null +++ b/service/networkfirewall/api_op_CreateTLSInspectionConfiguration.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkfirewall + +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/networkfirewall/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Network Firewall TLS inspection configuration. A TLS inspection +// configuration contains the Certificate Manager certificate references that +// Network Firewall uses to decrypt and re-encrypt inbound traffic. After you +// create a TLS inspection configuration, you associate it with a firewall policy. +// To update the settings for a TLS inspection configuration, use +// UpdateTLSInspectionConfiguration. To manage a TLS inspection configuration's +// tags, use the standard Amazon Web Services resource tagging operations, +// ListTagsForResource, TagResource, and UntagResource. To retrieve information +// about TLS inspection configurations, use ListTLSInspectionConfigurations and +// DescribeTLSInspectionConfiguration. For more information about TLS inspection +// configurations, see Decrypting SSL/TLS traffic with TLS inspection +// configurations +// (https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection.html) +// in the Network Firewall Developer Guide. +func (c *Client) CreateTLSInspectionConfiguration(ctx context.Context, params *CreateTLSInspectionConfigurationInput, optFns ...func(*Options)) (*CreateTLSInspectionConfigurationOutput, error) { + if params == nil { + params = &CreateTLSInspectionConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTLSInspectionConfiguration", params, optFns, c.addOperationCreateTLSInspectionConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTLSInspectionConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTLSInspectionConfigurationInput struct { + + // The object that defines a TLS inspection configuration. This, along with + // TLSInspectionConfigurationResponse, define the TLS inspection configuration. You + // can retrieve all objects for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration. Network Firewall uses a TLS inspection + // configuration to decrypt traffic. Network Firewall re-encrypts the traffic + // before sending it to its destination. To use a TLS inspection configuration, you + // add it to a Network Firewall firewall policy, then you apply the firewall policy + // to a firewall. Network Firewall acts as a proxy service to decrypt and inspect + // inbound traffic. You can reference a TLS inspection configuration from more than + // one firewall policy, and you can use a firewall policy in more than one + // firewall. For more information about using TLS inspection configurations, see + // Decrypting SSL/TLS traffic with TLS inspection configurations + // (https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection.html) + // in the Network Firewall Developer Guide. + // + // This member is required. + TLSInspectionConfiguration *types.TLSInspectionConfiguration + + // The descriptive name of the TLS inspection configuration. You can't change the + // name of a TLS inspection configuration after you create it. + // + // This member is required. + TLSInspectionConfigurationName *string + + // A description of the TLS inspection configuration. + Description *string + + // A complex type that contains optional Amazon Web Services Key Management Service + // (KMS) encryption settings for your Network Firewall resources. Your data is + // encrypted by default with an Amazon Web Services owned key that Amazon Web + // Services owns and manages for you. You can use either the Amazon Web Services + // owned key, or provide your own customer managed key. To learn more about KMS + // encryption of your Network Firewall resources, see Encryption at rest with + // Amazon Web Services Key Managment Service + // (https://docs.aws.amazon.com/kms/latest/developerguide/kms-encryption-at-rest.html) + // in the Network Firewall Developer Guide. + EncryptionConfiguration *types.EncryptionConfiguration + + // The key:value pairs to associate with the resource. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateTLSInspectionConfigurationOutput struct { + + // The high-level properties of a TLS inspection configuration. This, along with + // the TLSInspectionConfiguration, define the TLS inspection configuration. You can + // retrieve all objects for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration. + // + // This member is required. + TLSInspectionConfigurationResponse *types.TLSInspectionConfigurationResponse + + // A token used for optimistic locking. Network Firewall returns a token to your + // requests that access the TLS inspection configuration. The token marks the state + // of the TLS inspection configuration resource at the time of the request. To make + // changes to the TLS inspection configuration, you provide the token in your + // request. Network Firewall uses the token to ensure that the TLS inspection + // configuration hasn't changed since you last retrieved it. If it has changed, the + // operation fails with an InvalidTokenException. If this happens, retrieve the TLS + // inspection configuration again to get a current copy of it with a current token. + // Reapply your changes as needed, then try the operation again using the new + // token. + // + // This member is required. + UpdateToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTLSInspectionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateTLSInspectionConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateTLSInspectionConfiguration{}, 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 = addOpCreateTLSInspectionConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTLSInspectionConfiguration(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_opCreateTLSInspectionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "network-firewall", + OperationName: "CreateTLSInspectionConfiguration", + } +} diff --git a/service/networkfirewall/api_op_DeleteTLSInspectionConfiguration.go b/service/networkfirewall/api_op_DeleteTLSInspectionConfiguration.go new file mode 100644 index 00000000000..adaed30e22d --- /dev/null +++ b/service/networkfirewall/api_op_DeleteTLSInspectionConfiguration.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkfirewall + +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/networkfirewall/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified TLSInspectionConfiguration. +func (c *Client) DeleteTLSInspectionConfiguration(ctx context.Context, params *DeleteTLSInspectionConfigurationInput, optFns ...func(*Options)) (*DeleteTLSInspectionConfigurationOutput, error) { + if params == nil { + params = &DeleteTLSInspectionConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTLSInspectionConfiguration", params, optFns, c.addOperationDeleteTLSInspectionConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTLSInspectionConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTLSInspectionConfigurationInput struct { + + // The Amazon Resource Name (ARN) of the TLS inspection configuration. You must + // specify the ARN or the name, and you can specify both. + TLSInspectionConfigurationArn *string + + // The descriptive name of the TLS inspection configuration. You can't change the + // name of a TLS inspection configuration after you create it. You must specify the + // ARN or the name, and you can specify both. + TLSInspectionConfigurationName *string + + noSmithyDocumentSerde +} + +type DeleteTLSInspectionConfigurationOutput struct { + + // The high-level properties of a TLS inspection configuration. This, along with + // the TLSInspectionConfiguration, define the TLS inspection configuration. You can + // retrieve all objects for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration. + // + // This member is required. + TLSInspectionConfigurationResponse *types.TLSInspectionConfigurationResponse + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTLSInspectionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteTLSInspectionConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteTLSInspectionConfiguration{}, 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_opDeleteTLSInspectionConfiguration(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_opDeleteTLSInspectionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "network-firewall", + OperationName: "DeleteTLSInspectionConfiguration", + } +} diff --git a/service/networkfirewall/api_op_DescribeTLSInspectionConfiguration.go b/service/networkfirewall/api_op_DescribeTLSInspectionConfiguration.go new file mode 100644 index 00000000000..264eac64451 --- /dev/null +++ b/service/networkfirewall/api_op_DescribeTLSInspectionConfiguration.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkfirewall + +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/networkfirewall/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the data objects for the specified TLS inspection configuration. +func (c *Client) DescribeTLSInspectionConfiguration(ctx context.Context, params *DescribeTLSInspectionConfigurationInput, optFns ...func(*Options)) (*DescribeTLSInspectionConfigurationOutput, error) { + if params == nil { + params = &DescribeTLSInspectionConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeTLSInspectionConfiguration", params, optFns, c.addOperationDescribeTLSInspectionConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeTLSInspectionConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeTLSInspectionConfigurationInput struct { + + // The Amazon Resource Name (ARN) of the TLS inspection configuration. You must + // specify the ARN or the name, and you can specify both. + TLSInspectionConfigurationArn *string + + // The descriptive name of the TLS inspection configuration. You can't change the + // name of a TLS inspection configuration after you create it. You must specify the + // ARN or the name, and you can specify both. + TLSInspectionConfigurationName *string + + noSmithyDocumentSerde +} + +type DescribeTLSInspectionConfigurationOutput struct { + + // The high-level properties of a TLS inspection configuration. This, along with + // the TLSInspectionConfiguration, define the TLS inspection configuration. You can + // retrieve all objects for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration. + // + // This member is required. + TLSInspectionConfigurationResponse *types.TLSInspectionConfigurationResponse + + // A token used for optimistic locking. Network Firewall returns a token to your + // requests that access the TLS inspection configuration. The token marks the state + // of the TLS inspection configuration resource at the time of the request. To make + // changes to the TLS inspection configuration, you provide the token in your + // request. Network Firewall uses the token to ensure that the TLS inspection + // configuration hasn't changed since you last retrieved it. If it has changed, the + // operation fails with an InvalidTokenException. If this happens, retrieve the TLS + // inspection configuration again to get a current copy of it with a current token. + // Reapply your changes as needed, then try the operation again using the new + // token. + // + // This member is required. + UpdateToken *string + + // The object that defines a TLS inspection configuration. This, along with + // TLSInspectionConfigurationResponse, define the TLS inspection configuration. You + // can retrieve all objects for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration. Network Firewall uses a TLS inspection + // configuration to decrypt traffic. Network Firewall re-encrypts the traffic + // before sending it to its destination. To use a TLS inspection configuration, you + // add it to a Network Firewall firewall policy, then you apply the firewall policy + // to a firewall. Network Firewall acts as a proxy service to decrypt and inspect + // inbound traffic. You can reference a TLS inspection configuration from more than + // one firewall policy, and you can use a firewall policy in more than one + // firewall. For more information about using TLS inspection configurations, see + // Decrypting SSL/TLS traffic with TLS inspection configurations + // (https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection.html) + // in the Network Firewall Developer Guide. + TLSInspectionConfiguration *types.TLSInspectionConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeTLSInspectionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeTLSInspectionConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeTLSInspectionConfiguration{}, 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_opDescribeTLSInspectionConfiguration(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_opDescribeTLSInspectionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "network-firewall", + OperationName: "DescribeTLSInspectionConfiguration", + } +} diff --git a/service/networkfirewall/api_op_ListTLSInspectionConfigurations.go b/service/networkfirewall/api_op_ListTLSInspectionConfigurations.go new file mode 100644 index 00000000000..b4367d56745 --- /dev/null +++ b/service/networkfirewall/api_op_ListTLSInspectionConfigurations.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkfirewall + +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/networkfirewall/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the metadata for the TLS inspection configurations that you have +// defined. Depending on your setting for max results and the number of TLS +// inspection configurations, a single call might not return the full list. +func (c *Client) ListTLSInspectionConfigurations(ctx context.Context, params *ListTLSInspectionConfigurationsInput, optFns ...func(*Options)) (*ListTLSInspectionConfigurationsOutput, error) { + if params == nil { + params = &ListTLSInspectionConfigurationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTLSInspectionConfigurations", params, optFns, c.addOperationListTLSInspectionConfigurationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTLSInspectionConfigurationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTLSInspectionConfigurationsInput struct { + + // The maximum number of objects that you want Network Firewall to return for this + // request. If more objects are available, in the response, Network Firewall + // provides a NextToken value that you can use in a subsequent call to get the next + // batch of objects. + MaxResults *int32 + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Network Firewall returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + noSmithyDocumentSerde +} + +type ListTLSInspectionConfigurationsOutput struct { + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Network Firewall returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + // The TLS inspection configuration metadata objects that you've defined. Depending + // on your setting for max results and the number of TLS inspection configurations, + // this might not be the full list. + TLSInspectionConfigurations []types.TLSInspectionConfigurationMetadata + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTLSInspectionConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListTLSInspectionConfigurations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListTLSInspectionConfigurations{}, 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_opListTLSInspectionConfigurations(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 +} + +// ListTLSInspectionConfigurationsAPIClient is a client that implements the +// ListTLSInspectionConfigurations operation. +type ListTLSInspectionConfigurationsAPIClient interface { + ListTLSInspectionConfigurations(context.Context, *ListTLSInspectionConfigurationsInput, ...func(*Options)) (*ListTLSInspectionConfigurationsOutput, error) +} + +var _ ListTLSInspectionConfigurationsAPIClient = (*Client)(nil) + +// ListTLSInspectionConfigurationsPaginatorOptions is the paginator options for +// ListTLSInspectionConfigurations +type ListTLSInspectionConfigurationsPaginatorOptions struct { + // The maximum number of objects that you want Network Firewall to return for this + // request. If more objects are available, in the response, Network Firewall + // provides a NextToken value that you can use in a subsequent call to get the next + // batch of objects. + 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 +} + +// ListTLSInspectionConfigurationsPaginator is a paginator for +// ListTLSInspectionConfigurations +type ListTLSInspectionConfigurationsPaginator struct { + options ListTLSInspectionConfigurationsPaginatorOptions + client ListTLSInspectionConfigurationsAPIClient + params *ListTLSInspectionConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListTLSInspectionConfigurationsPaginator returns a new +// ListTLSInspectionConfigurationsPaginator +func NewListTLSInspectionConfigurationsPaginator(client ListTLSInspectionConfigurationsAPIClient, params *ListTLSInspectionConfigurationsInput, optFns ...func(*ListTLSInspectionConfigurationsPaginatorOptions)) *ListTLSInspectionConfigurationsPaginator { + if params == nil { + params = &ListTLSInspectionConfigurationsInput{} + } + + options := ListTLSInspectionConfigurationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTLSInspectionConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTLSInspectionConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTLSInspectionConfigurations page. +func (p *ListTLSInspectionConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTLSInspectionConfigurationsOutput, 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.ListTLSInspectionConfigurations(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_opListTLSInspectionConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "network-firewall", + OperationName: "ListTLSInspectionConfigurations", + } +} diff --git a/service/networkfirewall/api_op_UpdateTLSInspectionConfiguration.go b/service/networkfirewall/api_op_UpdateTLSInspectionConfiguration.go new file mode 100644 index 00000000000..1059a160af6 --- /dev/null +++ b/service/networkfirewall/api_op_UpdateTLSInspectionConfiguration.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkfirewall + +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/networkfirewall/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the TLS inspection configuration settings for the specified TLS +// inspection configuration. You use a TLS inspection configuration by reference in +// one or more firewall policies. When you modify a TLS inspection configuration, +// you modify all firewall policies that use the TLS inspection configuration. To +// update a TLS inspection configuration, first call +// DescribeTLSInspectionConfiguration to retrieve the current +// TLSInspectionConfiguration object, update the object as needed, and then provide +// the updated object to this call. +func (c *Client) UpdateTLSInspectionConfiguration(ctx context.Context, params *UpdateTLSInspectionConfigurationInput, optFns ...func(*Options)) (*UpdateTLSInspectionConfigurationOutput, error) { + if params == nil { + params = &UpdateTLSInspectionConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateTLSInspectionConfiguration", params, optFns, c.addOperationUpdateTLSInspectionConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateTLSInspectionConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateTLSInspectionConfigurationInput struct { + + // The object that defines a TLS inspection configuration. This, along with + // TLSInspectionConfigurationResponse, define the TLS inspection configuration. You + // can retrieve all objects for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration. Network Firewall uses a TLS inspection + // configuration to decrypt traffic. Network Firewall re-encrypts the traffic + // before sending it to its destination. To use a TLS inspection configuration, you + // add it to a Network Firewall firewall policy, then you apply the firewall policy + // to a firewall. Network Firewall acts as a proxy service to decrypt and inspect + // inbound traffic. You can reference a TLS inspection configuration from more than + // one firewall policy, and you can use a firewall policy in more than one + // firewall. For more information about using TLS inspection configurations, see + // Decrypting SSL/TLS traffic with TLS inspection configurations + // (https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection.html) + // in the Network Firewall Developer Guide. + // + // This member is required. + TLSInspectionConfiguration *types.TLSInspectionConfiguration + + // A token used for optimistic locking. Network Firewall returns a token to your + // requests that access the TLS inspection configuration. The token marks the state + // of the TLS inspection configuration resource at the time of the request. To make + // changes to the TLS inspection configuration, you provide the token in your + // request. Network Firewall uses the token to ensure that the TLS inspection + // configuration hasn't changed since you last retrieved it. If it has changed, the + // operation fails with an InvalidTokenException. If this happens, retrieve the TLS + // inspection configuration again to get a current copy of it with a current token. + // Reapply your changes as needed, then try the operation again using the new + // token. + // + // This member is required. + UpdateToken *string + + // A description of the TLS inspection configuration. + Description *string + + // A complex type that contains the Amazon Web Services KMS encryption + // configuration settings for your TLS inspection configuration. + EncryptionConfiguration *types.EncryptionConfiguration + + // The Amazon Resource Name (ARN) of the TLS inspection configuration. + TLSInspectionConfigurationArn *string + + // The descriptive name of the TLS inspection configuration. You can't change the + // name of a TLS inspection configuration after you create it. + TLSInspectionConfigurationName *string + + noSmithyDocumentSerde +} + +type UpdateTLSInspectionConfigurationOutput struct { + + // The high-level properties of a TLS inspection configuration. This, along with + // the TLSInspectionConfiguration, define the TLS inspection configuration. You can + // retrieve all objects for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration. + // + // This member is required. + TLSInspectionConfigurationResponse *types.TLSInspectionConfigurationResponse + + // A token used for optimistic locking. Network Firewall returns a token to your + // requests that access the TLS inspection configuration. The token marks the state + // of the TLS inspection configuration resource at the time of the request. To make + // changes to the TLS inspection configuration, you provide the token in your + // request. Network Firewall uses the token to ensure that the TLS inspection + // configuration hasn't changed since you last retrieved it. If it has changed, the + // operation fails with an InvalidTokenException. If this happens, retrieve the TLS + // inspection configuration again to get a current copy of it with a current token. + // Reapply your changes as needed, then try the operation again using the new + // token. + // + // This member is required. + UpdateToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateTLSInspectionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateTLSInspectionConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateTLSInspectionConfiguration{}, 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 = addOpUpdateTLSInspectionConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTLSInspectionConfiguration(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_opUpdateTLSInspectionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "network-firewall", + OperationName: "UpdateTLSInspectionConfiguration", + } +} diff --git a/service/networkfirewall/deserializers.go b/service/networkfirewall/deserializers.go index c0fb8e8d21e..c3359cd434b 100644 --- a/service/networkfirewall/deserializers.go +++ b/service/networkfirewall/deserializers.go @@ -646,14 +646,14 @@ func awsAwsjson10_deserializeOpErrorCreateRuleGroup(response *smithyhttp.Respons } } -type awsAwsjson10_deserializeOpDeleteFirewall struct { +type awsAwsjson10_deserializeOpCreateTLSInspectionConfiguration struct { } -func (*awsAwsjson10_deserializeOpDeleteFirewall) ID() string { +func (*awsAwsjson10_deserializeOpCreateTLSInspectionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteFirewall) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpCreateTLSInspectionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -667,9 +667,9 @@ func (m *awsAwsjson10_deserializeOpDeleteFirewall) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteFirewall(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorCreateTLSInspectionConfiguration(response, &metadata) } - output := &DeleteFirewallOutput{} + output := &CreateTLSInspectionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -689,7 +689,7 @@ func (m *awsAwsjson10_deserializeOpDeleteFirewall) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteFirewallOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentCreateTLSInspectionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -703,7 +703,7 @@ func (m *awsAwsjson10_deserializeOpDeleteFirewall) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteFirewall(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorCreateTLSInspectionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -747,21 +747,12 @@ func awsAwsjson10_deserializeOpErrorDeleteFirewall(response *smithyhttp.Response case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): - return awsAwsjson10_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson10_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -772,14 +763,14 @@ func awsAwsjson10_deserializeOpErrorDeleteFirewall(response *smithyhttp.Response } } -type awsAwsjson10_deserializeOpDeleteFirewallPolicy struct { +type awsAwsjson10_deserializeOpDeleteFirewall struct { } -func (*awsAwsjson10_deserializeOpDeleteFirewallPolicy) ID() string { +func (*awsAwsjson10_deserializeOpDeleteFirewall) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteFirewallPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteFirewall) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -793,9 +784,9 @@ func (m *awsAwsjson10_deserializeOpDeleteFirewallPolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteFirewallPolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteFirewall(response, &metadata) } - output := &DeleteFirewallPolicyOutput{} + output := &DeleteFirewallOutput{} out.Result = output var buff [1024]byte @@ -815,7 +806,7 @@ func (m *awsAwsjson10_deserializeOpDeleteFirewallPolicy) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteFirewallPolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteFirewallOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -829,7 +820,7 @@ func (m *awsAwsjson10_deserializeOpDeleteFirewallPolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteFirewallPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteFirewall(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -898,14 +889,14 @@ func awsAwsjson10_deserializeOpErrorDeleteFirewallPolicy(response *smithyhttp.Re } } -type awsAwsjson10_deserializeOpDeleteResourcePolicy struct { +type awsAwsjson10_deserializeOpDeleteFirewallPolicy struct { } -func (*awsAwsjson10_deserializeOpDeleteResourcePolicy) ID() string { +func (*awsAwsjson10_deserializeOpDeleteFirewallPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteFirewallPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -919,9 +910,9 @@ func (m *awsAwsjson10_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteFirewallPolicy(response, &metadata) } - output := &DeleteResourcePolicyOutput{} + output := &DeleteFirewallPolicyOutput{} out.Result = output var buff [1024]byte @@ -941,7 +932,7 @@ func (m *awsAwsjson10_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteResourcePolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteFirewallPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -955,7 +946,7 @@ func (m *awsAwsjson10_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteFirewallPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -999,18 +990,21 @@ func awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson10_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidResourcePolicyException", errorCode): - return awsAwsjson10_deserializeErrorInvalidResourcePolicyException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1021,14 +1015,14 @@ func awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re } } -type awsAwsjson10_deserializeOpDeleteRuleGroup struct { +type awsAwsjson10_deserializeOpDeleteResourcePolicy struct { } -func (*awsAwsjson10_deserializeOpDeleteRuleGroup) ID() string { +func (*awsAwsjson10_deserializeOpDeleteResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1042,9 +1036,9 @@ func (m *awsAwsjson10_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteRuleGroup(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response, &metadata) } - output := &DeleteRuleGroupOutput{} + output := &DeleteResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -1064,7 +1058,7 @@ func (m *awsAwsjson10_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteRuleGroupOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1078,7 +1072,7 @@ func (m *awsAwsjson10_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1122,21 +1116,18 @@ func awsAwsjson10_deserializeOpErrorDeleteRuleGroup(response *smithyhttp.Respons case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): - return awsAwsjson10_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidResourcePolicyException", errorCode): + return awsAwsjson10_deserializeErrorInvalidResourcePolicyException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson10_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1147,14 +1138,14 @@ func awsAwsjson10_deserializeOpErrorDeleteRuleGroup(response *smithyhttp.Respons } } -type awsAwsjson10_deserializeOpDescribeFirewall struct { +type awsAwsjson10_deserializeOpDeleteRuleGroup struct { } -func (*awsAwsjson10_deserializeOpDescribeFirewall) ID() string { +func (*awsAwsjson10_deserializeOpDeleteRuleGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDescribeFirewall) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1168,9 +1159,9 @@ func (m *awsAwsjson10_deserializeOpDescribeFirewall) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDescribeFirewall(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteRuleGroup(response, &metadata) } - output := &DescribeFirewallOutput{} + output := &DeleteRuleGroupOutput{} out.Result = output var buff [1024]byte @@ -1190,7 +1181,7 @@ func (m *awsAwsjson10_deserializeOpDescribeFirewall) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDescribeFirewallOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteRuleGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1204,7 +1195,7 @@ func (m *awsAwsjson10_deserializeOpDescribeFirewall) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDescribeFirewall(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1248,6 +1239,9 @@ func awsAwsjson10_deserializeOpErrorDescribeFirewall(response *smithyhttp.Respon case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson10_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) @@ -1257,6 +1251,9 @@ func awsAwsjson10_deserializeOpErrorDescribeFirewall(response *smithyhttp.Respon case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1267,14 +1264,14 @@ func awsAwsjson10_deserializeOpErrorDescribeFirewall(response *smithyhttp.Respon } } -type awsAwsjson10_deserializeOpDescribeFirewallPolicy struct { +type awsAwsjson10_deserializeOpDeleteTLSInspectionConfiguration struct { } -func (*awsAwsjson10_deserializeOpDescribeFirewallPolicy) ID() string { +func (*awsAwsjson10_deserializeOpDeleteTLSInspectionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDescribeFirewallPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteTLSInspectionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1288,9 +1285,9 @@ func (m *awsAwsjson10_deserializeOpDescribeFirewallPolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDescribeFirewallPolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteTLSInspectionConfiguration(response, &metadata) } - output := &DescribeFirewallPolicyOutput{} + output := &DeleteTLSInspectionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -1310,7 +1307,7 @@ func (m *awsAwsjson10_deserializeOpDescribeFirewallPolicy) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDescribeFirewallPolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteTLSInspectionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1324,7 +1321,7 @@ func (m *awsAwsjson10_deserializeOpDescribeFirewallPolicy) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDescribeFirewallPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteTLSInspectionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1368,6 +1365,9 @@ func awsAwsjson10_deserializeOpErrorDescribeFirewallPolicy(response *smithyhttp. case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson10_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) @@ -1387,14 +1387,14 @@ func awsAwsjson10_deserializeOpErrorDescribeFirewallPolicy(response *smithyhttp. } } -type awsAwsjson10_deserializeOpDescribeLoggingConfiguration struct { +type awsAwsjson10_deserializeOpDescribeFirewall struct { } -func (*awsAwsjson10_deserializeOpDescribeLoggingConfiguration) ID() string { +func (*awsAwsjson10_deserializeOpDescribeFirewall) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDescribeLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeFirewall) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1408,9 +1408,9 @@ func (m *awsAwsjson10_deserializeOpDescribeLoggingConfiguration) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDescribeLoggingConfiguration(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeFirewall(response, &metadata) } - output := &DescribeLoggingConfigurationOutput{} + output := &DescribeFirewallOutput{} out.Result = output var buff [1024]byte @@ -1430,7 +1430,7 @@ func (m *awsAwsjson10_deserializeOpDescribeLoggingConfiguration) HandleDeseriali return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDescribeLoggingConfigurationOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeFirewallOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1444,7 +1444,7 @@ func (m *awsAwsjson10_deserializeOpDescribeLoggingConfiguration) HandleDeseriali return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDescribeLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeFirewall(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1507,14 +1507,14 @@ func awsAwsjson10_deserializeOpErrorDescribeLoggingConfiguration(response *smith } } -type awsAwsjson10_deserializeOpDescribeResourcePolicy struct { +type awsAwsjson10_deserializeOpDescribeFirewallPolicy struct { } -func (*awsAwsjson10_deserializeOpDescribeResourcePolicy) ID() string { +func (*awsAwsjson10_deserializeOpDescribeFirewallPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDescribeResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeFirewallPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1528,9 +1528,9 @@ func (m *awsAwsjson10_deserializeOpDescribeResourcePolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDescribeResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeFirewallPolicy(response, &metadata) } - output := &DescribeResourcePolicyOutput{} + output := &DescribeFirewallPolicyOutput{} out.Result = output var buff [1024]byte @@ -1550,7 +1550,7 @@ func (m *awsAwsjson10_deserializeOpDescribeResourcePolicy) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeFirewallPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1564,7 +1564,7 @@ func (m *awsAwsjson10_deserializeOpDescribeResourcePolicy) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDescribeResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeFirewallPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1627,14 +1627,14 @@ func awsAwsjson10_deserializeOpErrorDescribeResourcePolicy(response *smithyhttp. } } -type awsAwsjson10_deserializeOpDescribeRuleGroup struct { +type awsAwsjson10_deserializeOpDescribeLoggingConfiguration struct { } -func (*awsAwsjson10_deserializeOpDescribeRuleGroup) ID() string { +func (*awsAwsjson10_deserializeOpDescribeLoggingConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDescribeRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1648,9 +1648,9 @@ func (m *awsAwsjson10_deserializeOpDescribeRuleGroup) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDescribeRuleGroup(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeLoggingConfiguration(response, &metadata) } - output := &DescribeRuleGroupOutput{} + output := &DescribeLoggingConfigurationOutput{} out.Result = output var buff [1024]byte @@ -1670,7 +1670,7 @@ func (m *awsAwsjson10_deserializeOpDescribeRuleGroup) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDescribeRuleGroupOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeLoggingConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1684,7 +1684,7 @@ func (m *awsAwsjson10_deserializeOpDescribeRuleGroup) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDescribeRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1747,14 +1747,14 @@ func awsAwsjson10_deserializeOpErrorDescribeRuleGroup(response *smithyhttp.Respo } } -type awsAwsjson10_deserializeOpDescribeRuleGroupMetadata struct { +type awsAwsjson10_deserializeOpDescribeResourcePolicy struct { } -func (*awsAwsjson10_deserializeOpDescribeRuleGroupMetadata) ID() string { +func (*awsAwsjson10_deserializeOpDescribeResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDescribeRuleGroupMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1768,9 +1768,9 @@ func (m *awsAwsjson10_deserializeOpDescribeRuleGroupMetadata) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDescribeRuleGroupMetadata(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeResourcePolicy(response, &metadata) } - output := &DescribeRuleGroupMetadataOutput{} + output := &DescribeResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -1790,7 +1790,7 @@ func (m *awsAwsjson10_deserializeOpDescribeRuleGroupMetadata) HandleDeserialize( return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDescribeRuleGroupMetadataOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1804,7 +1804,7 @@ func (m *awsAwsjson10_deserializeOpDescribeRuleGroupMetadata) HandleDeserialize( return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDescribeRuleGroupMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1867,14 +1867,14 @@ func awsAwsjson10_deserializeOpErrorDescribeRuleGroupMetadata(response *smithyht } } -type awsAwsjson10_deserializeOpDisassociateSubnets struct { +type awsAwsjson10_deserializeOpDescribeRuleGroup struct { } -func (*awsAwsjson10_deserializeOpDisassociateSubnets) ID() string { +func (*awsAwsjson10_deserializeOpDescribeRuleGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDisassociateSubnets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1888,9 +1888,9 @@ func (m *awsAwsjson10_deserializeOpDisassociateSubnets) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDisassociateSubnets(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeRuleGroup(response, &metadata) } - output := &DisassociateSubnetsOutput{} + output := &DescribeRuleGroupOutput{} out.Result = output var buff [1024]byte @@ -1910,7 +1910,7 @@ func (m *awsAwsjson10_deserializeOpDisassociateSubnets) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDisassociateSubnetsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeRuleGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1924,7 +1924,7 @@ func (m *awsAwsjson10_deserializeOpDisassociateSubnets) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDisassociateSubnets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1968,15 +1968,9 @@ func awsAwsjson10_deserializeOpErrorDisassociateSubnets(response *smithyhttp.Res case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): - return awsAwsjson10_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidTokenException", errorCode): - return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1993,14 +1987,14 @@ func awsAwsjson10_deserializeOpErrorDisassociateSubnets(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpListFirewallPolicies struct { +type awsAwsjson10_deserializeOpDescribeRuleGroupMetadata struct { } -func (*awsAwsjson10_deserializeOpListFirewallPolicies) ID() string { +func (*awsAwsjson10_deserializeOpDescribeRuleGroupMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListFirewallPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeRuleGroupMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2014,9 +2008,9 @@ func (m *awsAwsjson10_deserializeOpListFirewallPolicies) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListFirewallPolicies(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeRuleGroupMetadata(response, &metadata) } - output := &ListFirewallPoliciesOutput{} + output := &DescribeRuleGroupMetadataOutput{} out.Result = output var buff [1024]byte @@ -2036,7 +2030,7 @@ func (m *awsAwsjson10_deserializeOpListFirewallPolicies) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListFirewallPoliciesOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeRuleGroupMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2050,7 +2044,7 @@ func (m *awsAwsjson10_deserializeOpListFirewallPolicies) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListFirewallPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeRuleGroupMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2097,6 +2091,9 @@ func awsAwsjson10_deserializeOpErrorListFirewallPolicies(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2110,14 +2107,14 @@ func awsAwsjson10_deserializeOpErrorListFirewallPolicies(response *smithyhttp.Re } } -type awsAwsjson10_deserializeOpListFirewalls struct { +type awsAwsjson10_deserializeOpDescribeTLSInspectionConfiguration struct { } -func (*awsAwsjson10_deserializeOpListFirewalls) ID() string { +func (*awsAwsjson10_deserializeOpDescribeTLSInspectionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListFirewalls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeTLSInspectionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2131,9 +2128,9 @@ func (m *awsAwsjson10_deserializeOpListFirewalls) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListFirewalls(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeTLSInspectionConfiguration(response, &metadata) } - output := &ListFirewallsOutput{} + output := &DescribeTLSInspectionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -2153,7 +2150,7 @@ func (m *awsAwsjson10_deserializeOpListFirewalls) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListFirewallsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeTLSInspectionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2167,7 +2164,7 @@ func (m *awsAwsjson10_deserializeOpListFirewalls) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListFirewalls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeTLSInspectionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2214,6 +2211,9 @@ func awsAwsjson10_deserializeOpErrorListFirewalls(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2227,14 +2227,14 @@ func awsAwsjson10_deserializeOpErrorListFirewalls(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpListRuleGroups struct { +type awsAwsjson10_deserializeOpDisassociateSubnets struct { } -func (*awsAwsjson10_deserializeOpListRuleGroups) ID() string { +func (*awsAwsjson10_deserializeOpDisassociateSubnets) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDisassociateSubnets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2248,9 +2248,9 @@ func (m *awsAwsjson10_deserializeOpListRuleGroups) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListRuleGroups(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDisassociateSubnets(response, &metadata) } - output := &ListRuleGroupsOutput{} + output := &DisassociateSubnetsOutput{} out.Result = output var buff [1024]byte @@ -2270,7 +2270,7 @@ func (m *awsAwsjson10_deserializeOpListRuleGroups) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListRuleGroupsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDisassociateSubnetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2284,7 +2284,7 @@ func (m *awsAwsjson10_deserializeOpListRuleGroups) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDisassociateSubnets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2328,9 +2328,18 @@ func awsAwsjson10_deserializeOpErrorListRuleGroups(response *smithyhttp.Response case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson10_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidTokenException", errorCode): + return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2344,14 +2353,14 @@ func awsAwsjson10_deserializeOpErrorListRuleGroups(response *smithyhttp.Response } } -type awsAwsjson10_deserializeOpListTagsForResource struct { +type awsAwsjson10_deserializeOpListFirewallPolicies struct { } -func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson10_deserializeOpListFirewallPolicies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListFirewallPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2365,9 +2374,9 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListFirewallPolicies(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListFirewallPoliciesOutput{} out.Result = output var buff [1024]byte @@ -2387,7 +2396,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListFirewallPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2401,7 +2410,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListFirewallPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2448,9 +2457,6 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2464,14 +2470,14 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpPutResourcePolicy struct { +type awsAwsjson10_deserializeOpListFirewalls struct { } -func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string { +func (*awsAwsjson10_deserializeOpListFirewalls) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListFirewalls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2485,9 +2491,9 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListFirewalls(response, &metadata) } - output := &PutResourcePolicyOutput{} + output := &ListFirewallsOutput{} out.Result = output var buff [1024]byte @@ -2507,7 +2513,7 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListFirewallsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2521,7 +2527,7 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListFirewalls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2568,12 +2574,6 @@ func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidResourcePolicyException", errorCode): - return awsAwsjson10_deserializeErrorInvalidResourcePolicyException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2587,14 +2587,14 @@ func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } } -type awsAwsjson10_deserializeOpTagResource struct { +type awsAwsjson10_deserializeOpListRuleGroups struct { } -func (*awsAwsjson10_deserializeOpTagResource) ID() string { +func (*awsAwsjson10_deserializeOpListRuleGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2608,9 +2608,9 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListRuleGroups(response, &metadata) } - output := &TagResourceOutput{} + output := &ListRuleGroupsOutput{} out.Result = output var buff [1024]byte @@ -2630,7 +2630,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListRuleGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2644,7 +2644,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2691,9 +2691,6 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2707,14 +2704,14 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpUntagResource struct { +type awsAwsjson10_deserializeOpListTagsForResource struct { } -func (*awsAwsjson10_deserializeOpUntagResource) ID() string { +func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_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) @@ -2728,9 +2725,9 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UntagResourceOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -2750,7 +2747,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUntagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2764,7 +2761,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_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)} @@ -2827,14 +2824,14 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection struct { +type awsAwsjson10_deserializeOpListTLSInspectionConfigurations struct { } -func (*awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection) ID() string { +func (*awsAwsjson10_deserializeOpListTLSInspectionConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTLSInspectionConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2848,9 +2845,9 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallDeleteProtection(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTLSInspectionConfigurations(response, &metadata) } - output := &UpdateFirewallDeleteProtectionOutput{} + output := &ListTLSInspectionConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -2870,7 +2867,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection) HandleDeseria return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateFirewallDeleteProtectionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTLSInspectionConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2884,7 +2881,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection) HandleDeseria return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateFirewallDeleteProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTLSInspectionConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2931,15 +2928,6 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallDeleteProtection(response *smi case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidTokenException", errorCode): - return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ResourceOwnerCheckException", errorCode): - return awsAwsjson10_deserializeErrorResourceOwnerCheckException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2953,14 +2941,14 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallDeleteProtection(response *smi } } -type awsAwsjson10_deserializeOpUpdateFirewallDescription struct { +type awsAwsjson10_deserializeOpPutResourcePolicy struct { } -func (*awsAwsjson10_deserializeOpUpdateFirewallDescription) ID() string { +func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateFirewallDescription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2974,9 +2962,9 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallDescription) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallDescription(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata) } - output := &UpdateFirewallDescriptionOutput{} + output := &PutResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -2996,7 +2984,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallDescription) HandleDeserialize( return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateFirewallDescriptionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3010,7 +2998,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallDescription) HandleDeserialize( return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateFirewallDescription(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3057,8 +3045,8 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallDescription(response *smithyht case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidTokenException", errorCode): - return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) + case strings.EqualFold("InvalidResourcePolicyException", errorCode): + return awsAwsjson10_deserializeErrorInvalidResourcePolicyException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3076,14 +3064,14 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallDescription(response *smithyht } } -type awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration struct { +type awsAwsjson10_deserializeOpTagResource struct { } -func (*awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration) ID() string { +func (*awsAwsjson10_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_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) @@ -3097,9 +3085,9 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallEncryptionConfiguration(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) } - output := &UpdateFirewallEncryptionConfigurationOutput{} + output := &TagResourceOutput{} out.Result = output var buff [1024]byte @@ -3119,7 +3107,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration) Handle return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateFirewallEncryptionConfigurationOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentTagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3133,7 +3121,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration) Handle return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateFirewallEncryptionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_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)} @@ -3180,15 +3168,9 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallEncryptionConfiguration(respon case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidTokenException", errorCode): - return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ResourceOwnerCheckException", errorCode): - return awsAwsjson10_deserializeErrorResourceOwnerCheckException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -3202,14 +3184,14 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallEncryptionConfiguration(respon } } -type awsAwsjson10_deserializeOpUpdateFirewallPolicy struct { +type awsAwsjson10_deserializeOpUntagResource struct { } -func (*awsAwsjson10_deserializeOpUpdateFirewallPolicy) ID() string { +func (*awsAwsjson10_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_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) @@ -3223,9 +3205,9 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallPolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) } - output := &UpdateFirewallPolicyOutput{} + output := &UntagResourceOutput{} out.Result = output var buff [1024]byte @@ -3245,7 +3227,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicy) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateFirewallPolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentUntagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3259,7 +3241,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateFirewallPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_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)} @@ -3306,9 +3288,6 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallPolicy(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidTokenException", errorCode): - return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3325,14 +3304,14 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallPolicy(response *smithyhttp.Re } } -type awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection struct { +type awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection struct { } -func (*awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection) ID() string { +func (*awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateFirewallDeleteProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3346,9 +3325,9 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallPolicyChangeProtection(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallDeleteProtection(response, &metadata) } - output := &UpdateFirewallPolicyChangeProtectionOutput{} + output := &UpdateFirewallDeleteProtectionOutput{} out.Result = output var buff [1024]byte @@ -3368,7 +3347,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection) HandleD return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateFirewallPolicyChangeProtectionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentUpdateFirewallDeleteProtectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3382,7 +3361,7 @@ func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection) HandleD return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateFirewallPolicyChangeProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateFirewallDeleteProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3451,14 +3430,14 @@ func awsAwsjson10_deserializeOpErrorUpdateFirewallPolicyChangeProtection(respons } } -type awsAwsjson10_deserializeOpUpdateLoggingConfiguration struct { +type awsAwsjson10_deserializeOpUpdateFirewallDescription struct { } -func (*awsAwsjson10_deserializeOpUpdateLoggingConfiguration) ID() string { +func (*awsAwsjson10_deserializeOpUpdateFirewallDescription) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateFirewallDescription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3472,9 +3451,9 @@ func (m *awsAwsjson10_deserializeOpUpdateLoggingConfiguration) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateLoggingConfiguration(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallDescription(response, &metadata) } - output := &UpdateLoggingConfigurationOutput{} + output := &UpdateFirewallDescriptionOutput{} out.Result = output var buff [1024]byte @@ -3494,7 +3473,7 @@ func (m *awsAwsjson10_deserializeOpUpdateLoggingConfiguration) HandleDeserialize return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateLoggingConfigurationOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentUpdateFirewallDescriptionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3508,7 +3487,7 @@ func (m *awsAwsjson10_deserializeOpUpdateLoggingConfiguration) HandleDeserialize return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateFirewallDescription(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3558,9 +3537,6 @@ func awsAwsjson10_deserializeOpErrorUpdateLoggingConfiguration(response *smithyh case strings.EqualFold("InvalidTokenException", errorCode): return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) - case strings.EqualFold("LogDestinationPermissionException", errorCode): - return awsAwsjson10_deserializeErrorLogDestinationPermissionException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3577,14 +3553,14 @@ func awsAwsjson10_deserializeOpErrorUpdateLoggingConfiguration(response *smithyh } } -type awsAwsjson10_deserializeOpUpdateRuleGroup struct { +type awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration struct { } -func (*awsAwsjson10_deserializeOpUpdateRuleGroup) ID() string { +func (*awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateFirewallEncryptionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3598,9 +3574,9 @@ func (m *awsAwsjson10_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateRuleGroup(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallEncryptionConfiguration(response, &metadata) } - output := &UpdateRuleGroupOutput{} + output := &UpdateFirewallEncryptionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -3620,7 +3596,7 @@ func (m *awsAwsjson10_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateRuleGroupOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentUpdateFirewallEncryptionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3634,7 +3610,7 @@ func (m *awsAwsjson10_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateFirewallEncryptionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3687,6 +3663,9 @@ func awsAwsjson10_deserializeOpErrorUpdateRuleGroup(response *smithyhttp.Respons case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceOwnerCheckException", errorCode): + return awsAwsjson10_deserializeErrorResourceOwnerCheckException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -3700,14 +3679,14 @@ func awsAwsjson10_deserializeOpErrorUpdateRuleGroup(response *smithyhttp.Respons } } -type awsAwsjson10_deserializeOpUpdateSubnetChangeProtection struct { +type awsAwsjson10_deserializeOpUpdateFirewallPolicy struct { } -func (*awsAwsjson10_deserializeOpUpdateSubnetChangeProtection) ID() string { +func (*awsAwsjson10_deserializeOpUpdateFirewallPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateSubnetChangeProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3721,9 +3700,9 @@ func (m *awsAwsjson10_deserializeOpUpdateSubnetChangeProtection) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateSubnetChangeProtection(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateFirewallPolicy(response, &metadata) } - output := &UpdateSubnetChangeProtectionOutput{} + output := &UpdateFirewallPolicyOutput{} out.Result = output var buff [1024]byte @@ -3743,7 +3722,7 @@ func (m *awsAwsjson10_deserializeOpUpdateSubnetChangeProtection) HandleDeseriali return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateSubnetChangeProtectionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentUpdateFirewallPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3757,7 +3736,7 @@ func (m *awsAwsjson10_deserializeOpUpdateSubnetChangeProtection) HandleDeseriali return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateSubnetChangeProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateFirewallPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3810,9 +3789,6 @@ func awsAwsjson10_deserializeOpErrorUpdateSubnetChangeProtection(response *smith case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ResourceOwnerCheckException", errorCode): - return awsAwsjson10_deserializeErrorResourceOwnerCheckException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -3826,11 +3802,36 @@ func awsAwsjson10_deserializeOpErrorUpdateSubnetChangeProtection(response *smith } } -func awsAwsjson10_deserializeErrorInsufficientCapacityException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +type awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection struct { +} + +func (*awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateFirewallPolicyChangeProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsAwsjson10_deserializeOpErrorUpdateFirewallPolicyChangeProtection(response, &metadata) + } + output := &UpdateFirewallPolicyChangeProtectionOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -3841,12 +3842,10 @@ func awsAwsjson10_deserializeErrorInsufficientCapacityException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.InsufficientCapacityException{} - err := awsAwsjson10_deserializeDocumentInsufficientCapacityException(&output, shape) - + err = awsAwsjson10_deserializeOpDocumentUpdateFirewallPolicyChangeProtectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3854,34 +3853,34 @@ func awsAwsjson10_deserializeErrorInsufficientCapacityException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson10_deserializeErrorInternalServerError(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeOpErrorUpdateFirewallPolicyChangeProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InternalServerError{} - err := awsAwsjson10_deserializeDocumentInternalServerError(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3893,11 +3892,612 @@ func awsAwsjson10_deserializeErrorInternalServerError(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson10_deserializeErrorInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidTokenException", errorCode): + return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceOwnerCheckException", errorCode): + return awsAwsjson10_deserializeErrorResourceOwnerCheckException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateLoggingConfiguration struct { +} + +func (*awsAwsjson10_deserializeOpUpdateLoggingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsAwsjson10_deserializeOpErrorUpdateLoggingConfiguration(response, &metadata) + } + output := &UpdateLoggingConfigurationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentUpdateLoggingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidTokenException", errorCode): + return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) + + case strings.EqualFold("LogDestinationPermissionException", errorCode): + return awsAwsjson10_deserializeErrorLogDestinationPermissionException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateRuleGroup struct { +} + +func (*awsAwsjson10_deserializeOpUpdateRuleGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsAwsjson10_deserializeOpErrorUpdateRuleGroup(response, &metadata) + } + output := &UpdateRuleGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentUpdateRuleGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidTokenException", errorCode): + return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateSubnetChangeProtection struct { +} + +func (*awsAwsjson10_deserializeOpUpdateSubnetChangeProtection) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateSubnetChangeProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsAwsjson10_deserializeOpErrorUpdateSubnetChangeProtection(response, &metadata) + } + output := &UpdateSubnetChangeProtectionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentUpdateSubnetChangeProtectionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateSubnetChangeProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidTokenException", errorCode): + return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceOwnerCheckException", errorCode): + return awsAwsjson10_deserializeErrorResourceOwnerCheckException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateTLSInspectionConfiguration struct { +} + +func (*awsAwsjson10_deserializeOpUpdateTLSInspectionConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateTLSInspectionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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, awsAwsjson10_deserializeOpErrorUpdateTLSInspectionConfiguration(response, &metadata) + } + output := &UpdateTLSInspectionConfigurationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentUpdateTLSInspectionConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateTLSInspectionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson10_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidTokenException", errorCode): + return awsAwsjson10_deserializeErrorInvalidTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson10_deserializeErrorInsufficientCapacityException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InsufficientCapacityException{} + err := awsAwsjson10_deserializeDocumentInsufficientCapacityException(&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 awsAwsjson10_deserializeErrorInternalServerError(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InternalServerError{} + err := awsAwsjson10_deserializeDocumentInternalServerError(&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 awsAwsjson10_deserializeErrorInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -4459,6 +5059,40 @@ func awsAwsjson10_deserializeDocumentCapacityUsageSummary(v **types.CapacityUsag return nil } +func awsAwsjson10_deserializeDocumentCertificates(v *[]types.TlsCertificateData, 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.TlsCertificateData + if *v == nil { + cv = []types.TlsCertificateData{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TlsCertificateData + destAddr := &col + if err := awsAwsjson10_deserializeDocumentTlsCertificateData(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentCIDRSummary(v **types.CIDRSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4990,6 +5624,15 @@ func awsAwsjson10_deserializeDocumentFirewallPolicy(v **types.FirewallPolicy, va return err } + case "TLSInspectionConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.TLSInspectionConfigurationArn = ptr.String(jtv) + } + default: _, _ = key, value @@ -7127,11 +7770,257 @@ func awsAwsjson10_deserializeDocumentRuleTargets(v *[]string, value interface{}) cv = append(cv, col) } - *v = cv + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentRuleVariables(v **types.RuleVariables, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RuleVariables + if *v == nil { + sv = &types.RuleVariables{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IPSets": + if err := awsAwsjson10_deserializeDocumentIPSets(&sv.IPSets, value); err != nil { + return err + } + + case "PortSets": + if err := awsAwsjson10_deserializeDocumentPortSets(&sv.PortSets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentServerCertificate(v **types.ServerCertificate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServerCertificate + if *v == nil { + sv = &types.ServerCertificate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentServerCertificateConfiguration(v **types.ServerCertificateConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServerCertificateConfiguration + if *v == nil { + sv = &types.ServerCertificateConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Scopes": + if err := awsAwsjson10_deserializeDocumentServerCertificateScopes(&sv.Scopes, value); err != nil { + return err + } + + case "ServerCertificates": + if err := awsAwsjson10_deserializeDocumentServerCertificates(&sv.ServerCertificates, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentServerCertificateConfigurations(v *[]types.ServerCertificateConfiguration, 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.ServerCertificateConfiguration + if *v == nil { + cv = []types.ServerCertificateConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServerCertificateConfiguration + destAddr := &col + if err := awsAwsjson10_deserializeDocumentServerCertificateConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentServerCertificates(v *[]types.ServerCertificate, 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.ServerCertificate + if *v == nil { + cv = []types.ServerCertificate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServerCertificate + destAddr := &col + if err := awsAwsjson10_deserializeDocumentServerCertificate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentServerCertificateScope(v **types.ServerCertificateScope, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServerCertificateScope + if *v == nil { + sv = &types.ServerCertificateScope{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DestinationPorts": + if err := awsAwsjson10_deserializeDocumentPortRanges(&sv.DestinationPorts, value); err != nil { + return err + } + + case "Destinations": + if err := awsAwsjson10_deserializeDocumentAddresses(&sv.Destinations, value); err != nil { + return err + } + + case "Protocols": + if err := awsAwsjson10_deserializeDocumentProtocolNumbers(&sv.Protocols, value); err != nil { + return err + } + + case "SourcePorts": + if err := awsAwsjson10_deserializeDocumentPortRanges(&sv.SourcePorts, value); err != nil { + return err + } + + case "Sources": + if err := awsAwsjson10_deserializeDocumentAddresses(&sv.Sources, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv return nil } -func awsAwsjson10_deserializeDocumentRuleVariables(v **types.RuleVariables, value interface{}) error { +func awsAwsjson10_deserializeDocumentServerCertificateScopes(v *[]types.ServerCertificateScope, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7139,36 +8028,29 @@ func awsAwsjson10_deserializeDocumentRuleVariables(v **types.RuleVariables, valu return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RuleVariables + var cv []types.ServerCertificateScope if *v == nil { - sv = &types.RuleVariables{} + cv = []types.ServerCertificateScope{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "IPSets": - if err := awsAwsjson10_deserializeDocumentIPSets(&sv.IPSets, value); err != nil { - return err - } - - case "PortSets": - if err := awsAwsjson10_deserializeDocumentPortSets(&sv.PortSets, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.ServerCertificateScope + destAddr := &col + if err := awsAwsjson10_deserializeDocumentServerCertificateScope(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -7890,11 +8772,239 @@ func awsAwsjson10_deserializeDocumentSubnetMapping(v **types.SubnetMapping, valu } } - *v = sv + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSubnetMappings(v *[]types.SubnetMapping, 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.SubnetMapping + if *v == nil { + cv = []types.SubnetMapping{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SubnetMapping + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSubnetMapping(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncState(v **types.SyncState, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SyncState + if *v == nil { + sv = &types.SyncState{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Attachment": + if err := awsAwsjson10_deserializeDocumentAttachment(&sv.Attachment, value); err != nil { + return err + } + + case "Config": + if err := awsAwsjson10_deserializeDocumentSyncStateConfig(&sv.Config, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncStateConfig(v *map[string]types.PerObjectStatus, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.PerObjectStatus + if *v == nil { + mv = map[string]types.PerObjectStatus{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.PerObjectStatus + mapVar := parsedVal + destAddr := &mapVar + if err := awsAwsjson10_deserializeDocumentPerObjectStatus(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson10_deserializeDocumentSyncStates(v *map[string]types.SyncState, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.SyncState + if *v == nil { + mv = map[string]types.SyncState{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.SyncState + mapVar := parsedVal + destAddr := &mapVar + if err := awsAwsjson10_deserializeDocumentSyncState(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson10_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 awsAwsjson10_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 := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } -func awsAwsjson10_deserializeDocumentSubnetMappings(v *[]types.SubnetMapping, value interface{}) error { +func awsAwsjson10_deserializeDocumentTargetTypes(v *[]types.TargetType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7907,20 +9017,22 @@ func awsAwsjson10_deserializeDocumentSubnetMappings(v *[]types.SubnetMapping, va return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SubnetMapping + var cv []types.TargetType if *v == nil { - cv = []types.SubnetMapping{} + cv = []types.TargetType{} } else { cv = *v } for _, value := range shape { - var col types.SubnetMapping - destAddr := &col - if err := awsAwsjson10_deserializeDocumentSubnetMapping(&destAddr, value); err != nil { - return err + var col types.TargetType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetType to be of type string, got %T instead", value) + } + col = types.TargetType(jtv) } - col = *destAddr cv = append(cv, col) } @@ -7928,7 +9040,7 @@ func awsAwsjson10_deserializeDocumentSubnetMappings(v *[]types.SubnetMapping, va return nil } -func awsAwsjson10_deserializeDocumentSyncState(v **types.SyncState, value interface{}) error { +func awsAwsjson10_deserializeDocumentTCPFlagField(v **types.TCPFlagField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7941,22 +9053,22 @@ func awsAwsjson10_deserializeDocumentSyncState(v **types.SyncState, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SyncState + var sv *types.TCPFlagField if *v == nil { - sv = &types.SyncState{} + sv = &types.TCPFlagField{} } else { sv = *v } for key, value := range shape { switch key { - case "Attachment": - if err := awsAwsjson10_deserializeDocumentAttachment(&sv.Attachment, value); err != nil { + case "Flags": + if err := awsAwsjson10_deserializeDocumentFlags(&sv.Flags, value); err != nil { return err } - case "Config": - if err := awsAwsjson10_deserializeDocumentSyncStateConfig(&sv.Config, value); err != nil { + case "Masks": + if err := awsAwsjson10_deserializeDocumentFlags(&sv.Masks, value); err != nil { return err } @@ -7969,7 +9081,7 @@ func awsAwsjson10_deserializeDocumentSyncState(v **types.SyncState, value interf return nil } -func awsAwsjson10_deserializeDocumentSyncStateConfig(v *map[string]types.PerObjectStatus, value interface{}) error { +func awsAwsjson10_deserializeDocumentTCPFlags(v *[]types.TCPFlagField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7977,34 +9089,33 @@ func awsAwsjson10_deserializeDocumentSyncStateConfig(v *map[string]types.PerObje return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.PerObjectStatus + var cv []types.TCPFlagField if *v == nil { - mv = map[string]types.PerObjectStatus{} + cv = []types.TCPFlagField{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal types.PerObjectStatus - mapVar := parsedVal - destAddr := &mapVar - if err := awsAwsjson10_deserializeDocumentPerObjectStatus(&destAddr, value); err != nil { + for _, value := range shape { + var col types.TCPFlagField + destAddr := &col + if err := awsAwsjson10_deserializeDocumentTCPFlagField(&destAddr, value); err != nil { return err } - parsedVal = *destAddr - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsAwsjson10_deserializeDocumentSyncStates(v *map[string]types.SyncState, value interface{}) error { +func awsAwsjson10_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8017,29 +9128,34 @@ func awsAwsjson10_deserializeDocumentSyncStates(v *map[string]types.SyncState, v return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.SyncState + var sv *types.ThrottlingException if *v == nil { - mv = map[string]types.SyncState{} + sv = &types.ThrottlingException{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal types.SyncState - mapVar := parsedVal - destAddr := &mapVar - if err := awsAwsjson10_deserializeDocumentSyncState(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = mv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error { +func awsAwsjson10_deserializeDocumentTlsCertificateData(v **types.TlsCertificateData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8052,31 +9168,49 @@ func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Tag + var sv *types.TlsCertificateData if *v == nil { - sv = &types.Tag{} + sv = &types.TlsCertificateData{} } else { sv = *v } for key, value := range shape { switch key { - case "Key": + case "CertificateArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) } - sv.Key = ptr.String(jtv) + sv.CertificateArn = ptr.String(jtv) } - case "Value": + case "CertificateSerial": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + return fmt.Errorf("expected CollectionMember_String to be of type string, got %T instead", value) } - sv.Value = ptr.String(jtv) + sv.CertificateSerial = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CollectionMember_String to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) } default: @@ -8088,7 +9222,7 @@ func awsAwsjson10_deserializeDocumentTag(v **types.Tag, value interface{}) error return nil } -func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { +func awsAwsjson10_deserializeDocumentTLSInspectionConfiguration(v **types.TLSInspectionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8096,33 +9230,35 @@ func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Tag + var sv *types.TLSInspectionConfiguration if *v == nil { - cv = []types.Tag{} + sv = &types.TLSInspectionConfiguration{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Tag - destAddr := &col - if err := awsAwsjson10_deserializeDocumentTag(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "ServerCertificateConfigurations": + if err := awsAwsjson10_deserializeDocumentServerCertificateConfigurations(&sv.ServerCertificateConfigurations, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentTargetTypes(v *[]types.TargetType, value interface{}) error { +func awsAwsjson10_deserializeDocumentTLSInspectionConfigurationMetadata(v **types.TLSInspectionConfigurationMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8130,35 +9266,48 @@ func awsAwsjson10_deserializeDocumentTargetTypes(v *[]types.TargetType, value in return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.TargetType + var sv *types.TLSInspectionConfigurationMetadata if *v == nil { - cv = []types.TargetType{} + sv = &types.TLSInspectionConfigurationMetadata{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.TargetType - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TargetType to be of type string, got %T instead", value) + 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) } - col = types.TargetType(jtv) - } - cv = append(cv, col) + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson10_deserializeDocumentTCPFlagField(v **types.TCPFlagField, value interface{}) error { +func awsAwsjson10_deserializeDocumentTLSInspectionConfigurationResponse(v **types.TLSInspectionConfigurationResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8171,23 +9320,102 @@ func awsAwsjson10_deserializeDocumentTCPFlagField(v **types.TCPFlagField, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.TCPFlagField + var sv *types.TLSInspectionConfigurationResponse if *v == nil { - sv = &types.TCPFlagField{} + sv = &types.TLSInspectionConfigurationResponse{} } else { sv = *v } for key, value := range shape { switch key { - case "Flags": - if err := awsAwsjson10_deserializeDocumentFlags(&sv.Flags, value); err != nil { + case "Certificates": + if err := awsAwsjson10_deserializeDocumentCertificates(&sv.Certificates, value); err != nil { + return err + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EncryptionConfiguration": + if err := awsAwsjson10_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil { + return err + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastUpdateTime to be a JSON Number, got %T instead", value) + + } + } + + case "NumberOfAssociations": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NumberOfAssociations to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfAssociations = ptr.Int32(int32(i64)) + } + + case "Tags": + if err := awsAwsjson10_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } - case "Masks": - if err := awsAwsjson10_deserializeDocumentFlags(&sv.Masks, value); err != nil { - return err + case "TLSInspectionConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.TLSInspectionConfigurationArn = ptr.String(jtv) + } + + case "TLSInspectionConfigurationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.TLSInspectionConfigurationId = ptr.String(jtv) + } + + case "TLSInspectionConfigurationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.TLSInspectionConfigurationName = ptr.String(jtv) + } + + case "TLSInspectionConfigurationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) + } + sv.TLSInspectionConfigurationStatus = types.ResourceStatus(jtv) } default: @@ -8199,7 +9427,7 @@ func awsAwsjson10_deserializeDocumentTCPFlagField(v **types.TCPFlagField, value return nil } -func awsAwsjson10_deserializeDocumentTCPFlags(v *[]types.TCPFlagField, value interface{}) error { +func awsAwsjson10_deserializeDocumentTLSInspectionConfigurations(v *[]types.TLSInspectionConfigurationMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8212,17 +9440,17 @@ func awsAwsjson10_deserializeDocumentTCPFlags(v *[]types.TCPFlagField, value int return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.TCPFlagField + var cv []types.TLSInspectionConfigurationMetadata if *v == nil { - cv = []types.TCPFlagField{} + cv = []types.TLSInspectionConfigurationMetadata{} } else { cv = *v } for _, value := range shape { - var col types.TCPFlagField + var col types.TLSInspectionConfigurationMetadata destAddr := &col - if err := awsAwsjson10_deserializeDocumentTCPFlagField(&destAddr, value); err != nil { + if err := awsAwsjson10_deserializeDocumentTLSInspectionConfigurationMetadata(&destAddr, value); err != nil { return err } col = *destAddr @@ -8233,46 +9461,6 @@ func awsAwsjson10_deserializeDocumentTCPFlags(v *[]types.TCPFlagField, value int return nil } -func awsAwsjson10_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 ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson10_deserializeDocumentUnsupportedOperationException(v **types.UnsupportedOperationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8610,6 +9798,51 @@ func awsAwsjson10_deserializeOpDocumentCreateRuleGroupOutput(v **CreateRuleGroup return nil } +func awsAwsjson10_deserializeOpDocumentCreateTLSInspectionConfigurationOutput(v **CreateTLSInspectionConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateTLSInspectionConfigurationOutput + if *v == nil { + sv = &CreateTLSInspectionConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TLSInspectionConfigurationResponse": + if err := awsAwsjson10_deserializeDocumentTLSInspectionConfigurationResponse(&sv.TLSInspectionConfigurationResponse, value); err != nil { + return err + } + + case "UpdateToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateToken to be of type string, got %T instead", value) + } + sv.UpdateToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentDeleteFirewallOutput(v **DeleteFirewallOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8754,6 +9987,42 @@ func awsAwsjson10_deserializeOpDocumentDeleteRuleGroupOutput(v **DeleteRuleGroup return nil } +func awsAwsjson10_deserializeOpDocumentDeleteTLSInspectionConfigurationOutput(v **DeleteTLSInspectionConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteTLSInspectionConfigurationOutput + if *v == nil { + sv = &DeleteTLSInspectionConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TLSInspectionConfigurationResponse": + if err := awsAwsjson10_deserializeDocumentTLSInspectionConfigurationResponse(&sv.TLSInspectionConfigurationResponse, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentDescribeFirewallOutput(v **DescribeFirewallOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9090,6 +10359,56 @@ func awsAwsjson10_deserializeOpDocumentDescribeRuleGroupOutput(v **DescribeRuleG return nil } +func awsAwsjson10_deserializeOpDocumentDescribeTLSInspectionConfigurationOutput(v **DescribeTLSInspectionConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeTLSInspectionConfigurationOutput + if *v == nil { + sv = &DescribeTLSInspectionConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TLSInspectionConfiguration": + if err := awsAwsjson10_deserializeDocumentTLSInspectionConfiguration(&sv.TLSInspectionConfiguration, value); err != nil { + return err + } + + case "TLSInspectionConfigurationResponse": + if err := awsAwsjson10_deserializeDocumentTLSInspectionConfigurationResponse(&sv.TLSInspectionConfigurationResponse, value); err != nil { + return err + } + + case "UpdateToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateToken to be of type string, got %T instead", value) + } + sv.UpdateToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentDisassociateSubnetsOutput(v **DisassociateSubnetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9333,6 +10652,51 @@ func awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } +func awsAwsjson10_deserializeOpDocumentListTLSInspectionConfigurationsOutput(v **ListTLSInspectionConfigurationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTLSInspectionConfigurationsOutput + if *v == nil { + sv = &ListTLSInspectionConfigurationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "TLSInspectionConfigurations": + if err := awsAwsjson10_deserializeDocumentTLSInspectionConfigurations(&sv.TLSInspectionConfigurations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9900,3 +11264,48 @@ func awsAwsjson10_deserializeOpDocumentUpdateSubnetChangeProtectionOutput(v **Up *v = sv return nil } + +func awsAwsjson10_deserializeOpDocumentUpdateTLSInspectionConfigurationOutput(v **UpdateTLSInspectionConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateTLSInspectionConfigurationOutput + if *v == nil { + sv = &UpdateTLSInspectionConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TLSInspectionConfigurationResponse": + if err := awsAwsjson10_deserializeDocumentTLSInspectionConfigurationResponse(&sv.TLSInspectionConfigurationResponse, value); err != nil { + return err + } + + case "UpdateToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateToken to be of type string, got %T instead", value) + } + sv.UpdateToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/networkfirewall/generated.json b/service/networkfirewall/generated.json index 04a60dce3fb..30ed8568eb0 100644 --- a/service/networkfirewall/generated.json +++ b/service/networkfirewall/generated.json @@ -13,20 +13,24 @@ "api_op_CreateFirewall.go", "api_op_CreateFirewallPolicy.go", "api_op_CreateRuleGroup.go", + "api_op_CreateTLSInspectionConfiguration.go", "api_op_DeleteFirewall.go", "api_op_DeleteFirewallPolicy.go", "api_op_DeleteResourcePolicy.go", "api_op_DeleteRuleGroup.go", + "api_op_DeleteTLSInspectionConfiguration.go", "api_op_DescribeFirewall.go", "api_op_DescribeFirewallPolicy.go", "api_op_DescribeLoggingConfiguration.go", "api_op_DescribeResourcePolicy.go", "api_op_DescribeRuleGroup.go", "api_op_DescribeRuleGroupMetadata.go", + "api_op_DescribeTLSInspectionConfiguration.go", "api_op_DisassociateSubnets.go", "api_op_ListFirewallPolicies.go", "api_op_ListFirewalls.go", "api_op_ListRuleGroups.go", + "api_op_ListTLSInspectionConfigurations.go", "api_op_ListTagsForResource.go", "api_op_PutResourcePolicy.go", "api_op_TagResource.go", @@ -39,6 +43,7 @@ "api_op_UpdateLoggingConfiguration.go", "api_op_UpdateRuleGroup.go", "api_op_UpdateSubnetChangeProtection.go", + "api_op_UpdateTLSInspectionConfiguration.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/networkfirewall/serializers.go b/service/networkfirewall/serializers.go index f3b92faeb6c..3fbafef54b8 100644 --- a/service/networkfirewall/serializers.go +++ b/service/networkfirewall/serializers.go @@ -290,6 +290,61 @@ func (m *awsAwsjson10_serializeOpCreateRuleGroup) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpCreateTLSInspectionConfiguration struct { +} + +func (*awsAwsjson10_serializeOpCreateTLSInspectionConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateTLSInspectionConfiguration) 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.(*CreateTLSInspectionConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("NetworkFirewall_20201112.CreateTLSInspectionConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateTLSInspectionConfigurationInput(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 awsAwsjson10_serializeOpDeleteFirewall struct { } @@ -510,6 +565,61 @@ func (m *awsAwsjson10_serializeOpDeleteRuleGroup) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDeleteTLSInspectionConfiguration struct { +} + +func (*awsAwsjson10_serializeOpDeleteTLSInspectionConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteTLSInspectionConfiguration) 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.(*DeleteTLSInspectionConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("NetworkFirewall_20201112.DeleteTLSInspectionConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteTLSInspectionConfigurationInput(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 awsAwsjson10_serializeOpDescribeFirewall struct { } @@ -840,6 +950,61 @@ func (m *awsAwsjson10_serializeOpDescribeRuleGroupMetadata) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDescribeTLSInspectionConfiguration struct { +} + +func (*awsAwsjson10_serializeOpDescribeTLSInspectionConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeTLSInspectionConfiguration) 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.(*DescribeTLSInspectionConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("NetworkFirewall_20201112.DescribeTLSInspectionConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeTLSInspectionConfigurationInput(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 awsAwsjson10_serializeOpDisassociateSubnets struct { } @@ -1115,6 +1280,61 @@ func (m *awsAwsjson10_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListTLSInspectionConfigurations struct { +} + +func (*awsAwsjson10_serializeOpListTLSInspectionConfigurations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListTLSInspectionConfigurations) 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.(*ListTLSInspectionConfigurationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("NetworkFirewall_20201112.ListTLSInspectionConfigurations") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListTLSInspectionConfigurationsInput(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 awsAwsjson10_serializeOpPutResourcePolicy struct { } @@ -1719,6 +1939,61 @@ func (m *awsAwsjson10_serializeOpUpdateSubnetChangeProtection) HandleSerialize(c return next.HandleSerialize(ctx, in) } + +type awsAwsjson10_serializeOpUpdateTLSInspectionConfiguration struct { +} + +func (*awsAwsjson10_serializeOpUpdateTLSInspectionConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateTLSInspectionConfiguration) 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.(*UpdateTLSInspectionConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("NetworkFirewall_20201112.UpdateTLSInspectionConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateTLSInspectionConfigurationInput(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) +} func awsAwsjson10_serializeDocumentActionDefinition(v *types.ActionDefinition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1896,6 +2171,11 @@ func awsAwsjson10_serializeDocumentFirewallPolicy(v *types.FirewallPolicy, value } } + if v.TLSInspectionConfigurationArn != nil { + ok := object.Key("TLSInspectionConfigurationArn") + ok.String(*v.TLSInspectionConfigurationArn) + } + return nil } @@ -2388,6 +2668,120 @@ func awsAwsjson10_serializeDocumentRuleVariables(v *types.RuleVariables, value s return nil } +func awsAwsjson10_serializeDocumentServerCertificate(v *types.ServerCertificate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsjson10_serializeDocumentServerCertificateConfiguration(v *types.ServerCertificateConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Scopes != nil { + ok := object.Key("Scopes") + if err := awsAwsjson10_serializeDocumentServerCertificateScopes(v.Scopes, ok); err != nil { + return err + } + } + + if v.ServerCertificates != nil { + ok := object.Key("ServerCertificates") + if err := awsAwsjson10_serializeDocumentServerCertificates(v.ServerCertificates, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentServerCertificateConfigurations(v []types.ServerCertificateConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentServerCertificateConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentServerCertificates(v []types.ServerCertificate, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentServerCertificate(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentServerCertificateScope(v *types.ServerCertificateScope, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DestinationPorts != nil { + ok := object.Key("DestinationPorts") + if err := awsAwsjson10_serializeDocumentPortRanges(v.DestinationPorts, ok); err != nil { + return err + } + } + + if v.Destinations != nil { + ok := object.Key("Destinations") + if err := awsAwsjson10_serializeDocumentAddresses(v.Destinations, ok); err != nil { + return err + } + } + + if v.Protocols != nil { + ok := object.Key("Protocols") + if err := awsAwsjson10_serializeDocumentProtocolNumbers(v.Protocols, ok); err != nil { + return err + } + } + + if v.SourcePorts != nil { + ok := object.Key("SourcePorts") + if err := awsAwsjson10_serializeDocumentPortRanges(v.SourcePorts, ok); err != nil { + return err + } + } + + if v.Sources != nil { + ok := object.Key("Sources") + if err := awsAwsjson10_serializeDocumentAddresses(v.Sources, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentServerCertificateScopes(v []types.ServerCertificateScope, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentServerCertificateScope(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson10_serializeDocumentSettings(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -2754,6 +3148,20 @@ func awsAwsjson10_serializeDocumentTCPFlags(v []types.TCPFlagField, value smithy return nil } +func awsAwsjson10_serializeDocumentTLSInspectionConfiguration(v *types.TLSInspectionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ServerCertificateConfigurations != nil { + ok := object.Key("ServerCertificateConfigurations") + if err := awsAwsjson10_serializeDocumentServerCertificateConfigurations(v.ServerCertificateConfigurations, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeDocumentVariableDefinitionList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3003,6 +3411,44 @@ func awsAwsjson10_serializeOpDocumentCreateRuleGroupInput(v *CreateRuleGroupInpu return nil } +func awsAwsjson10_serializeOpDocumentCreateTLSInspectionConfigurationInput(v *CreateTLSInspectionConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.EncryptionConfiguration != nil { + ok := object.Key("EncryptionConfiguration") + if err := awsAwsjson10_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + if v.TLSInspectionConfiguration != nil { + ok := object.Key("TLSInspectionConfiguration") + if err := awsAwsjson10_serializeDocumentTLSInspectionConfiguration(v.TLSInspectionConfiguration, ok); err != nil { + return err + } + } + + if v.TLSInspectionConfigurationName != nil { + ok := object.Key("TLSInspectionConfigurationName") + ok.String(*v.TLSInspectionConfigurationName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDeleteFirewallInput(v *DeleteFirewallInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3071,6 +3517,23 @@ func awsAwsjson10_serializeOpDocumentDeleteRuleGroupInput(v *DeleteRuleGroupInpu return nil } +func awsAwsjson10_serializeOpDocumentDeleteTLSInspectionConfigurationInput(v *DeleteTLSInspectionConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TLSInspectionConfigurationArn != nil { + ok := object.Key("TLSInspectionConfigurationArn") + ok.String(*v.TLSInspectionConfigurationArn) + } + + if v.TLSInspectionConfigurationName != nil { + ok := object.Key("TLSInspectionConfigurationName") + ok.String(*v.TLSInspectionConfigurationName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDescribeFirewallInput(v *DescribeFirewallInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3178,6 +3641,23 @@ func awsAwsjson10_serializeOpDocumentDescribeRuleGroupMetadataInput(v *DescribeR return nil } +func awsAwsjson10_serializeOpDocumentDescribeTLSInspectionConfigurationInput(v *DescribeTLSInspectionConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TLSInspectionConfigurationArn != nil { + ok := object.Key("TLSInspectionConfigurationArn") + ok.String(*v.TLSInspectionConfigurationArn) + } + + if v.TLSInspectionConfigurationName != nil { + ok := object.Key("TLSInspectionConfigurationName") + ok.String(*v.TLSInspectionConfigurationName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDisassociateSubnetsInput(v *DisassociateSubnetsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3302,6 +3782,23 @@ func awsAwsjson10_serializeOpDocumentListTagsForResourceInput(v *ListTagsForReso return nil } +func awsAwsjson10_serializeOpDocumentListTLSInspectionConfigurationsInput(v *ListTLSInspectionConfigurationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3626,3 +4123,44 @@ func awsAwsjson10_serializeOpDocumentUpdateSubnetChangeProtectionInput(v *Update return nil } + +func awsAwsjson10_serializeOpDocumentUpdateTLSInspectionConfigurationInput(v *UpdateTLSInspectionConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.EncryptionConfiguration != nil { + ok := object.Key("EncryptionConfiguration") + if err := awsAwsjson10_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.TLSInspectionConfiguration != nil { + ok := object.Key("TLSInspectionConfiguration") + if err := awsAwsjson10_serializeDocumentTLSInspectionConfiguration(v.TLSInspectionConfiguration, ok); err != nil { + return err + } + } + + if v.TLSInspectionConfigurationArn != nil { + ok := object.Key("TLSInspectionConfigurationArn") + ok.String(*v.TLSInspectionConfigurationArn) + } + + if v.TLSInspectionConfigurationName != nil { + ok := object.Key("TLSInspectionConfigurationName") + ok.String(*v.TLSInspectionConfigurationName) + } + + if v.UpdateToken != nil { + ok := object.Key("UpdateToken") + ok.String(*v.UpdateToken) + } + + return nil +} diff --git a/service/networkfirewall/types/types.go b/service/networkfirewall/types/types.go index 5a44612a40f..b16806f2c92 100644 --- a/service/networkfirewall/types/types.go +++ b/service/networkfirewall/types/types.go @@ -354,6 +354,9 @@ type FirewallPolicy struct { // define the matching criteria in stateless rules. StatelessRuleGroupReferences []StatelessRuleGroupReference + // The Amazon Resource Name (ARN) of the TLS inspection configuration. + TLSInspectionConfigurationArn *string + noSmithyDocumentSerde } @@ -585,18 +588,20 @@ type IPSetMetadata struct { // Configures one or more IP set references for a Suricata-compatible rule group. // This is used in CreateRuleGroup or UpdateRuleGroup. An IP set reference is a -// rule variable that references a resource that you create and manage in another +// rule variable that references resources that you create and manage in another // Amazon Web Services service, such as an Amazon VPC prefix list. Network Firewall // IP set references enable you to dynamically update the contents of your rules. -// When you create, update, or delete the IP set you are referencing in your rule, -// Network Firewall automatically updates the rule's content with the changes. For -// more information about IP set references in Network Firewall, see Using IP set -// references +// When you create, update, or delete the resource you are referencing in your +// rule, Network Firewall automatically updates the rule's content with the +// changes. For more information about IP set references in Network Firewall, see +// Using IP set references // (https://docs.aws.amazon.com/network-firewall/latest/developerguide/rule-groups-ip-set-references) // in the Network Firewall Developer Guide. Network Firewall currently supports -// only Amazon VPC prefix lists -// (https://docs.aws.amazon.com/vpc/latest/userguide/managed-prefix-lists.html) as -// IP set references. +// Amazon VPC prefix lists +// (https://docs.aws.amazon.com/vpc/latest/userguide/managed-prefix-lists.html) and +// resource groups +// (https://docs.aws.amazon.com/network-firewall/latest/developerguide/rule-groups-ip-set-references.html#rule-groups-referencing-resource-groups) +// in IP set references. type IPSetReference struct { // The Amazon Resource Name (ARN) of the resource that you are referencing in your @@ -1035,6 +1040,80 @@ type RuleVariables struct { noSmithyDocumentSerde } +// Any Certificate Manager Secure Sockets Layer/Transport Layer Security (SSL/TLS) +// server certificate that's associated with a ServerCertificateConfiguration used +// in a TLSInspectionConfiguration. You must request or import a SSL/TLS +// certificate into ACM for each domain Network Firewall needs to decrypt and +// inspect. Network Firewall uses the SSL/TLS certificates to decrypt specified +// inbound SSL/TLS traffic going to your firewall. For information about working +// with certificates in Certificate Manager, see Request a public certificate +// (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html) or +// Importing certificates +// (https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html) in +// the Certificate Manager User Guide. +type ServerCertificate struct { + + // The Amazon Resource Name (ARN) of the Certificate Manager SSL/TLS server + // certificate. + ResourceArn *string + + noSmithyDocumentSerde +} + +// Configures the associated Certificate Manager Secure Sockets Layer/Transport +// Layer Security (SSL/TLS) server certificates and scope settings Network Firewall +// uses to decrypt traffic in a TLSInspectionConfiguration. For information about +// working with SSL/TLS certificates for TLS inspection, see Requirements for +// using SSL/TLS server certficiates with TLS inspection configurations +// (https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection-certificate-requirements.html) +// in the Network Firewall Developer Guide. If a server certificate that's +// associated with your TLSInspectionConfiguration is revoked, deleted, or expired +// it can result in client-side TLS errors. +type ServerCertificateConfiguration struct { + + // A list of a server certificate configuration's scopes. + Scopes []ServerCertificateScope + + // The list of a server certificate configuration's Certificate Manager SSL/TLS + // certificates. + ServerCertificates []ServerCertificate + + noSmithyDocumentSerde +} + +// Settings that define the Secure Sockets Layer/Transport Layer Security (SSL/TLS) +// traffic that Network Firewall should decrypt for inspection by the stateful rule +// engine. +type ServerCertificateScope struct { + + // The destination ports to decrypt for inspection, in Transmission Control + // Protocol (TCP) format. If not specified, this matches with any destination port. + // You can specify individual ports, for example 1994, and you can specify port + // ranges, such as 1990:1994. + DestinationPorts []PortRange + + // The destination IP addresses and address ranges to decrypt for inspection, in + // CIDR notation. If not specified, this matches with any destination address. + Destinations []Address + + // The protocols to decrypt for inspection, specified using each protocol's + // assigned internet protocol number (IANA). Network Firewall currently supports + // only TCP. + Protocols []int32 + + // The source ports to decrypt for inspection, in Transmission Control Protocol + // (TCP) format. If not specified, this matches with any source port. You can + // specify individual ports, for example 1994, and you can specify port ranges, + // such as 1990:1994. + SourcePorts []PortRange + + // The source IP addresses and address ranges to decrypt for inspection, in CIDR + // notation. If not specified, this matches with any source address. + Sources []Address + + noSmithyDocumentSerde +} + // High-level information about the managed rule group that your own rule group is // copied from. You can use the the metadata to track version updates made to the // originating rule group. You can retrieve all objects for a rule group by calling @@ -1355,4 +1434,113 @@ type TCPFlagField struct { noSmithyDocumentSerde } +// Contains metadata about an Certificate Manager certificate. +type TlsCertificateData struct { + + // The Amazon Resource Name (ARN) of the certificate. + CertificateArn *string + + // The serial number of the certificate. + CertificateSerial *string + + // The status of the certificate. + Status *string + + // Contains details about the certificate status, including information about + // certificate errors. + StatusMessage *string + + noSmithyDocumentSerde +} + +// The object that defines a TLS inspection configuration. This, along with +// TLSInspectionConfigurationResponse, define the TLS inspection configuration. You +// can retrieve all objects for a TLS inspection configuration by calling +// DescribeTLSInspectionConfiguration. Network Firewall uses a TLS inspection +// configuration to decrypt traffic. Network Firewall re-encrypts the traffic +// before sending it to its destination. To use a TLS inspection configuration, you +// add it to a Network Firewall firewall policy, then you apply the firewall policy +// to a firewall. Network Firewall acts as a proxy service to decrypt and inspect +// inbound traffic. You can reference a TLS inspection configuration from more than +// one firewall policy, and you can use a firewall policy in more than one +// firewall. For more information about using TLS inspection configurations, see +// Decrypting SSL/TLS traffic with TLS inspection configurations +// (https://docs.aws.amazon.com/network-firewall/latest/developerguide/tls-inspection.html) +// in the Network Firewall Developer Guide. +type TLSInspectionConfiguration struct { + + // Lists the server certificate configurations that are associated with the TLS + // configuration. + ServerCertificateConfigurations []ServerCertificateConfiguration + + noSmithyDocumentSerde +} + +// High-level information about a TLS inspection configuration, returned by +// ListTLSInspectionConfigurations. You can use the information provided in the +// metadata to retrieve and manage a TLS configuration. +type TLSInspectionConfigurationMetadata struct { + + // The Amazon Resource Name (ARN) of the TLS inspection configuration. + Arn *string + + // The descriptive name of the TLS inspection configuration. You can't change the + // name of a TLS inspection configuration after you create it. + Name *string + + noSmithyDocumentSerde +} + +// The high-level properties of a TLS inspection configuration. This, along with +// the TLSInspectionConfiguration, define the TLS inspection configuration. You can +// retrieve all objects for a TLS inspection configuration by calling +// DescribeTLSInspectionConfiguration. +type TLSInspectionConfigurationResponse struct { + + // The Amazon Resource Name (ARN) of the TLS inspection configuration. + // + // This member is required. + TLSInspectionConfigurationArn *string + + // A unique identifier for the TLS inspection configuration. This ID is returned in + // the responses to create and list commands. You provide it to operations such as + // update and delete. + // + // This member is required. + TLSInspectionConfigurationId *string + + // The descriptive name of the TLS inspection configuration. You can't change the + // name of a TLS inspection configuration after you create it. + // + // This member is required. + TLSInspectionConfigurationName *string + + // A list of the certificates associated with the TLS inspection configuration. + Certificates []TlsCertificateData + + // A description of the TLS inspection configuration. + Description *string + + // A complex type that contains the Amazon Web Services KMS encryption + // configuration settings for your TLS inspection configuration. + EncryptionConfiguration *EncryptionConfiguration + + // The last time that the TLS inspection configuration was changed. + LastModifiedTime *time.Time + + // The number of firewall policies that use this TLS inspection configuration. + NumberOfAssociations *int32 + + // Detailed information about the current status of a TLSInspectionConfiguration. + // You can retrieve this for a TLS inspection configuration by calling + // DescribeTLSInspectionConfiguration and providing the TLS inspection + // configuration name and ARN. + TLSInspectionConfigurationStatus ResourceStatus + + // The key:value pairs to associate with the resource. + Tags []Tag + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/networkfirewall/validators.go b/service/networkfirewall/validators.go index 9270ae07370..1742831f4e0 100644 --- a/service/networkfirewall/validators.go +++ b/service/networkfirewall/validators.go @@ -110,6 +110,26 @@ func (m *validateOpCreateRuleGroup) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpCreateTLSInspectionConfiguration struct { +} + +func (*validateOpCreateTLSInspectionConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTLSInspectionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTLSInspectionConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTLSInspectionConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteResourcePolicy struct { } @@ -390,6 +410,26 @@ func (m *validateOpUpdateSubnetChangeProtection) HandleInitialize(ctx context.Co return next.HandleInitialize(ctx, in) } +type validateOpUpdateTLSInspectionConfiguration struct { +} + +func (*validateOpUpdateTLSInspectionConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateTLSInspectionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateTLSInspectionConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateTLSInspectionConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpAssociateFirewallPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateFirewallPolicy{}, middleware.After) } @@ -410,6 +450,10 @@ func addOpCreateRuleGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRuleGroup{}, middleware.After) } +func addOpCreateTLSInspectionConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTLSInspectionConfiguration{}, middleware.After) +} + func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) } @@ -466,6 +510,10 @@ func addOpUpdateSubnetChangeProtectionValidationMiddleware(stack *middleware.Sta return stack.Initialize.Add(&validateOpUpdateSubnetChangeProtection{}, middleware.After) } +func addOpUpdateTLSInspectionConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateTLSInspectionConfiguration{}, middleware.After) +} + func validateActionDefinition(v *types.ActionDefinition) error { if v == nil { return nil @@ -982,6 +1030,89 @@ func validateRuleVariables(v *types.RuleVariables) error { } } +func validateServerCertificateConfiguration(v *types.ServerCertificateConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ServerCertificateConfiguration"} + if v.Scopes != nil { + if err := validateServerCertificateScopes(v.Scopes); err != nil { + invalidParams.AddNested("Scopes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateServerCertificateConfigurations(v []types.ServerCertificateConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ServerCertificateConfigurations"} + for i := range v { + if err := validateServerCertificateConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateServerCertificateScope(v *types.ServerCertificateScope) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ServerCertificateScope"} + if v.Sources != nil { + if err := validateAddresses(v.Sources); err != nil { + invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError)) + } + } + if v.Destinations != nil { + if err := validateAddresses(v.Destinations); err != nil { + invalidParams.AddNested("Destinations", err.(smithy.InvalidParamsError)) + } + } + if v.SourcePorts != nil { + if err := validatePortRanges(v.SourcePorts); err != nil { + invalidParams.AddNested("SourcePorts", err.(smithy.InvalidParamsError)) + } + } + if v.DestinationPorts != nil { + if err := validatePortRanges(v.DestinationPorts); err != nil { + invalidParams.AddNested("DestinationPorts", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateServerCertificateScopes(v []types.ServerCertificateScope) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ServerCertificateScopes"} + for i := range v { + if err := validateServerCertificateScope(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStatefulRule(v *types.StatefulRule) error { if v == nil { return nil @@ -1251,6 +1382,23 @@ func validateTCPFlags(v []types.TCPFlagField) error { } } +func validateTLSInspectionConfiguration(v *types.TLSInspectionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TLSInspectionConfiguration"} + if v.ServerCertificateConfigurations != nil { + if err := validateServerCertificateConfigurations(v.ServerCertificateConfigurations); err != nil { + invalidParams.AddNested("ServerCertificateConfigurations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAssociateFirewallPolicyInput(v *AssociateFirewallPolicyInput) error { if v == nil { return nil @@ -1391,6 +1539,38 @@ func validateOpCreateRuleGroupInput(v *CreateRuleGroupInput) error { } } +func validateOpCreateTLSInspectionConfigurationInput(v *CreateTLSInspectionConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTLSInspectionConfigurationInput"} + if v.TLSInspectionConfigurationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TLSInspectionConfigurationName")) + } + if v.TLSInspectionConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("TLSInspectionConfiguration")) + } else if v.TLSInspectionConfiguration != nil { + if err := validateTLSInspectionConfiguration(v.TLSInspectionConfiguration); err != nil { + invalidParams.AddNested("TLSInspectionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { if v == nil { return nil @@ -1630,3 +1810,30 @@ func validateOpUpdateSubnetChangeProtectionInput(v *UpdateSubnetChangeProtection return nil } } + +func validateOpUpdateTLSInspectionConfigurationInput(v *UpdateTLSInspectionConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateTLSInspectionConfigurationInput"} + if v.TLSInspectionConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("TLSInspectionConfiguration")) + } else if v.TLSInspectionConfiguration != nil { + if err := validateTLSInspectionConfiguration(v.TLSInspectionConfiguration); err != nil { + invalidParams.AddNested("TLSInspectionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.UpdateToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("UpdateToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/sagemaker/internal/endpoints/endpoints.go b/service/sagemaker/internal/endpoints/endpoints.go index d26bc88ec01..2f289521c3a 100644 --- a/service/sagemaker/internal/endpoints/endpoints.go +++ b/service/sagemaker/internal/endpoints/endpoints.go @@ -177,6 +177,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, diff --git a/service/sagemakergeospatial/api_op_ExportEarthObservationJob.go b/service/sagemakergeospatial/api_op_ExportEarthObservationJob.go index e171a30dfcc..9c27d230e59 100644 --- a/service/sagemakergeospatial/api_op_ExportEarthObservationJob.go +++ b/service/sagemakergeospatial/api_op_ExportEarthObservationJob.go @@ -4,6 +4,7 @@ package sagemakergeospatial 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/sagemakergeospatial/types" @@ -13,7 +14,7 @@ import ( ) // Use this operation to export results of an Earth Observation job and optionally -// source images used as input to the EOJ to an S3 location. +// source images used as input to the EOJ to an Amazon S3 location. func (c *Client) ExportEarthObservationJob(ctx context.Context, params *ExportEarthObservationJobInput, optFns ...func(*Options)) (*ExportEarthObservationJobOutput, error) { if params == nil { params = &ExportEarthObservationJobInput{} @@ -47,6 +48,9 @@ type ExportEarthObservationJobInput struct { // This member is required. OutputConfig *types.OutputConfigInput + // A unique token that guarantees that the call to this API is idempotent. + ClientToken *string + // The source images provided to the Earth Observation job being exported. ExportSourceImages *bool @@ -135,6 +139,9 @@ func (c *Client) addOperationExportEarthObservationJobMiddlewares(stack *middlew if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addIdempotencyToken_opExportEarthObservationJobMiddleware(stack, options); err != nil { + return err + } if err = addOpExportEarthObservationJobValidationMiddleware(stack); err != nil { return err } @@ -153,6 +160,39 @@ func (c *Client) addOperationExportEarthObservationJobMiddlewares(stack *middlew return nil } +type idempotencyToken_initializeOpExportEarthObservationJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpExportEarthObservationJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpExportEarthObservationJob) 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.(*ExportEarthObservationJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *ExportEarthObservationJobInput ") + } + + 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_opExportEarthObservationJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpExportEarthObservationJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + func newServiceMetadataMiddleware_opExportEarthObservationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemakergeospatial/api_op_ExportVectorEnrichmentJob.go b/service/sagemakergeospatial/api_op_ExportVectorEnrichmentJob.go index 109b1e38e64..9e2a7b051e6 100644 --- a/service/sagemakergeospatial/api_op_ExportVectorEnrichmentJob.go +++ b/service/sagemakergeospatial/api_op_ExportVectorEnrichmentJob.go @@ -4,6 +4,7 @@ package sagemakergeospatial 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/sagemakergeospatial/types" @@ -12,7 +13,8 @@ import ( "time" ) -// Use this operation to copy results of a Vector Enrichment job to an S3 location. +// Use this operation to copy results of a Vector Enrichment job to an Amazon S3 +// location. func (c *Client) ExportVectorEnrichmentJob(ctx context.Context, params *ExportVectorEnrichmentJobInput, optFns ...func(*Options)) (*ExportVectorEnrichmentJobOutput, error) { if params == nil { params = &ExportVectorEnrichmentJobInput{} @@ -46,6 +48,9 @@ type ExportVectorEnrichmentJobInput struct { // This member is required. OutputConfig *types.ExportVectorEnrichmentJobOutputConfig + // A unique token that guarantees that the call to this API is idempotent. + ClientToken *string + noSmithyDocumentSerde } @@ -128,6 +133,9 @@ func (c *Client) addOperationExportVectorEnrichmentJobMiddlewares(stack *middlew if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addIdempotencyToken_opExportVectorEnrichmentJobMiddleware(stack, options); err != nil { + return err + } if err = addOpExportVectorEnrichmentJobValidationMiddleware(stack); err != nil { return err } @@ -146,6 +154,39 @@ func (c *Client) addOperationExportVectorEnrichmentJobMiddlewares(stack *middlew return nil } +type idempotencyToken_initializeOpExportVectorEnrichmentJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpExportVectorEnrichmentJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpExportVectorEnrichmentJob) 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.(*ExportVectorEnrichmentJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *ExportVectorEnrichmentJobInput ") + } + + 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_opExportVectorEnrichmentJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpExportVectorEnrichmentJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + func newServiceMetadataMiddleware_opExportVectorEnrichmentJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemakergeospatial/api_op_GetEarthObservationJob.go b/service/sagemakergeospatial/api_op_GetEarthObservationJob.go index e3669cb181d..3e96305bfc8 100644 --- a/service/sagemakergeospatial/api_op_GetEarthObservationJob.go +++ b/service/sagemakergeospatial/api_op_GetEarthObservationJob.go @@ -87,10 +87,10 @@ type GetEarthObservationJobOutput struct { // The status of the Earth Observation job. ExportStatus types.EarthObservationJobExportStatus - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string - // + // Bands available in the output of an operation. OutputBands []types.OutputBand // Each tag consists of a key and a value. diff --git a/service/sagemakergeospatial/api_op_GetRasterDataCollection.go b/service/sagemakergeospatial/api_op_GetRasterDataCollection.go index dfdd96411fb..94ccb68a646 100644 --- a/service/sagemakergeospatial/api_op_GetRasterDataCollection.go +++ b/service/sagemakergeospatial/api_op_GetRasterDataCollection.go @@ -54,7 +54,7 @@ type GetRasterDataCollectionOutput struct { // This member is required. DescriptionPageUrl *string - // + // The list of image source bands in the raster data collection. // // This member is required. ImageSourceBands []string diff --git a/service/sagemakergeospatial/api_op_GetTile.go b/service/sagemakergeospatial/api_op_GetTile.go index ee32fc30c7f..12cd5d4d142 100644 --- a/service/sagemakergeospatial/api_op_GetTile.go +++ b/service/sagemakergeospatial/api_op_GetTile.go @@ -61,6 +61,9 @@ type GetTileInput struct { // This member is required. Z *int32 + // The Amazon Resource Name (ARN) of the IAM role that you specify. + ExecutionRoleArn *string + // Determines whether or not to return a valid data mask. ImageMask *bool diff --git a/service/sagemakergeospatial/api_op_GetVectorEnrichmentJob.go b/service/sagemakergeospatial/api_op_GetVectorEnrichmentJob.go index cfbba4a981a..3f493685f20 100644 --- a/service/sagemakergeospatial/api_op_GetVectorEnrichmentJob.go +++ b/service/sagemakergeospatial/api_op_GetVectorEnrichmentJob.go @@ -95,7 +95,7 @@ type GetVectorEnrichmentJobOutput struct { // The export status of the Vector Enrichment job being initiated. ExportStatus types.VectorEnrichmentJobExportStatus - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string // Each tag consists of a key and a value. diff --git a/service/sagemakergeospatial/api_op_SearchRasterDataCollection.go b/service/sagemakergeospatial/api_op_SearchRasterDataCollection.go index 4048474b9fa..37da6ba611c 100644 --- a/service/sagemakergeospatial/api_op_SearchRasterDataCollection.go +++ b/service/sagemakergeospatial/api_op_SearchRasterDataCollection.go @@ -36,7 +36,14 @@ type SearchRasterDataCollectionInput struct { // This member is required. Arn *string - // + // RasterDataCollectionQuery consisting of AreaOfInterest(AOI) + // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_AreaOfInterest.html), + // PropertyFilters + // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_PropertyFilter.html) + // and TimeRangeFilterInput + // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_TimeRangeFilterInput.html) + // used in SearchRasterDataCollection + // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_SearchRasterDataCollection.html). // // This member is required. RasterDataCollectionQuery *types.RasterDataCollectionQueryWithBandFilterInput @@ -50,12 +57,12 @@ type SearchRasterDataCollectionInput struct { type SearchRasterDataCollectionOutput struct { - // + // Approximate number of results in the response. // // This member is required. ApproximateResultCount *int32 - // + // List of items matching the Raster DataCollectionQuery. Items []types.ItemSource // If the previous response was truncated, you receive this token. Use it in your diff --git a/service/sagemakergeospatial/api_op_StartEarthObservationJob.go b/service/sagemakergeospatial/api_op_StartEarthObservationJob.go index 3d76da5a930..11e721672e8 100644 --- a/service/sagemakergeospatial/api_op_StartEarthObservationJob.go +++ b/service/sagemakergeospatial/api_op_StartEarthObservationJob.go @@ -52,7 +52,7 @@ type StartEarthObservationJobInput struct { // The Amazon Resource Name (ARN) of the IAM role that you specified for the job. ExecutionRoleArn *string - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string // Each tag consists of a key and a value. @@ -99,7 +99,7 @@ type StartEarthObservationJobOutput struct { // Input configuration information for the Earth Observation job. InputConfig *types.InputConfigOutput - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string // Each tag consists of a key and a value. diff --git a/service/sagemakergeospatial/api_op_StartVectorEnrichmentJob.go b/service/sagemakergeospatial/api_op_StartVectorEnrichmentJob.go index f5ba208a3b3..f7b4ee73731 100644 --- a/service/sagemakergeospatial/api_op_StartVectorEnrichmentJob.go +++ b/service/sagemakergeospatial/api_op_StartVectorEnrichmentJob.go @@ -55,7 +55,7 @@ type StartVectorEnrichmentJobInput struct { // A unique token that guarantees that the call to this API is idempotent. ClientToken *string - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string // Each tag consists of a key and a value. @@ -111,7 +111,7 @@ type StartVectorEnrichmentJobOutput struct { // This member is required. Type types.VectorEnrichmentJobType - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string // Each tag consists of a key and a value. diff --git a/service/sagemakergeospatial/deserializers.go b/service/sagemakergeospatial/deserializers.go index e21badbf7cf..4627ae8e504 100644 --- a/service/sagemakergeospatial/deserializers.go +++ b/service/sagemakergeospatial/deserializers.go @@ -378,25 +378,22 @@ func awsRestjson1_deserializeOpDocumentExportEarthObservationJobOutput(v **Expor case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) } case "ExecutionRoleArn": 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 ExecutionRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } @@ -595,25 +592,22 @@ func awsRestjson1_deserializeOpDocumentExportVectorEnrichmentJobOutput(v **Expor case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) } case "ExecutionRoleArn": 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 ExecutionRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } @@ -797,18 +791,15 @@ func awsRestjson1_deserializeOpDocumentGetEarthObservationJobOutput(v **GetEarth case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) } case "DurationInSeconds": @@ -833,7 +824,7 @@ func awsRestjson1_deserializeOpDocumentGetEarthObservationJobOutput(v **GetEarth 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 ExecutionRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } @@ -866,7 +857,7 @@ func awsRestjson1_deserializeOpDocumentGetEarthObservationJobOutput(v **GetEarth 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 KmsKey to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } @@ -1387,18 +1378,15 @@ func awsRestjson1_deserializeOpDocumentGetVectorEnrichmentJobOutput(v **GetVecto case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) } case "DurationInSeconds": @@ -1423,7 +1411,7 @@ func awsRestjson1_deserializeOpDocumentGetVectorEnrichmentJobOutput(v **GetVecto 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 ExecutionRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } @@ -1456,7 +1444,7 @@ func awsRestjson1_deserializeOpDocumentGetVectorEnrichmentJobOutput(v **GetVecto 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 KmsKey to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } @@ -2508,18 +2496,15 @@ func awsRestjson1_deserializeOpDocumentStartEarthObservationJobOutput(v **StartE case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) } case "DurationInSeconds": @@ -2539,7 +2524,7 @@ func awsRestjson1_deserializeOpDocumentStartEarthObservationJobOutput(v **StartE 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 ExecutionRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } @@ -2558,7 +2543,7 @@ func awsRestjson1_deserializeOpDocumentStartEarthObservationJobOutput(v **StartE 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 KmsKey to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } @@ -2757,18 +2742,15 @@ func awsRestjson1_deserializeOpDocumentStartVectorEnrichmentJobOutput(v **StartV case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) } case "DurationInSeconds": @@ -2788,7 +2770,7 @@ func awsRestjson1_deserializeOpDocumentStartVectorEnrichmentJobOutput(v **StartV 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 ExecutionRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } @@ -2807,7 +2789,7 @@ func awsRestjson1_deserializeOpDocumentStartVectorEnrichmentJobOutput(v **StartV 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 KmsKey to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } @@ -4311,7 +4293,7 @@ func awsRestjson1_deserializeDocumentExportS3DataInput(v **types.ExportS3DataInp 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 KmsKey to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } @@ -4320,7 +4302,7 @@ func awsRestjson1_deserializeDocumentExportS3DataInput(v **types.ExportS3DataInp 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 S3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } @@ -4678,7 +4660,7 @@ func awsRestjson1_deserializeDocumentInputConfigOutput(v **types.InputConfigOutp 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 EarthObservationJobArn to be of type string, got %T instead", value) } sv.PreviousEarthObservationJobArn = ptr.String(jtv) } @@ -5230,18 +5212,15 @@ func awsRestjson1_deserializeDocumentListEarthObservationJobOutputConfig(v **typ case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) } case "DurationInSeconds": @@ -5331,18 +5310,15 @@ func awsRestjson1_deserializeDocumentListVectorEnrichmentJobOutputConfig(v **typ case "CreationTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err } + sv.CreationTime = ptr.Time(t) } case "DurationInSeconds": @@ -6443,7 +6419,7 @@ func awsRestjson1_deserializeDocumentRasterDataCollectionQueryOutput(v **types.R 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 DataCollectionArn to be of type string, got %T instead", value) } sv.RasterDataCollectionArn = ptr.String(jtv) } @@ -6458,7 +6434,7 @@ func awsRestjson1_deserializeDocumentRasterDataCollectionQueryOutput(v **types.R } case "TimeRangeFilter": - if err := awsRestjson1_deserializeDocumentTimeRangeFilterInput(&sv.TimeRangeFilter, value); err != nil { + if err := awsRestjson1_deserializeDocumentTimeRangeFilterOutput(&sv.TimeRangeFilter, value); err != nil { return err } @@ -6645,7 +6621,7 @@ func awsRestjson1_deserializeDocumentS3DataInput(v **types.S3DataInput, value in 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 KmsKey to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } @@ -6663,7 +6639,7 @@ func awsRestjson1_deserializeDocumentS3DataInput(v **types.S3DataInput, value in 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 S3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } @@ -6974,7 +6950,7 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc return nil } -func awsRestjson1_deserializeDocumentTimeRangeFilterInput(v **types.TimeRangeFilterInput, value interface{}) error { +func awsRestjson1_deserializeDocumentTimeRangeFilterOutput(v **types.TimeRangeFilterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6987,9 +6963,9 @@ func awsRestjson1_deserializeDocumentTimeRangeFilterInput(v **types.TimeRangeFil return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.TimeRangeFilterInput + var sv *types.TimeRangeFilterOutput if *v == nil { - sv = &types.TimeRangeFilterInput{} + sv = &types.TimeRangeFilterOutput{} } else { sv = *v } @@ -6998,34 +6974,28 @@ func awsRestjson1_deserializeDocumentTimeRangeFilterInput(v **types.TimeRangeFil switch key { case "EndTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) } case "StartTime": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err } + sv.StartTime = ptr.Time(t) } default: @@ -7453,7 +7423,7 @@ func awsRestjson1_deserializeDocumentVectorEnrichmentJobS3Data(v **types.VectorE 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 KmsKey to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } @@ -7462,7 +7432,7 @@ func awsRestjson1_deserializeDocumentVectorEnrichmentJobS3Data(v **types.VectorE 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 S3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } @@ -7809,11 +7779,20 @@ func awsRestjson1_deserializeDocumentZonalStatisticsConfigInput(v **types.ZonalS 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 S3Uri to be of type string, got %T instead", value) } sv.ZoneS3Path = ptr.String(jtv) } + case "ZoneS3PathKmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKey to be of type string, got %T instead", value) + } + sv.ZoneS3PathKmsKeyId = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/sagemakergeospatial/serializers.go b/service/sagemakergeospatial/serializers.go index 32731b289a6..48c93388ee4 100644 --- a/service/sagemakergeospatial/serializers.go +++ b/service/sagemakergeospatial/serializers.go @@ -197,6 +197,11 @@ func awsRestjson1_serializeOpDocumentExportEarthObservationJobInput(v *ExportEar ok.String(*v.Arn) } + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + if v.ExecutionRoleArn != nil { ok := object.Key("ExecutionRoleArn") ok.String(*v.ExecutionRoleArn) @@ -282,6 +287,11 @@ func awsRestjson1_serializeOpDocumentExportVectorEnrichmentJobInput(v *ExportVec ok.String(*v.Arn) } + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + if v.ExecutionRoleArn != nil { ok := object.Key("ExecutionRoleArn") ok.String(*v.ExecutionRoleArn) @@ -463,6 +473,10 @@ func awsRestjson1_serializeOpHttpBindingsGetTileInput(v *GetTileInput, encoder * encoder.SetQuery("Arn").String(*v.Arn) } + if v.ExecutionRoleArn != nil { + encoder.SetQuery("ExecutionRoleArn").String(*v.ExecutionRoleArn) + } + if v.ImageAssets != nil { for i := range v.ImageAssets { encoder.AddQuery("ImageAssets").String(v.ImageAssets[i]) @@ -2614,6 +2628,11 @@ func awsRestjson1_serializeDocumentZonalStatisticsConfigInput(v *types.ZonalStat ok.String(*v.ZoneS3Path) } + if v.ZoneS3PathKmsKeyId != nil { + ok := object.Key("ZoneS3PathKmsKeyId") + ok.String(*v.ZoneS3PathKmsKeyId) + } + return nil } diff --git a/service/sagemakergeospatial/types/errors.go b/service/sagemakergeospatial/types/errors.go index 8a8d996ca1e..500637c0290 100644 --- a/service/sagemakergeospatial/types/errors.go +++ b/service/sagemakergeospatial/types/errors.go @@ -33,6 +33,7 @@ func (e *AccessDeniedException) ErrorCode() string { } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Updating or deleting a resource can cause an inconsistent state. type ConflictException struct { Message *string @@ -89,6 +90,7 @@ func (e *InternalServerException) ErrorCode() string { } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The request references a resource which does not exist. type ResourceNotFoundException struct { Message *string diff --git a/service/sagemakergeospatial/types/types.go b/service/sagemakergeospatial/types/types.go index 65110412b4a..f5b52339978 100644 --- a/service/sagemakergeospatial/types/types.go +++ b/service/sagemakergeospatial/types/types.go @@ -7,6 +7,8 @@ import ( "time" ) +// The geographic extent of the Earth Observation job. +// // The following types satisfy this interface: // // AreaOfInterestMemberAreaOfInterestGeometry @@ -14,6 +16,7 @@ type AreaOfInterest interface { isAreaOfInterest() } +// A GeoJSON object representing the geographic extent in the coordinate space. type AreaOfInterestMemberAreaOfInterestGeometry struct { Value AreaOfInterestGeometry @@ -22,6 +25,8 @@ type AreaOfInterestMemberAreaOfInterestGeometry struct { func (*AreaOfInterestMemberAreaOfInterestGeometry) isAreaOfInterest() {} +// A GeoJSON object representing the geographic extent in the coordinate space. +// // The following types satisfy this interface: // // AreaOfInterestGeometryMemberMultiPolygonGeometry @@ -30,6 +35,7 @@ type AreaOfInterestGeometry interface { isAreaOfInterestGeometry() } +// The structure representing the MultiPolygon Geometry. type AreaOfInterestGeometryMemberMultiPolygonGeometry struct { Value MultiPolygonGeometryInput @@ -38,6 +44,7 @@ type AreaOfInterestGeometryMemberMultiPolygonGeometry struct { func (*AreaOfInterestGeometryMemberMultiPolygonGeometry) isAreaOfInterestGeometry() {} +// The structure representing Polygon Geometry. type AreaOfInterestGeometryMemberPolygonGeometry struct { Value PolygonGeometryInput @@ -46,29 +53,35 @@ type AreaOfInterestGeometryMemberPolygonGeometry struct { func (*AreaOfInterestGeometryMemberPolygonGeometry) isAreaOfInterestGeometry() {} +// The structure containing the asset properties. type AssetValue struct { - // + // Link to the asset object. Href *string noSmithyDocumentSerde } +// Input structure for the BandMath operation type. Defines Predefined and +// CustomIndices to be computed using BandMath. type BandMathConfigInput struct { - // + // CustomIndices that are computed. CustomIndices *CustomIndicesInput - // + // One or many of the supported predefined indices to compute. Allowed values: + // NDVI, EVI2, MSAVI, NDWI, NDMI, NDSI, and WDRVI. PredefinedIndices []string noSmithyDocumentSerde } +// Input structure for CloudMasking operation type. type CloudMaskingConfigInput struct { noSmithyDocumentSerde } +// Input structure for Cloud Removal Operation type type CloudRemovalConfigInput struct { // The name of the algorithm used for cloud removal. @@ -77,15 +90,16 @@ type CloudRemovalConfigInput struct { // The interpolation value you provide for cloud removal. InterpolationValue *string - // + // TargetBands to be returned in the output of CloudRemoval operation. TargetBands []string noSmithyDocumentSerde } +// Input object defining the custom BandMath indices to compute. type CustomIndicesInput struct { - // + // A list of BandMath indices to compute. Operations []Operation noSmithyDocumentSerde @@ -94,23 +108,24 @@ type CustomIndicesInput struct { // The structure representing the errors in an EarthObservationJob. type EarthObservationJobErrorDetails struct { - // + // A detailed message describing the error in an Earth Observation job. Message *string - // + // The type of error in an Earth Observation job. Type EarthObservationJobErrorType noSmithyDocumentSerde } +// The structure representing the EoCloudCover filter. type EoCloudCoverInput struct { - // + // Lower bound for EoCloudCover. // // This member is required. LowerBound *float32 - // + // Upper bound for EoCloudCover. // // This member is required. UpperBound *float32 @@ -118,6 +133,9 @@ type EoCloudCoverInput struct { noSmithyDocumentSerde } +// Union representing different data sources to be used as input for an Earth +// Observation job. +// // The following types satisfy this interface: // // EojDataSourceConfigInputMemberS3Data @@ -125,6 +143,8 @@ type EojDataSourceConfigInput interface { isEojDataSourceConfigInput() } +// The input structure for S3Data; representing the Amazon S3 location of the input +// data objects. type EojDataSourceConfigInputMemberS3Data struct { Value S3DataInput @@ -137,26 +157,33 @@ func (*EojDataSourceConfigInputMemberS3Data) isEojDataSourceConfigInput() {} // GetEarthObservationJob. type ExportErrorDetails struct { - // + // The structure for returning the export error details while exporting results of + // an Earth Observation job. ExportResults *ExportErrorDetailsOutput - // + // The structure for returning the export error details while exporting the source + // images of an Earth Observation job. ExportSourceImages *ExportErrorDetailsOutput noSmithyDocumentSerde } +// The structure representing the errors in an export EarthObservationJob +// operation. type ExportErrorDetailsOutput struct { - // + // A detailed message describing the error in an export EarthObservationJob + // operation. Message *string - // + // The type of error in an export EarthObservationJob operation. Type ExportErrorType noSmithyDocumentSerde } +// The structure containing the Amazon S3 path to export the Earth Observation job +// output. type ExportS3DataInput struct { // The URL to the Amazon S3 data input. @@ -164,7 +191,7 @@ type ExportS3DataInput struct { // This member is required. S3Uri *string - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string noSmithyDocumentSerde @@ -173,7 +200,8 @@ type ExportS3DataInput struct { // An object containing information about the output file. type ExportVectorEnrichmentJobOutputConfig struct { - // + // The input structure for Amazon S3 data; representing the Amazon S3 location of + // the input data objects. // // This member is required. S3Data *VectorEnrichmentJobS3Data @@ -203,14 +231,16 @@ type Filter struct { noSmithyDocumentSerde } +// The structure representing a Geometry in terms of Type and Coordinates as per +// GeoJson spec. type Geometry struct { - // + // The coordinates of the GeoJson Geometry. // // This member is required. Coordinates [][][]float64 - // + // GeoJson Geometry types like Polygon and MultiPolygon. // // This member is required. Type *string @@ -239,7 +269,8 @@ type InputConfigInput struct { // The Amazon Resource Name (ARN) of the previous Earth Observation job. PreviousEarthObservationJobArn *string - // + // The structure representing the RasterDataCollection Query consisting of the Area + // of Interest, RasterDataCollectionArn,TimeRange and Property Filters. RasterDataCollectionQuery *RasterDataCollectionQueryInput noSmithyDocumentSerde @@ -254,21 +285,24 @@ type InputConfigOutput struct { // The Amazon Resource Name (ARN) of the previous Earth Observation job. PreviousEarthObservationJobArn *string - // + // The structure representing the RasterDataCollection Query consisting of the Area + // of Interest, RasterDataCollectionArn, RasterDataCollectionName, TimeRange, and + // Property Filters. RasterDataCollectionQuery *RasterDataCollectionQueryOutput noSmithyDocumentSerde } -// Structure representing the items in the response for SearchRasterDataCollection. +// The structure representing the items in the response for +// SearchRasterDataCollection. type ItemSource struct { - // + // The searchable date and time of the item, in UTC. // // This member is required. DateTime *time.Time - // + // The item Geometry in GeoJson format. // // This member is required. Geometry *Geometry @@ -278,10 +312,11 @@ type ItemSource struct { // This member is required. Id *string - // + // This is a dictionary of Asset Objects data associated with the Item that can be + // downloaded or streamed, each with a unique key. Assets map[string]AssetValue - // + // This field contains additional properties of the item. Properties *Properties noSmithyDocumentSerde @@ -304,6 +339,7 @@ type JobConfigInput interface { isJobConfigInput() } +// An object containing information about the job configuration for BandMath. type JobConfigInputMemberBandMathConfig struct { Value BandMathConfigInput @@ -358,6 +394,8 @@ type JobConfigInputMemberResamplingConfig struct { func (*JobConfigInputMemberResamplingConfig) isJobConfigInput() {} +// An object containing information about the job configuration for a Stacking +// Earth Observation job. type JobConfigInputMemberStackConfig struct { Value StackConfigInput @@ -386,18 +424,23 @@ type JobConfigInputMemberZonalStatisticsConfig struct { func (*JobConfigInputMemberZonalStatisticsConfig) isJobConfigInput() {} +// The input structure for Land Cover Operation type. type LandCoverSegmentationConfigInput struct { noSmithyDocumentSerde } +// The structure representing Land Cloud Cover property for Landsat data +// collection. type LandsatCloudCoverLandInput struct { - // + // The minimum value for Land Cloud Cover property filter. This will filter items + // having Land Cloud Cover greater than or equal to this value. // // This member is required. LowerBound *float32 - // + // The maximum value for Land Cloud Cover property filter. This will filter items + // having Land Cloud Cover less than or equal to this value. // // This member is required. UpperBound *float32 @@ -428,7 +471,7 @@ type ListEarthObservationJobOutputConfig struct { // This member is required. Name *string - // + // The operation type for an Earth Observation job. // // This member is required. OperationType *string @@ -483,9 +526,11 @@ type ListVectorEnrichmentJobOutputConfig struct { noSmithyDocumentSerde } +// The input structure for Map Matching operation type. type MapMatchingConfig struct { - // + // The field name for the data that describes the identifier representing a + // collection of GPS points belonging to an individual trace. // // This member is required. IdAttributeName *string @@ -508,6 +553,8 @@ type MapMatchingConfig struct { noSmithyDocumentSerde } +// The structure representing Polygon Geometry based on the GeoJson spec +// (https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6). type MultiPolygonGeometryInput struct { // The coordinates of the multipolygon geometry. @@ -518,9 +565,11 @@ type MultiPolygonGeometryInput struct { noSmithyDocumentSerde } +// Represents an arithmetic operation to compute spectral index. type Operation struct { - // + // Textual representation of the math operation; Equation used to compute the + // spectral index. // // This member is required. Equation *string @@ -564,9 +613,12 @@ type OutputConfigInput struct { noSmithyDocumentSerde } +// OutputResolution Configuration indicating the target resolution for the output +// of Resampling operation. type OutputResolutionResamplingInput struct { - // + // User Defined Resolution for the output of Resampling operation defined by value + // and unit. // // This member is required. UserDefined *UserDefined @@ -574,17 +626,23 @@ type OutputResolutionResamplingInput struct { noSmithyDocumentSerde } +// The input structure representing Output Resolution for Stacking Operation. type OutputResolutionStackInput struct { - // + // A string value representing Predefined Output Resolution for a stacking + // operation. Allowed values are HIGHEST, LOWEST, and AVERAGE. Predefined PredefinedResolution - // + // The structure representing User Output Resolution for a Stacking operation + // defined as a value and unit. UserDefined *UserDefined noSmithyDocumentSerde } +// The input structure for specifying Platform. Platform refers to the unique name +// of the specific platform the instrument is attached to. For satellites it is the +// name of the satellite, eg. landsat-8 (Landsat-8), sentinel-2a. type PlatformInput struct { // The value of the platform. @@ -592,15 +650,18 @@ type PlatformInput struct { // This member is required. Value *string - // + // The ComparisonOperator to use with PlatformInput. ComparisonOperator ComparisonOperator noSmithyDocumentSerde } +// The structure representing Polygon Geometry based on the GeoJson spec +// (https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6). type PolygonGeometryInput struct { - // + // Coordinates representing a Polygon based on the GeoJson spec + // (https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6). // // This member is required. Coordinates [][][]float64 @@ -608,29 +669,40 @@ type PolygonGeometryInput struct { noSmithyDocumentSerde } +// Properties associated with the Item. type Properties struct { - // + // Estimate of cloud cover. EoCloudCover *float32 - // + // Land cloud cover for Landsat Data Collection. LandsatCloudCoverLand *float32 - // + // Platform property. Platform refers to the unique name of the specific platform + // the instrument is attached to. For satellites it is the name of the satellite, + // eg. landsat-8 (Landsat-8), sentinel-2a. Platform *string - // + // The angle from the sensor between nadir (straight down) and the scene center. + // Measured in degrees (0-90). ViewOffNadir *float32 - // + // The sun azimuth angle. From the scene center point on the ground, this is the + // angle between truth north and the sun. Measured clockwise in degrees (0-360). ViewSunAzimuth *float32 - // + // The sun elevation angle. The angle from the tangent of the scene center point to + // the sun. Measured from the horizon in degrees (-90-90). Negative values indicate + // the sun is below the horizon, e.g. sun elevation of -10° means the data was + // captured during nautical twilight + // (https://www.timeanddate.com/astronomy/different-types-twilight.html). ViewSunElevation *float32 noSmithyDocumentSerde } +// Represents a single searchable property to search on. +// // The following types satisfy this interface: // // PropertyMemberEoCloudCover @@ -643,6 +715,8 @@ type Property interface { isProperty() } +// The structure representing EoCloudCover property filter containing a lower bound +// and upper bound. type PropertyMemberEoCloudCover struct { Value EoCloudCoverInput @@ -651,6 +725,8 @@ type PropertyMemberEoCloudCover struct { func (*PropertyMemberEoCloudCover) isProperty() {} +// The structure representing Land Cloud Cover property filter for Landsat +// collection containing a lower bound and upper bound. type PropertyMemberLandsatCloudCoverLand struct { Value LandsatCloudCoverLandInput @@ -659,6 +735,8 @@ type PropertyMemberLandsatCloudCoverLand struct { func (*PropertyMemberLandsatCloudCoverLand) isProperty() {} +// The structure representing Platform property filter consisting of value and +// comparison operator. type PropertyMemberPlatform struct { Value PlatformInput @@ -667,6 +745,8 @@ type PropertyMemberPlatform struct { func (*PropertyMemberPlatform) isProperty() {} +// The structure representing ViewOffNadir property filter containing a lower bound +// and upper bound. type PropertyMemberViewOffNadir struct { Value ViewOffNadirInput @@ -675,6 +755,8 @@ type PropertyMemberViewOffNadir struct { func (*PropertyMemberViewOffNadir) isProperty() {} +// The structure representing ViewSunAzimuth property filter containing a lower +// bound and upper bound. type PropertyMemberViewSunAzimuth struct { Value ViewSunAzimuthInput @@ -683,6 +765,8 @@ type PropertyMemberViewSunAzimuth struct { func (*PropertyMemberViewSunAzimuth) isProperty() {} +// The structure representing ViewSunElevation property filter containing a lower +// bound and upper bound. type PropertyMemberViewSunElevation struct { Value ViewSunElevationInput @@ -691,9 +775,11 @@ type PropertyMemberViewSunElevation struct { func (*PropertyMemberViewSunElevation) isProperty() {} +// The structure representing a single PropertyFilter. type PropertyFilter struct { - // + // Represents a single property to match with when searching a raster data + // collection. // // This member is required. Property Property @@ -701,12 +787,13 @@ type PropertyFilter struct { noSmithyDocumentSerde } +// A list of PropertyFilter objects. type PropertyFilters struct { - // + // The Logical Operator used to combine the Property Filters. LogicalOperator LogicalOperator - // + // A list of Property Filters. Properties []PropertyFilter noSmithyDocumentSerde @@ -730,7 +817,7 @@ type RasterDataCollectionMetadata struct { // This member is required. Name *string - // + // The list of filters supported by the raster data collection. // // This member is required. SupportedFilters []Filter @@ -749,6 +836,8 @@ type RasterDataCollectionMetadata struct { noSmithyDocumentSerde } +// The input structure for Raster Data Collection Query containing the Area of +// Interest, TimeRange Filters, and Property Filters. type RasterDataCollectionQueryInput struct { // The Amazon Resource Name (ARN) of the raster data collection. @@ -756,7 +845,7 @@ type RasterDataCollectionQueryInput struct { // This member is required. RasterDataCollectionArn *string - // + // The TimeRange Filter used in the RasterDataCollection Query. // // This member is required. TimeRangeFilter *TimeRangeFilterInput @@ -764,15 +853,17 @@ type RasterDataCollectionQueryInput struct { // The area of interest being queried for the raster data collection. AreaOfInterest AreaOfInterest - // + // The list of Property filters used in the Raster Data Collection Query. PropertyFilters *PropertyFilters noSmithyDocumentSerde } +// The output structure contains the Raster Data Collection Query input along with +// some additional metadata. type RasterDataCollectionQueryOutput struct { - // + // The ARN of the Raster Data Collection against which the search is done. // // This member is required. RasterDataCollectionArn *string @@ -782,15 +873,15 @@ type RasterDataCollectionQueryOutput struct { // This member is required. RasterDataCollectionName *string - // + // The TimeRange filter used in the search. // // This member is required. - TimeRangeFilter *TimeRangeFilterInput + TimeRangeFilter *TimeRangeFilterOutput - // + // The Area of Interest used in the search. AreaOfInterest AreaOfInterest - // + // Property filters used in the search. PropertyFilters *PropertyFilters noSmithyDocumentSerde @@ -800,26 +891,28 @@ type RasterDataCollectionQueryOutput struct { // filter and Property filters. type RasterDataCollectionQueryWithBandFilterInput struct { - // + // The TimeRange Filter used in the search query. // // This member is required. TimeRangeFilter *TimeRangeFilterInput - // + // The Area of interest to be used in the search query. AreaOfInterest AreaOfInterest - // + // The list of Bands to be displayed in the result for each item. BandFilter []string - // + // The Property Filters used in the search query. PropertyFilters *PropertyFilters noSmithyDocumentSerde } +// The structure representing input for resampling operation. type ResamplingConfigInput struct { - // + // The structure representing output resolution (in target georeferenced units) of + // the result of resampling operation. // // This member is required. OutputResolution *OutputResolutionResamplingInput @@ -827,20 +920,24 @@ type ResamplingConfigInput struct { // The name of the algorithm used for resampling. AlgorithmName AlgorithmNameResampling - // + // Bands used in the operation. If no target bands are specified, it uses all bands + // available in the input. TargetBands []string noSmithyDocumentSerde } +// The input structure for Reverse Geocoding operation type. type ReverseGeocodingConfig struct { - // + // The field name for the data that describes x-axis coordinate, eg. longitude of a + // point. // // This member is required. XAttributeName *string - // + // The field name for the data that describes y-axis coordinate, eg. latitude of a + // point. // // This member is required. YAttributeName *string @@ -851,7 +948,7 @@ type ReverseGeocodingConfig struct { // Path to Amazon S3 storage location for input data. type S3DataInput struct { - // + // Metadata provider from whom the Amazon S3 data has been acquired. // // This member is required. MetadataProvider MetadataProvider @@ -861,34 +958,39 @@ type S3DataInput struct { // This member is required. S3Uri *string - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string noSmithyDocumentSerde } +// The input structure for Stacking Operation. type StackConfigInput struct { - // + // The structure representing output resolution (in target georeferenced units) of + // the result of stacking operation. OutputResolution *OutputResolutionStackInput - // + // A list of bands to be stacked in the specified order. When the parameter is not + // provided, all the available bands in the data collection are stacked in the + // alphabetical order of their asset names. TargetBands []string noSmithyDocumentSerde } +// The structure representing the configuration for Temporal Statistics operation. type TemporalStatisticsConfigInput struct { - // + // The list of the statistics method options. // // This member is required. Statistics []TemporalStatistics - // + // The input for the temporal statistics grouping by time frequency option. GroupBy GroupBy - // + // The list of target band names for the temporal statistic to calculate. TargetBands []string noSmithyDocumentSerde @@ -910,14 +1012,32 @@ type TimeRangeFilterInput struct { noSmithyDocumentSerde } -type UserDefined struct { +// The output structure of the time range filter. +type TimeRangeFilterOutput struct { + // The ending time for the time range filter. // + // This member is required. + EndTime *time.Time + + // The starting time for the time range filter. // // This member is required. - Unit Unit + StartTime *time.Time + + noSmithyDocumentSerde +} + +// The output resolution (in target georeferenced units) of the result of the +// operation +type UserDefined struct { + // The units for output resolution of the result. // + // This member is required. + Unit Unit + + // The value for output resolution of the result. // // This member is required. Value *float32 @@ -935,6 +1055,7 @@ type VectorEnrichmentJobConfig interface { isVectorEnrichmentJobConfig() } +// The input structure for Map Matching operation type. type VectorEnrichmentJobConfigMemberMapMatchingConfig struct { Value MapMatchingConfig @@ -943,6 +1064,7 @@ type VectorEnrichmentJobConfigMemberMapMatchingConfig struct { func (*VectorEnrichmentJobConfigMemberMapMatchingConfig) isVectorEnrichmentJobConfig() {} +// The input structure for Reverse Geocoding operation type. type VectorEnrichmentJobConfigMemberReverseGeocodingConfig struct { Value ReverseGeocodingConfig @@ -951,6 +1073,9 @@ type VectorEnrichmentJobConfigMemberReverseGeocodingConfig struct { func (*VectorEnrichmentJobConfigMemberReverseGeocodingConfig) isVectorEnrichmentJobConfig() {} +// The input structure for the data source that represents the storage type of the +// input data objects. +// // The following types satisfy this interface: // // VectorEnrichmentJobDataSourceConfigInputMemberS3Data @@ -958,6 +1083,8 @@ type VectorEnrichmentJobDataSourceConfigInput interface { isVectorEnrichmentJobDataSourceConfigInput() } +// The input structure for the Amazon S3 data that represents the Amazon S3 +// location of the input data objects. type VectorEnrichmentJobDataSourceConfigInputMemberS3Data struct { Value VectorEnrichmentJobS3Data @@ -988,7 +1115,7 @@ type VectorEnrichmentJobExportErrorDetails struct { // Enrichment job. Message *string - // + // The output error details for an Export operation on a Vector Enrichment job. Type VectorEnrichmentJobExportErrorType noSmithyDocumentSerde @@ -997,12 +1124,13 @@ type VectorEnrichmentJobExportErrorDetails struct { // The input structure for the InputConfig in a VectorEnrichmentJob. type VectorEnrichmentJobInputConfig struct { - // + // The input structure for the data source that represents the storage type of the + // input data objects. // // This member is required. DataSourceConfig VectorEnrichmentJobDataSourceConfigInput - // + // The input structure that defines the data source file type. // // This member is required. DocumentType VectorEnrichmentJobDocumentType @@ -1018,20 +1146,25 @@ type VectorEnrichmentJobS3Data struct { // This member is required. S3Uri *string - // The Amazon Key Management Service (KMS) key ID for server-side encryption. + // The Key Management Service key ID for server-side encryption. KmsKeyId *string noSmithyDocumentSerde } +// The input structure for specifying ViewOffNadir property filter. ViewOffNadir +// refers to the angle from the sensor between nadir (straight down) and the scene +// center. Measured in degrees (0-90). type ViewOffNadirInput struct { - // + // The minimum value for ViewOffNadir property filter. This filters items having + // ViewOffNadir greater than or equal to this value. // // This member is required. LowerBound *float32 - // + // The maximum value for ViewOffNadir property filter. This filters items having + // ViewOffNadir lesser than or equal to this value. // // This member is required. UpperBound *float32 @@ -1039,14 +1172,20 @@ type ViewOffNadirInput struct { noSmithyDocumentSerde } +// The input structure for specifying ViewSunAzimuth property filter. +// ViewSunAzimuth refers to the Sun azimuth angle. From the scene center point on +// the ground, this is the angle between truth north and the sun. Measured +// clockwise in degrees (0-360). type ViewSunAzimuthInput struct { - // + // The minimum value for ViewSunAzimuth property filter. This filters items having + // ViewSunAzimuth greater than or equal to this value. // // This member is required. LowerBound *float32 - // + // The maximum value for ViewSunAzimuth property filter. This filters items having + // ViewSunAzimuth lesser than or equal to this value. // // This member is required. UpperBound *float32 @@ -1054,6 +1193,7 @@ type ViewSunAzimuthInput struct { noSmithyDocumentSerde } +// The input structure for specifying ViewSunElevation angle property filter. type ViewSunElevationInput struct { // The lower bound to view the sun elevation. @@ -1069,21 +1209,42 @@ type ViewSunElevationInput struct { noSmithyDocumentSerde } +// The structure representing input configuration of ZonalStatistics operation. type ZonalStatisticsConfigInput struct { - // + // List of zonal statistics to compute. // // This member is required. Statistics []ZonalStatistics - // + // The Amazon S3 path pointing to the GeoJSON containing the polygonal zones. // // This member is required. ZoneS3Path *string - // + // Bands used in the operation. If no target bands are specified, it uses all bands + // available input. TargetBands []string + // The Amazon Resource Name (ARN) or an ID of a Amazon Web Services Key Management + // Service (Amazon Web Services KMS) key that Amazon SageMaker uses to decrypt your + // output artifacts with Amazon S3 server-side encryption. The SageMaker execution + // role must have kms:GenerateDataKey permission. The KmsKeyId can be any of the + // following formats: + // + // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" + // + // * // + // Amazon Resource Name (ARN) of a KMS Key + // "arn:aws:kms:::key/" + // + // For + // more information about key identifiers, see Key identifiers (KeyID) + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id) + // in the Amazon Web Services Key Management Service (Amazon Web Services KMS) + // documentation. + ZoneS3PathKmsKeyId *string + noSmithyDocumentSerde } diff --git a/service/scheduler/internal/endpoints/endpoints.go b/service/scheduler/internal/endpoints/endpoints.go index e58cb05183b..1ad236c89d4 100644 --- a/service/scheduler/internal/endpoints/endpoints.go +++ b/service/scheduler/internal/endpoints/endpoints.go @@ -135,30 +135,84 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, diff --git a/service/servicecatalog/internal/endpoints/endpoints.go b/service/servicecatalog/internal/endpoints/endpoints.go index 2173a4acba2..3b17c816b39 100644 --- a/service/servicecatalog/internal/endpoints/endpoints.go +++ b/service/servicecatalog/internal/endpoints/endpoints.go @@ -165,6 +165,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, diff --git a/service/vpclattice/LICENSE.txt b/service/vpclattice/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/vpclattice/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/vpclattice/api_client.go b/service/vpclattice/api_client.go new file mode 100644 index 00000000000..04a2111074d --- /dev/null +++ b/service/vpclattice/api_client.go @@ -0,0 +1,453 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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 = "VPC Lattice" +const ServiceAPIVersion = "2022-11-30" + +// Client provides the API client to make operations call for Amazon VPC Lattice. +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, "vpclattice", 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/vpclattice/api_client_test.go b/service/vpclattice/api_client_test.go new file mode 100644 index 00000000000..298c9aea644 --- /dev/null +++ b/service/vpclattice/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/api_op_BatchUpdateRule.go b/service/vpclattice/api_op_BatchUpdateRule.go new file mode 100644 index 00000000000..b80a3ceff2f --- /dev/null +++ b/service/vpclattice/api_op_BatchUpdateRule.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the listener rules in a batch. You can use this operation to change the +// priority of listener rules. This can be useful when bulk updating or swapping +// rule priority. +func (c *Client) BatchUpdateRule(ctx context.Context, params *BatchUpdateRuleInput, optFns ...func(*Options)) (*BatchUpdateRuleOutput, error) { + if params == nil { + params = &BatchUpdateRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchUpdateRule", params, optFns, c.addOperationBatchUpdateRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchUpdateRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchUpdateRuleInput struct { + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The rules for the specified listener. + // + // This member is required. + Rules []types.RuleUpdate + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type BatchUpdateRuleOutput struct { + + // The rules that were successfully updated. + Successful []types.RuleUpdateSuccess + + // The rules that the operation couldn't update. + Unsuccessful []types.RuleUpdateFailure + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchUpdateRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchUpdateRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchUpdateRule{}, 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 = addOpBatchUpdateRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchUpdateRule(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_opBatchUpdateRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "BatchUpdateRule", + } +} diff --git a/service/vpclattice/api_op_CreateAccessLogSubscription.go b/service/vpclattice/api_op_CreateAccessLogSubscription.go new file mode 100644 index 00000000000..0786cd77d10 --- /dev/null +++ b/service/vpclattice/api_op_CreateAccessLogSubscription.go @@ -0,0 +1,202 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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" +) + +// Enables access logs to be sent to Amazon CloudWatch, Amazon S3, and Amazon +// Kinesis Data Firehose. The service network owner can use the access logs to +// audit the services in the network. The service network owner will only see +// access logs from clients and services that are associated with their service +// network. Access log entries represent traffic originated from VPCs associated +// with that network. For more information, see Access logs +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/monitoring-access-logs.html) +// in the Amazon VPC Lattice User Guide. +func (c *Client) CreateAccessLogSubscription(ctx context.Context, params *CreateAccessLogSubscriptionInput, optFns ...func(*Options)) (*CreateAccessLogSubscriptionOutput, error) { + if params == nil { + params = &CreateAccessLogSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAccessLogSubscription", params, optFns, c.addOperationCreateAccessLogSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAccessLogSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAccessLogSubscriptionInput struct { + + // The Amazon Resource Name (ARN) of the destination. The supported destination + // types are CloudWatch Log groups, Kinesis Data Firehose delivery streams, and + // Amazon S3 buckets. + // + // This member is required. + DestinationArn *string + + // The ID or Amazon Resource Name (ARN) of the service network or service. + // + // This member is required. + ResourceIdentifier *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The tags for the access log subscription. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAccessLogSubscriptionOutput struct { + + // The Amazon Resource Name (ARN) of the access log subscription. + // + // This member is required. + Arn *string + + // The Amazon Resource Name (ARN) of the log destination. + // + // This member is required. + DestinationArn *string + + // The ID of the access log subscription. + // + // This member is required. + Id *string + + // The Amazon Resource Name (ARN) of the service network or service. + // + // This member is required. + ResourceArn *string + + // The ID of the service network or service. + // + // This member is required. + ResourceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAccessLogSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAccessLogSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAccessLogSubscription{}, 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_opCreateAccessLogSubscriptionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAccessLogSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessLogSubscription(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_initializeOpCreateAccessLogSubscription struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAccessLogSubscription) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAccessLogSubscription) 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.(*CreateAccessLogSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAccessLogSubscriptionInput ") + } + + 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_opCreateAccessLogSubscriptionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAccessLogSubscription{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAccessLogSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateAccessLogSubscription", + } +} diff --git a/service/vpclattice/api_op_CreateListener.go b/service/vpclattice/api_op_CreateListener.go new file mode 100644 index 00000000000..5ac6abc93ee --- /dev/null +++ b/service/vpclattice/api_op_CreateListener.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a listener for a service. Before you start using your Amazon VPC Lattice +// service, you must add one or more listeners. A listener is a process that checks +// for connection requests to your services. For more information, see Listeners +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html) in the Amazon +// VPC Lattice User Guide. +func (c *Client) CreateListener(ctx context.Context, params *CreateListenerInput, optFns ...func(*Options)) (*CreateListenerOutput, error) { + if params == nil { + params = &CreateListenerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateListener", params, optFns, c.addOperationCreateListenerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateListenerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateListenerInput struct { + + // The action for the default rule. Each listener has a default rule. Each rule + // consists of a priority, one or more actions, and one or more conditions. The + // default rule is the rule that's used if no other rules match. Each rule must + // include exactly one of the following types of actions: forward or + // fixed-response, and it must be the last action to be performed. + // + // This member is required. + DefaultAction types.RuleAction + + // The name of the listener. A listener name must be unique within a service. The + // valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the + // first or last character, or immediately after another hyphen. + // + // This member is required. + Name *string + + // The listener protocol HTTP or HTTPS. + // + // This member is required. + Protocol types.ListenerProtocol + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The listener port. You can specify a value from 1 to 65535. For HTTP, the + // default is 80. For HTTPS, the default is 443. + Port *int32 + + // The tags for the listener. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateListenerOutput struct { + + // The Amazon Resource Name (ARN) of the listener. + Arn *string + + // The action for the default rule. + DefaultAction types.RuleAction + + // The ID of the listener. + Id *string + + // The name of the listener. + Name *string + + // The port number of the listener. + Port *int32 + + // The protocol of the listener. + Protocol types.ListenerProtocol + + // The Amazon Resource Name (ARN) of the service. + ServiceArn *string + + // The ID of the service. + ServiceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateListenerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateListener{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateListener{}, 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_opCreateListenerMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateListenerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateListener(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_initializeOpCreateListener struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateListener) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateListener) 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.(*CreateListenerInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateListenerInput ") + } + + 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_opCreateListenerMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateListener{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateListener(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateListener", + } +} diff --git a/service/vpclattice/api_op_CreateRule.go b/service/vpclattice/api_op_CreateRule.go new file mode 100644 index 00000000000..c2244e483ea --- /dev/null +++ b/service/vpclattice/api_op_CreateRule.go @@ -0,0 +1,220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a listener rule. Each listener has a default rule for checking +// connection requests, but you can define additional rules. Each rule consists of +// a priority, one or more actions, and one or more conditions. For more +// information, see Listener rules +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) +// in the Amazon VPC Lattice User Guide. +func (c *Client) CreateRule(ctx context.Context, params *CreateRuleInput, optFns ...func(*Options)) (*CreateRuleOutput, error) { + if params == nil { + params = &CreateRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRule", params, optFns, c.addOperationCreateRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRuleInput struct { + + // The action for the default rule. + // + // This member is required. + Action types.RuleAction + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The rule match. + // + // This member is required. + Match types.RuleMatch + + // The name of the rule. The name must be unique within the listener. The valid + // characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or + // last character, or immediately after another hyphen. + // + // This member is required. + Name *string + + // The priority assigned to the rule. Each rule for a specific listener must have a + // unique priority. The lower the priority number the higher the priority. + // + // This member is required. + Priority *int32 + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The tags for the rule. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateRuleOutput struct { + + // The rule action. Each rule must include exactly one of the following types of + // actions: forward or fixed-response, and it must be the last action to be + // performed. + Action types.RuleAction + + // The Amazon Resource Name (ARN) of the rule. + Arn *string + + // The ID of the rule. + Id *string + + // The rule match. The RuleMatch must be an HttpMatch. This means that the rule + // should be an exact match on HTTP constraints which are made up of the HTTP + // method, path, and header. + Match types.RuleMatch + + // The name of the rule. + Name *string + + // The priority assigned to the rule. The lower the priority number the higher the + // priority. + Priority *int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRule{}, 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_opCreateRuleMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRule(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_initializeOpCreateRule struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateRule) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateRule) 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.(*CreateRuleInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateRuleInput ") + } + + 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_opCreateRuleMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateRule{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateRule", + } +} diff --git a/service/vpclattice/api_op_CreateService.go b/service/vpclattice/api_op_CreateService.go new file mode 100644 index 00000000000..db9b4b59d22 --- /dev/null +++ b/service/vpclattice/api_op_CreateService.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a service. A service is any software application that can run on +// instances containers, or serverless functions within an account or virtual +// private cloud (VPC). For more information, see Services +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html) in the Amazon +// VPC Lattice User Guide. +func (c *Client) CreateService(ctx context.Context, params *CreateServiceInput, optFns ...func(*Options)) (*CreateServiceOutput, error) { + if params == nil { + params = &CreateServiceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateService", params, optFns, c.addOperationCreateServiceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateServiceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateServiceInput struct { + + // The name of the service. The name must be unique within the account. The valid + // characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or + // last character, or immediately after another hyphen. + // + // This member is required. + Name *string + + // The type of IAM policy. + // + // * NONE: The resource does not use an IAM policy. This + // is the default. + // + // * AWS_IAM: The resource uses an IAM policy. When this type is + // used, auth is enabled and an auth policy is required. + AuthType types.AuthType + + // The Amazon Resource Name (ARN) of the certificate. + CertificateArn *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The custom domain name of the service. + CustomDomainName *string + + // The tags for the service. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateServiceOutput struct { + + // The Amazon Resource Name (ARN) of the service. + Arn *string + + // The type of IAM policy. + AuthType types.AuthType + + // The Amazon Resource Name (ARN) of the certificate. + CertificateArn *string + + // The custom domain name of the service. + CustomDomainName *string + + // The public DNS name of the service. + DnsEntry *types.DnsEntry + + // The ID of the service. + Id *string + + // The name of the service. + Name *string + + // The status. If the status is CREATE_FAILED, you will have to delete and recreate + // the service. + Status types.ServiceStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateServiceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateService{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateService{}, 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_opCreateServiceMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateServiceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateService(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_initializeOpCreateService struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateService) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateService) 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.(*CreateServiceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateServiceInput ") + } + + 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_opCreateServiceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateService{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateService(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateService", + } +} diff --git a/service/vpclattice/api_op_CreateServiceNetwork.go b/service/vpclattice/api_op_CreateServiceNetwork.go new file mode 100644 index 00000000000..fadf35c6d31 --- /dev/null +++ b/service/vpclattice/api_op_CreateServiceNetwork.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a service network. A service network is a logical boundary for a +// collection of services. You can associate services and VPCs with a service +// network. For more information, see Service networks +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html) in the +// Amazon VPC Lattice User Guide. +func (c *Client) CreateServiceNetwork(ctx context.Context, params *CreateServiceNetworkInput, optFns ...func(*Options)) (*CreateServiceNetworkOutput, error) { + if params == nil { + params = &CreateServiceNetworkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateServiceNetwork", params, optFns, c.addOperationCreateServiceNetworkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateServiceNetworkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateServiceNetworkInput struct { + + // The name of the service network. The name must be unique to the account. The + // valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the + // first or last character, or immediately after another hyphen. + // + // This member is required. + Name *string + + // The type of IAM policy. + // + // * NONE: The resource does not use an IAM policy. This + // is the default. + // + // * AWS_IAM: The resource uses an IAM policy. When this type is + // used, auth is enabled and an auth policy is required. + AuthType types.AuthType + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The tags for the service network. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateServiceNetworkOutput struct { + + // The Amazon Resource Name (ARN) of the service network. + Arn *string + + // The type of IAM policy. + AuthType types.AuthType + + // The ID of the service network. + Id *string + + // The name of the service network. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateServiceNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateServiceNetwork{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateServiceNetwork{}, 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_opCreateServiceNetworkMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateServiceNetworkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateServiceNetwork(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_initializeOpCreateServiceNetwork struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateServiceNetwork) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateServiceNetwork) 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.(*CreateServiceNetworkInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateServiceNetworkInput ") + } + + 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_opCreateServiceNetworkMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateServiceNetwork{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateServiceNetwork(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateServiceNetwork", + } +} diff --git a/service/vpclattice/api_op_CreateServiceNetworkServiceAssociation.go b/service/vpclattice/api_op_CreateServiceNetworkServiceAssociation.go new file mode 100644 index 00000000000..45d1d20c0b8 --- /dev/null +++ b/service/vpclattice/api_op_CreateServiceNetworkServiceAssociation.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a service with a service network. You can't use this operation if the +// service and service network are already associated or if there is a +// disassociation or deletion in progress. If the association fails, you can retry +// the operation by deleting the association and recreating it. You cannot +// associate a service and service network that are shared with a caller. The +// caller must own either the service or the service network. As a result of this +// operation, the association is created in the service network account and the +// association owner account. +func (c *Client) CreateServiceNetworkServiceAssociation(ctx context.Context, params *CreateServiceNetworkServiceAssociationInput, optFns ...func(*Options)) (*CreateServiceNetworkServiceAssociationOutput, error) { + if params == nil { + params = &CreateServiceNetworkServiceAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateServiceNetworkServiceAssociation", params, optFns, c.addOperationCreateServiceNetworkServiceAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateServiceNetworkServiceAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateServiceNetworkServiceAssociationInput struct { + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service network. You must use the + // ARN if the resources specified in the operation are in different accounts. + // + // This member is required. + ServiceNetworkIdentifier *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The tags for the association. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateServiceNetworkServiceAssociationOutput struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The account that created the association. + CreatedBy *string + + // The custom domain name of the service. + CustomDomainName *string + + // The DNS name of the service. + DnsEntry *types.DnsEntry + + // The ID of the association. + Id *string + + // The operation's status. + Status types.ServiceNetworkServiceAssociationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateServiceNetworkServiceAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateServiceNetworkServiceAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateServiceNetworkServiceAssociation{}, 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_opCreateServiceNetworkServiceAssociationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateServiceNetworkServiceAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateServiceNetworkServiceAssociation(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_initializeOpCreateServiceNetworkServiceAssociation struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateServiceNetworkServiceAssociation) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateServiceNetworkServiceAssociation) 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.(*CreateServiceNetworkServiceAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateServiceNetworkServiceAssociationInput ") + } + + 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_opCreateServiceNetworkServiceAssociationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateServiceNetworkServiceAssociation{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateServiceNetworkServiceAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateServiceNetworkServiceAssociation", + } +} diff --git a/service/vpclattice/api_op_CreateServiceNetworkVpcAssociation.go b/service/vpclattice/api_op_CreateServiceNetworkVpcAssociation.go new file mode 100644 index 00000000000..c016bb79659 --- /dev/null +++ b/service/vpclattice/api_op_CreateServiceNetworkVpcAssociation.go @@ -0,0 +1,204 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a VPC with a service network. When you associate a VPC with the +// service network, it enables all the resources within that VPC to be clients and +// communicate with other services in the service network. For more information, +// see Manage VPC associations +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-vpc-associations) +// in the Amazon VPC Lattice User Guide. You can't use this operation if there is a +// disassociation in progress. If the association fails, retry by deleting the +// association and recreating it. As a result of this operation, the association +// gets created in the service network account and the VPC owner account. Once a +// security group is added to the VPC association it cannot be removed. You can add +// or update the security groups being used for the VPC association once a security +// group is attached. To remove all security groups you must reassociate the VPC. +func (c *Client) CreateServiceNetworkVpcAssociation(ctx context.Context, params *CreateServiceNetworkVpcAssociationInput, optFns ...func(*Options)) (*CreateServiceNetworkVpcAssociationOutput, error) { + if params == nil { + params = &CreateServiceNetworkVpcAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateServiceNetworkVpcAssociation", params, optFns, c.addOperationCreateServiceNetworkVpcAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateServiceNetworkVpcAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateServiceNetworkVpcAssociationInput struct { + + // The ID or Amazon Resource Name (ARN) of the service network. You must use the + // ARN when the resources specified in the operation are in different accounts. + // + // This member is required. + ServiceNetworkIdentifier *string + + // The ID of the VPC. + // + // This member is required. + VpcIdentifier *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The IDs of the security groups. Security groups aren't added by default. You can + // add a security group to apply network level controls to control which resources + // in a VPC are allowed to access the service network and its services. For more + // information, see Control traffic to resources using security groups + // (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) in + // the Amazon VPC User Guide. + SecurityGroupIds []string + + // The tags for the association. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateServiceNetworkVpcAssociationOutput struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The account that created the association. + CreatedBy *string + + // The ID of the association. + Id *string + + // The IDs of the security groups. + SecurityGroupIds []string + + // The operation's status. + Status types.ServiceNetworkVpcAssociationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateServiceNetworkVpcAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateServiceNetworkVpcAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateServiceNetworkVpcAssociation{}, 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_opCreateServiceNetworkVpcAssociationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateServiceNetworkVpcAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateServiceNetworkVpcAssociation(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_initializeOpCreateServiceNetworkVpcAssociation struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateServiceNetworkVpcAssociation) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateServiceNetworkVpcAssociation) 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.(*CreateServiceNetworkVpcAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateServiceNetworkVpcAssociationInput ") + } + + 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_opCreateServiceNetworkVpcAssociationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateServiceNetworkVpcAssociation{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateServiceNetworkVpcAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateServiceNetworkVpcAssociation", + } +} diff --git a/service/vpclattice/api_op_CreateTargetGroup.go b/service/vpclattice/api_op_CreateTargetGroup.go new file mode 100644 index 00000000000..5bfae2fe9bc --- /dev/null +++ b/service/vpclattice/api_op_CreateTargetGroup.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a target group. A target group is a collection of targets, or compute +// resources, that run your application or service. A target group can only be used +// by a single service. For more information, see Target groups +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html) in the +// Amazon VPC Lattice User Guide. +func (c *Client) CreateTargetGroup(ctx context.Context, params *CreateTargetGroupInput, optFns ...func(*Options)) (*CreateTargetGroupOutput, error) { + if params == nil { + params = &CreateTargetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTargetGroup", params, optFns, c.addOperationCreateTargetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTargetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTargetGroupInput struct { + + // The name of the target group. The name must be unique within the account. The + // valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the + // first or last character, or immediately after another hyphen. + // + // This member is required. + Name *string + + // The type of target group. + // + // This member is required. + Type types.TargetGroupType + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. If you retry a request that completed successfully using the + // same client token and parameters, the retry succeeds without performing any + // actions. If the parameters aren't identical, the retry fails. + ClientToken *string + + // The target group configuration. If type is set to LAMBDA, this parameter doesn't + // apply. + Config *types.TargetGroupConfig + + // The tags for the target group. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateTargetGroupOutput struct { + + // The Amazon Resource Name (ARN) of the target group. + Arn *string + + // The target group configuration. If type is set to LAMBDA, this parameter doesn't + // apply. + Config *types.TargetGroupConfig + + // The ID of the target group. + Id *string + + // The name of the target group. + Name *string + + // The operation's status. You can retry the operation if the status is + // CREATE_FAILED. However, if you retry it while the status is CREATE_IN_PROGRESS, + // there is no change in the status. + Status types.TargetGroupStatus + + // The type of target group. + Type types.TargetGroupType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTargetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTargetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTargetGroup{}, 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_opCreateTargetGroupMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateTargetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTargetGroup(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_initializeOpCreateTargetGroup struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateTargetGroup) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateTargetGroup) 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.(*CreateTargetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateTargetGroupInput ") + } + + 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_opCreateTargetGroupMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateTargetGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateTargetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "CreateTargetGroup", + } +} diff --git a/service/vpclattice/api_op_DeleteAccessLogSubscription.go b/service/vpclattice/api_op_DeleteAccessLogSubscription.go new file mode 100644 index 00000000000..17b0c6fcd64 --- /dev/null +++ b/service/vpclattice/api_op_DeleteAccessLogSubscription.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified access log subscription. +func (c *Client) DeleteAccessLogSubscription(ctx context.Context, params *DeleteAccessLogSubscriptionInput, optFns ...func(*Options)) (*DeleteAccessLogSubscriptionOutput, error) { + if params == nil { + params = &DeleteAccessLogSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccessLogSubscription", params, optFns, c.addOperationDeleteAccessLogSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccessLogSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccessLogSubscriptionInput struct { + + // The ID or Amazon Resource Name (ARN) of the access log subscription. + // + // This member is required. + AccessLogSubscriptionIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteAccessLogSubscriptionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAccessLogSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAccessLogSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAccessLogSubscription{}, 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 = addOpDeleteAccessLogSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessLogSubscription(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_opDeleteAccessLogSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteAccessLogSubscription", + } +} diff --git a/service/vpclattice/api_op_DeleteAuthPolicy.go b/service/vpclattice/api_op_DeleteAuthPolicy.go new file mode 100644 index 00000000000..1c49e1fe726 --- /dev/null +++ b/service/vpclattice/api_op_DeleteAuthPolicy.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified auth policy. If an auth is set to Amazon Web Services_IAM +// and the auth policy is deleted, all requests will be denied by default. If you +// are trying to remove the auth policy completely, you must set the auth_type to +// NONE. If auth is enabled on the resource, but no auth policy is set, all +// requests will be denied. +func (c *Client) DeleteAuthPolicy(ctx context.Context, params *DeleteAuthPolicyInput, optFns ...func(*Options)) (*DeleteAuthPolicyOutput, error) { + if params == nil { + params = &DeleteAuthPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAuthPolicy", params, optFns, c.addOperationDeleteAuthPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAuthPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAuthPolicyInput struct { + + // The ID or Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteAuthPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAuthPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAuthPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAuthPolicy{}, 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 = addOpDeleteAuthPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAuthPolicy(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_opDeleteAuthPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteAuthPolicy", + } +} diff --git a/service/vpclattice/api_op_DeleteListener.go b/service/vpclattice/api_op_DeleteListener.go new file mode 100644 index 00000000000..08f157c6ea3 --- /dev/null +++ b/service/vpclattice/api_op_DeleteListener.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified listener. +func (c *Client) DeleteListener(ctx context.Context, params *DeleteListenerInput, optFns ...func(*Options)) (*DeleteListenerOutput, error) { + if params == nil { + params = &DeleteListenerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteListener", params, optFns, c.addOperationDeleteListenerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteListenerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteListenerInput struct { + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteListenerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteListenerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteListener{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteListener{}, 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 = addOpDeleteListenerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteListener(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_opDeleteListener(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteListener", + } +} diff --git a/service/vpclattice/api_op_DeleteResourcePolicy.go b/service/vpclattice/api_op_DeleteResourcePolicy.go new file mode 100644 index 00000000000..59dcb779457 --- /dev/null +++ b/service/vpclattice/api_op_DeleteResourcePolicy.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified resource policy. +func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { + if params == nil { + params = &DeleteResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteResourcePolicyInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type DeleteResourcePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResourcePolicy{}, 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 = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(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_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteResourcePolicy", + } +} diff --git a/service/vpclattice/api_op_DeleteRule.go b/service/vpclattice/api_op_DeleteRule.go new file mode 100644 index 00000000000..13a42b6c06c --- /dev/null +++ b/service/vpclattice/api_op_DeleteRule.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a listener rule. Each listener has a default rule for checking +// connection requests, but you can define additional rules. Each rule consists of +// a priority, one or more actions, and one or more conditions. You can delete +// additional listener rules, but you cannot delete the default rule. For more +// information, see Listener rules +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) +// in the Amazon VPC Lattice User Guide. +func (c *Client) DeleteRule(ctx context.Context, params *DeleteRuleInput, optFns ...func(*Options)) (*DeleteRuleOutput, error) { + if params == nil { + params = &DeleteRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRule", params, optFns, c.addOperationDeleteRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRuleInput struct { + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the rule. + // + // This member is required. + RuleIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRule{}, 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 = addOpDeleteRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRule(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_opDeleteRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteRule", + } +} diff --git a/service/vpclattice/api_op_DeleteService.go b/service/vpclattice/api_op_DeleteService.go new file mode 100644 index 00000000000..6e3831cc48f --- /dev/null +++ b/service/vpclattice/api_op_DeleteService.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a service. A service can't be deleted if it's associated with a service +// network. If you delete a service, all resources related to the service, such as +// the resource policy, auth policy, listeners, listener rules, and access log +// subscriptions, are also deleted. For more information, see Delete a service +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html#delete-service) +// in the Amazon VPC Lattice User Guide. +func (c *Client) DeleteService(ctx context.Context, params *DeleteServiceInput, optFns ...func(*Options)) (*DeleteServiceOutput, error) { + if params == nil { + params = &DeleteServiceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteService", params, optFns, c.addOperationDeleteServiceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteServiceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteServiceInput struct { + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteServiceOutput struct { + + // The Amazon Resource Name (ARN) of the service. + Arn *string + + // The ID of the service. + Id *string + + // The name of the service. + Name *string + + // The status. You can retry the operation if the status is DELETE_FAILED. However, + // if you retry it while the status is DELETE_IN_PROGRESS, the status doesn't + // change. + Status types.ServiceStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteServiceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteService{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteService{}, 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 = addOpDeleteServiceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteService(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_opDeleteService(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteService", + } +} diff --git a/service/vpclattice/api_op_DeleteServiceNetwork.go b/service/vpclattice/api_op_DeleteServiceNetwork.go new file mode 100644 index 00000000000..a52ae49e05d --- /dev/null +++ b/service/vpclattice/api_op_DeleteServiceNetwork.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a service network. You can only delete the service network if there is +// no service or VPC associated with it. If you delete a service network, all +// resources related to the service network, such as the resource policy, auth +// policy, and access log subscriptions, are also deleted. For more information, +// see Delete a service network +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html#delete-service-network) +// in the Amazon VPC Lattice User Guide. +func (c *Client) DeleteServiceNetwork(ctx context.Context, params *DeleteServiceNetworkInput, optFns ...func(*Options)) (*DeleteServiceNetworkOutput, error) { + if params == nil { + params = &DeleteServiceNetworkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteServiceNetwork", params, optFns, c.addOperationDeleteServiceNetworkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteServiceNetworkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteServiceNetworkInput struct { + + // The Amazon Resource Name (ARN) or ID of the service network. + // + // This member is required. + ServiceNetworkIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteServiceNetworkOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteServiceNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteServiceNetwork{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteServiceNetwork{}, 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 = addOpDeleteServiceNetworkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteServiceNetwork(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_opDeleteServiceNetwork(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteServiceNetwork", + } +} diff --git a/service/vpclattice/api_op_DeleteServiceNetworkServiceAssociation.go b/service/vpclattice/api_op_DeleteServiceNetworkServiceAssociation.go new file mode 100644 index 00000000000..295ad95c2c5 --- /dev/null +++ b/service/vpclattice/api_op_DeleteServiceNetworkServiceAssociation.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the association between a specified service and the specific service +// network. This request will fail if an association is still in progress. +func (c *Client) DeleteServiceNetworkServiceAssociation(ctx context.Context, params *DeleteServiceNetworkServiceAssociationInput, optFns ...func(*Options)) (*DeleteServiceNetworkServiceAssociationOutput, error) { + if params == nil { + params = &DeleteServiceNetworkServiceAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteServiceNetworkServiceAssociation", params, optFns, c.addOperationDeleteServiceNetworkServiceAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteServiceNetworkServiceAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteServiceNetworkServiceAssociationInput struct { + + // The ID or Amazon Resource Name (ARN) of the association. + // + // This member is required. + ServiceNetworkServiceAssociationIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteServiceNetworkServiceAssociationOutput struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The ID of the association. + Id *string + + // The operation's status. You can retry the operation if the status is + // DELETE_FAILED. However, if you retry it when the status is DELETE_IN_PROGRESS, + // there is no change in the status. + Status types.ServiceNetworkServiceAssociationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteServiceNetworkServiceAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteServiceNetworkServiceAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteServiceNetworkServiceAssociation{}, 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 = addOpDeleteServiceNetworkServiceAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteServiceNetworkServiceAssociation(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_opDeleteServiceNetworkServiceAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteServiceNetworkServiceAssociation", + } +} diff --git a/service/vpclattice/api_op_DeleteServiceNetworkVpcAssociation.go b/service/vpclattice/api_op_DeleteServiceNetworkVpcAssociation.go new file mode 100644 index 00000000000..bc89ff7947e --- /dev/null +++ b/service/vpclattice/api_op_DeleteServiceNetworkVpcAssociation.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates the VPC from the service network. You can't disassociate the VPC +// if there is a create or update association in progress. +func (c *Client) DeleteServiceNetworkVpcAssociation(ctx context.Context, params *DeleteServiceNetworkVpcAssociationInput, optFns ...func(*Options)) (*DeleteServiceNetworkVpcAssociationOutput, error) { + if params == nil { + params = &DeleteServiceNetworkVpcAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteServiceNetworkVpcAssociation", params, optFns, c.addOperationDeleteServiceNetworkVpcAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteServiceNetworkVpcAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteServiceNetworkVpcAssociationInput struct { + + // The ID or Amazon Resource Name (ARN) of the association. + // + // This member is required. + ServiceNetworkVpcAssociationIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteServiceNetworkVpcAssociationOutput struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The ID of the association. + Id *string + + // The status. You can retry the operation if the status is DELETE_FAILED. However, + // if you retry it when the status is DELETE_IN_PROGRESS, there is no change in the + // status. + Status types.ServiceNetworkVpcAssociationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteServiceNetworkVpcAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteServiceNetworkVpcAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteServiceNetworkVpcAssociation{}, 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 = addOpDeleteServiceNetworkVpcAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteServiceNetworkVpcAssociation(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_opDeleteServiceNetworkVpcAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteServiceNetworkVpcAssociation", + } +} diff --git a/service/vpclattice/api_op_DeleteTargetGroup.go b/service/vpclattice/api_op_DeleteTargetGroup.go new file mode 100644 index 00000000000..2d270b36f1d --- /dev/null +++ b/service/vpclattice/api_op_DeleteTargetGroup.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a target group. You can't delete a target group if it is used in a +// listener rule or if the target group creation is in progress. +func (c *Client) DeleteTargetGroup(ctx context.Context, params *DeleteTargetGroupInput, optFns ...func(*Options)) (*DeleteTargetGroupOutput, error) { + if params == nil { + params = &DeleteTargetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTargetGroup", params, optFns, c.addOperationDeleteTargetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTargetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTargetGroupInput struct { + + // The ID or Amazon Resource Name (ARN) of the target group. + // + // This member is required. + TargetGroupIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteTargetGroupOutput struct { + + // The Amazon Resource Name (ARN) of the target group. + Arn *string + + // The ID of the target group. + Id *string + + // The status. You can retry the operation if the status is DELETE_FAILED. However, + // if you retry it while the status is DELETE_IN_PROGRESS, the status doesn't + // change. + Status types.TargetGroupStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTargetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteTargetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteTargetGroup{}, 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 = addOpDeleteTargetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTargetGroup(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_opDeleteTargetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeleteTargetGroup", + } +} diff --git a/service/vpclattice/api_op_DeregisterTargets.go b/service/vpclattice/api_op_DeregisterTargets.go new file mode 100644 index 00000000000..caf04323ae6 --- /dev/null +++ b/service/vpclattice/api_op_DeregisterTargets.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deregisters the specified targets from the specified target group. +func (c *Client) DeregisterTargets(ctx context.Context, params *DeregisterTargetsInput, optFns ...func(*Options)) (*DeregisterTargetsOutput, error) { + if params == nil { + params = &DeregisterTargetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterTargets", params, optFns, c.addOperationDeregisterTargetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterTargetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeregisterTargetsInput struct { + + // The ID or Amazon Resource Name (ARN) of the target group. + // + // This member is required. + TargetGroupIdentifier *string + + // The targets to deregister. + // + // This member is required. + Targets []types.Target + + noSmithyDocumentSerde +} + +type DeregisterTargetsOutput struct { + + // The targets that were successfully deregistered. + Successful []types.Target + + // The targets that the operation couldn't deregister. + Unsuccessful []types.TargetFailure + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeregisterTargets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeregisterTargets{}, 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 = addOpDeregisterTargetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTargets(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_opDeregisterTargets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "DeregisterTargets", + } +} diff --git a/service/vpclattice/api_op_GetAccessLogSubscription.go b/service/vpclattice/api_op_GetAccessLogSubscription.go new file mode 100644 index 00000000000..4af430f72f4 --- /dev/null +++ b/service/vpclattice/api_op_GetAccessLogSubscription.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified access log subscription. +func (c *Client) GetAccessLogSubscription(ctx context.Context, params *GetAccessLogSubscriptionInput, optFns ...func(*Options)) (*GetAccessLogSubscriptionOutput, error) { + if params == nil { + params = &GetAccessLogSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessLogSubscription", params, optFns, c.addOperationGetAccessLogSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessLogSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessLogSubscriptionInput struct { + + // The ID or Amazon Resource Name (ARN) of the access log subscription. + // + // This member is required. + AccessLogSubscriptionIdentifier *string + + noSmithyDocumentSerde +} + +type GetAccessLogSubscriptionOutput struct { + + // The Amazon Resource Name (ARN) of the access log subscription. + // + // This member is required. + Arn *string + + // The date and time that the access log subscription was created, specified in + // ISO-8601 format. + // + // This member is required. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the access log destination. + // + // This member is required. + DestinationArn *string + + // The ID of the access log subscription. + // + // This member is required. + Id *string + + // The date and time that the access log subscription was last updated, specified + // in ISO-8601 format. + // + // This member is required. + LastUpdatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service network or service. + // + // This member is required. + ResourceArn *string + + // The ID of the service network or service. + // + // This member is required. + ResourceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccessLogSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAccessLogSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAccessLogSubscription{}, 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 = addOpGetAccessLogSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessLogSubscription(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_opGetAccessLogSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetAccessLogSubscription", + } +} diff --git a/service/vpclattice/api_op_GetAuthPolicy.go b/service/vpclattice/api_op_GetAuthPolicy.go new file mode 100644 index 00000000000..0b738d3ecb2 --- /dev/null +++ b/service/vpclattice/api_op_GetAuthPolicy.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the auth policy for the specified service or service +// network. +func (c *Client) GetAuthPolicy(ctx context.Context, params *GetAuthPolicyInput, optFns ...func(*Options)) (*GetAuthPolicyOutput, error) { + if params == nil { + params = &GetAuthPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAuthPolicy", params, optFns, c.addOperationGetAuthPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAuthPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAuthPolicyInput struct { + + // The ID or Amazon Resource Name (ARN) of the service network or service. + // + // This member is required. + ResourceIdentifier *string + + noSmithyDocumentSerde +} + +type GetAuthPolicyOutput struct { + + // The date and time that the auth policy was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The date and time that the auth policy was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The auth policy. + Policy *string + + // The state of the auth policy. The auth policy is only active when the auth type + // is set to Amazon Web Services_IAM. If you provide a policy, then authentication + // and authorization decisions are made based on this policy and the client's IAM + // policy. If the auth type is NONE, then any auth policy you provide will remain + // inactive. For more information, see Create a service network + // (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html#create-service-network) + // in the Amazon VPC Lattice User Guide. + State types.AuthPolicyState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAuthPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAuthPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAuthPolicy{}, 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 = addOpGetAuthPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAuthPolicy(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_opGetAuthPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetAuthPolicy", + } +} diff --git a/service/vpclattice/api_op_GetListener.go b/service/vpclattice/api_op_GetListener.go new file mode 100644 index 00000000000..09af1f3237c --- /dev/null +++ b/service/vpclattice/api_op_GetListener.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified listener for the specified service. +func (c *Client) GetListener(ctx context.Context, params *GetListenerInput, optFns ...func(*Options)) (*GetListenerOutput, error) { + if params == nil { + params = &GetListenerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetListener", params, optFns, c.addOperationGetListenerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetListenerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetListenerInput struct { + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type GetListenerOutput struct { + + // The Amazon Resource Name (ARN) of the listener. + Arn *string + + // The date and time that the listener was created, specified in ISO-8601 format. + CreatedAt *time.Time + + // The actions for the default listener rule. + DefaultAction types.RuleAction + + // The ID of the listener. + Id *string + + // The date and time that the listener was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The name of the listener. + Name *string + + // The listener port. + Port *int32 + + // The listener protocol. + Protocol types.ListenerProtocol + + // The Amazon Resource Name (ARN) of the service. + ServiceArn *string + + // The ID of the service. + ServiceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetListenerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetListener{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetListener{}, 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 = addOpGetListenerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetListener(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_opGetListener(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetListener", + } +} diff --git a/service/vpclattice/api_op_GetResourcePolicy.go b/service/vpclattice/api_op_GetResourcePolicy.go new file mode 100644 index 00000000000..c768c74baa8 --- /dev/null +++ b/service/vpclattice/api_op_GetResourcePolicy.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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" +) + +// Retrieves information about the resource policy. The resource policy is an IAM +// policy created by AWS RAM on behalf of the resource owner when they share a +// resource. +func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { + if params == nil { + params = &GetResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, c.addOperationGetResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourcePolicyInput struct { + + // An IAM policy. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type GetResourcePolicyOutput struct { + + // The Amazon Resource Name (ARN) of the service network or service. + Policy *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetResourcePolicy{}, 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 = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicy(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_opGetResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetResourcePolicy", + } +} diff --git a/service/vpclattice/api_op_GetRule.go b/service/vpclattice/api_op_GetRule.go new file mode 100644 index 00000000000..605899da856 --- /dev/null +++ b/service/vpclattice/api_op_GetRule.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about listener rules. You can also retrieve information +// about the default listener rule. For more information, see Listener rules +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) +// in the Amazon VPC Lattice User Guide. +func (c *Client) GetRule(ctx context.Context, params *GetRuleInput, optFns ...func(*Options)) (*GetRuleOutput, error) { + if params == nil { + params = &GetRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRule", params, optFns, c.addOperationGetRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRuleInput struct { + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the listener rule. + // + // This member is required. + RuleIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type GetRuleOutput struct { + + // The action for the default rule. + Action types.RuleAction + + // The Amazon Resource Name (ARN) of the listener. + Arn *string + + // The date and time that the listener rule was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The ID of the listener. + Id *string + + // Indicates whether this is the default rule. + IsDefault *bool + + // The date and time that the listener rule was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The rule match. + Match types.RuleMatch + + // The name of the listener. + Name *string + + // The priority level for the specified rule. + Priority *int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRule{}, 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 = addOpGetRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRule(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_opGetRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetRule", + } +} diff --git a/service/vpclattice/api_op_GetService.go b/service/vpclattice/api_op_GetService.go new file mode 100644 index 00000000000..677923df5fa --- /dev/null +++ b/service/vpclattice/api_op_GetService.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified service. +func (c *Client) GetService(ctx context.Context, params *GetServiceInput, optFns ...func(*Options)) (*GetServiceOutput, error) { + if params == nil { + params = &GetServiceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetService", params, optFns, c.addOperationGetServiceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceInput struct { + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type GetServiceOutput struct { + + // The Amazon Resource Name (ARN) of the service. + Arn *string + + // The type of IAM policy. + AuthType types.AuthType + + // The Amazon Resource Name (ARN) of the certificate. + CertificateArn *string + + // The date and time that the service was created, specified in ISO-8601 format. + CreatedAt *time.Time + + // The custom domain name of the service. + CustomDomainName *string + + // The DNS name of the service. + DnsEntry *types.DnsEntry + + // The failure code. + FailureCode *string + + // The failure message. + FailureMessage *string + + // The ID of the service. + Id *string + + // The date and time that the service was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The name of the service. + Name *string + + // The status of the service. + Status types.ServiceStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetServiceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetService{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetService{}, 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 = addOpGetServiceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetService(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_opGetService(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetService", + } +} diff --git a/service/vpclattice/api_op_GetServiceNetwork.go b/service/vpclattice/api_op_GetServiceNetwork.go new file mode 100644 index 00000000000..191f941785e --- /dev/null +++ b/service/vpclattice/api_op_GetServiceNetwork.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified service network. +func (c *Client) GetServiceNetwork(ctx context.Context, params *GetServiceNetworkInput, optFns ...func(*Options)) (*GetServiceNetworkOutput, error) { + if params == nil { + params = &GetServiceNetworkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetServiceNetwork", params, optFns, c.addOperationGetServiceNetworkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceNetworkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceNetworkInput struct { + + // The ID or Amazon Resource Name (ARN) of the service network. + // + // This member is required. + ServiceNetworkIdentifier *string + + noSmithyDocumentSerde +} + +type GetServiceNetworkOutput struct { + + // The Amazon Resource Name (ARN) of the service network. + Arn *string + + // The type of IAM policy. + AuthType types.AuthType + + // The date and time that the service network was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The ID of the service network. + Id *string + + // The date and time of the last update, specified in ISO-8601 format. + LastUpdatedAt *time.Time + + // The name of the service network. + Name *string + + // The number of services associated with the service network. + NumberOfAssociatedServices *int64 + + // The number of VPCs associated with the service network. + NumberOfAssociatedVPCs *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetServiceNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetServiceNetwork{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetServiceNetwork{}, 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 = addOpGetServiceNetworkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceNetwork(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_opGetServiceNetwork(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetServiceNetwork", + } +} diff --git a/service/vpclattice/api_op_GetServiceNetworkServiceAssociation.go b/service/vpclattice/api_op_GetServiceNetworkServiceAssociation.go new file mode 100644 index 00000000000..3cfd9399149 --- /dev/null +++ b/service/vpclattice/api_op_GetServiceNetworkServiceAssociation.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified association between a service network +// and a service. +func (c *Client) GetServiceNetworkServiceAssociation(ctx context.Context, params *GetServiceNetworkServiceAssociationInput, optFns ...func(*Options)) (*GetServiceNetworkServiceAssociationOutput, error) { + if params == nil { + params = &GetServiceNetworkServiceAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetServiceNetworkServiceAssociation", params, optFns, c.addOperationGetServiceNetworkServiceAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceNetworkServiceAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceNetworkServiceAssociationInput struct { + + // The ID or Amazon Resource Name (ARN) of the association. + // + // This member is required. + ServiceNetworkServiceAssociationIdentifier *string + + noSmithyDocumentSerde +} + +type GetServiceNetworkServiceAssociationOutput struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The date and time that the association was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The account that created the association. + CreatedBy *string + + // The custom domain name of the service. + CustomDomainName *string + + // The DNS name of the service. + DnsEntry *types.DnsEntry + + // The failure code. + FailureCode *string + + // The failure message. + FailureMessage *string + + // The ID of the service network and service association. + Id *string + + // The Amazon Resource Name (ARN) of the service. + ServiceArn *string + + // The ID of the service. + ServiceId *string + + // The name of the service. + ServiceName *string + + // The Amazon Resource Name (ARN) of the service network. + ServiceNetworkArn *string + + // The ID of the service network. + ServiceNetworkId *string + + // The name of the service network. + ServiceNetworkName *string + + // The status of the association. + Status types.ServiceNetworkServiceAssociationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetServiceNetworkServiceAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetServiceNetworkServiceAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetServiceNetworkServiceAssociation{}, 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 = addOpGetServiceNetworkServiceAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceNetworkServiceAssociation(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_opGetServiceNetworkServiceAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetServiceNetworkServiceAssociation", + } +} diff --git a/service/vpclattice/api_op_GetServiceNetworkVpcAssociation.go b/service/vpclattice/api_op_GetServiceNetworkVpcAssociation.go new file mode 100644 index 00000000000..5c02e7c1689 --- /dev/null +++ b/service/vpclattice/api_op_GetServiceNetworkVpcAssociation.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the association between a service network and a VPC. +func (c *Client) GetServiceNetworkVpcAssociation(ctx context.Context, params *GetServiceNetworkVpcAssociationInput, optFns ...func(*Options)) (*GetServiceNetworkVpcAssociationOutput, error) { + if params == nil { + params = &GetServiceNetworkVpcAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetServiceNetworkVpcAssociation", params, optFns, c.addOperationGetServiceNetworkVpcAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceNetworkVpcAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceNetworkVpcAssociationInput struct { + + // The ID or Amazon Resource Name (ARN) of the association. + // + // This member is required. + ServiceNetworkVpcAssociationIdentifier *string + + noSmithyDocumentSerde +} + +type GetServiceNetworkVpcAssociationOutput struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The date and time that the association was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The account that created the association. + CreatedBy *string + + // The failure code. + FailureCode *string + + // The failure message. + FailureMessage *string + + // The ID of the specified association between the service network and the VPC. + Id *string + + // The date and time that the association was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The IDs of the security groups. + SecurityGroupIds []string + + // The Amazon Resource Name (ARN) of the service network. + ServiceNetworkArn *string + + // The ID of the service network. + ServiceNetworkId *string + + // The name of the service network. + ServiceNetworkName *string + + // The status of the association. + Status types.ServiceNetworkVpcAssociationStatus + + // The ID of the VPC. + VpcId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetServiceNetworkVpcAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetServiceNetworkVpcAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetServiceNetworkVpcAssociation{}, 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 = addOpGetServiceNetworkVpcAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceNetworkVpcAssociation(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_opGetServiceNetworkVpcAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetServiceNetworkVpcAssociation", + } +} diff --git a/service/vpclattice/api_op_GetTargetGroup.go b/service/vpclattice/api_op_GetTargetGroup.go new file mode 100644 index 00000000000..7f784d10bc1 --- /dev/null +++ b/service/vpclattice/api_op_GetTargetGroup.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about the specified target group. +func (c *Client) GetTargetGroup(ctx context.Context, params *GetTargetGroupInput, optFns ...func(*Options)) (*GetTargetGroupOutput, error) { + if params == nil { + params = &GetTargetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTargetGroup", params, optFns, c.addOperationGetTargetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTargetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTargetGroupInput struct { + + // The ID or Amazon Resource Name (ARN) of the target group. + // + // This member is required. + TargetGroupIdentifier *string + + noSmithyDocumentSerde +} + +type GetTargetGroupOutput struct { + + // The Amazon Resource Name (ARN) of the target group. + Arn *string + + // The target group configuration. + Config *types.TargetGroupConfig + + // The date and time that the target group was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The failure code. + FailureCode *string + + // The failure message. + FailureMessage *string + + // The ID of the target group. + Id *string + + // The date and time that the target group was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The name of the target group. + Name *string + + // The Amazon Resource Names (ARNs) of the service. + ServiceArns []string + + // The status. + Status types.TargetGroupStatus + + // The target group type. + Type types.TargetGroupType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTargetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTargetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTargetGroup{}, 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 = addOpGetTargetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTargetGroup(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_opGetTargetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "GetTargetGroup", + } +} diff --git a/service/vpclattice/api_op_ListAccessLogSubscriptions.go b/service/vpclattice/api_op_ListAccessLogSubscriptions.go new file mode 100644 index 00000000000..30361182299 --- /dev/null +++ b/service/vpclattice/api_op_ListAccessLogSubscriptions.go @@ -0,0 +1,226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all access log subscriptions for the specified service network or service. +func (c *Client) ListAccessLogSubscriptions(ctx context.Context, params *ListAccessLogSubscriptionsInput, optFns ...func(*Options)) (*ListAccessLogSubscriptionsOutput, error) { + if params == nil { + params = &ListAccessLogSubscriptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccessLogSubscriptions", params, optFns, c.addOperationListAccessLogSubscriptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccessLogSubscriptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccessLogSubscriptionsInput struct { + + // The ID or Amazon Resource Name (ARN) of the service network or service. + // + // This member is required. + ResourceIdentifier *string + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAccessLogSubscriptionsOutput struct { + + // The access log subscriptions. + // + // This member is required. + Items []types.AccessLogSubscriptionSummary + + // A pagination token for the next page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAccessLogSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccessLogSubscriptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccessLogSubscriptions{}, 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 = addOpListAccessLogSubscriptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessLogSubscriptions(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 +} + +// ListAccessLogSubscriptionsAPIClient is a client that implements the +// ListAccessLogSubscriptions operation. +type ListAccessLogSubscriptionsAPIClient interface { + ListAccessLogSubscriptions(context.Context, *ListAccessLogSubscriptionsInput, ...func(*Options)) (*ListAccessLogSubscriptionsOutput, error) +} + +var _ ListAccessLogSubscriptionsAPIClient = (*Client)(nil) + +// ListAccessLogSubscriptionsPaginatorOptions is the paginator options for +// ListAccessLogSubscriptions +type ListAccessLogSubscriptionsPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListAccessLogSubscriptionsPaginator is a paginator for +// ListAccessLogSubscriptions +type ListAccessLogSubscriptionsPaginator struct { + options ListAccessLogSubscriptionsPaginatorOptions + client ListAccessLogSubscriptionsAPIClient + params *ListAccessLogSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewListAccessLogSubscriptionsPaginator returns a new +// ListAccessLogSubscriptionsPaginator +func NewListAccessLogSubscriptionsPaginator(client ListAccessLogSubscriptionsAPIClient, params *ListAccessLogSubscriptionsInput, optFns ...func(*ListAccessLogSubscriptionsPaginatorOptions)) *ListAccessLogSubscriptionsPaginator { + if params == nil { + params = &ListAccessLogSubscriptionsInput{} + } + + options := ListAccessLogSubscriptionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAccessLogSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessLogSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAccessLogSubscriptions page. +func (p *ListAccessLogSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessLogSubscriptionsOutput, 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.ListAccessLogSubscriptions(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_opListAccessLogSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListAccessLogSubscriptions", + } +} diff --git a/service/vpclattice/api_op_ListListeners.go b/service/vpclattice/api_op_ListListeners.go new file mode 100644 index 00000000000..08e1a0c5506 --- /dev/null +++ b/service/vpclattice/api_op_ListListeners.go @@ -0,0 +1,223 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the listeners for the specified service. +func (c *Client) ListListeners(ctx context.Context, params *ListListenersInput, optFns ...func(*Options)) (*ListListenersOutput, error) { + if params == nil { + params = &ListListenersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListListeners", params, optFns, c.addOperationListListenersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListListenersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListListenersInput struct { + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListListenersOutput struct { + + // Information about the listeners. + // + // This member is required. + Items []types.ListenerSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListListenersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListListeners{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListListeners{}, 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 = addOpListListenersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListListeners(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 +} + +// ListListenersAPIClient is a client that implements the ListListeners operation. +type ListListenersAPIClient interface { + ListListeners(context.Context, *ListListenersInput, ...func(*Options)) (*ListListenersOutput, error) +} + +var _ ListListenersAPIClient = (*Client)(nil) + +// ListListenersPaginatorOptions is the paginator options for ListListeners +type ListListenersPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListListenersPaginator is a paginator for ListListeners +type ListListenersPaginator struct { + options ListListenersPaginatorOptions + client ListListenersAPIClient + params *ListListenersInput + nextToken *string + firstPage bool +} + +// NewListListenersPaginator returns a new ListListenersPaginator +func NewListListenersPaginator(client ListListenersAPIClient, params *ListListenersInput, optFns ...func(*ListListenersPaginatorOptions)) *ListListenersPaginator { + if params == nil { + params = &ListListenersInput{} + } + + options := ListListenersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListListenersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListListenersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListListeners page. +func (p *ListListenersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListListenersOutput, 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.ListListeners(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_opListListeners(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListListeners", + } +} diff --git a/service/vpclattice/api_op_ListRules.go b/service/vpclattice/api_op_ListRules.go new file mode 100644 index 00000000000..d48f65a300a --- /dev/null +++ b/service/vpclattice/api_op_ListRules.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the rules for the listener. +func (c *Client) ListRules(ctx context.Context, params *ListRulesInput, optFns ...func(*Options)) (*ListRulesOutput, error) { + if params == nil { + params = &ListRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRules", params, optFns, c.addOperationListRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRulesInput struct { + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListRulesOutput struct { + + // Information about the rules. + // + // This member is required. + Items []types.RuleSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRules{}, 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 = addOpListRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRules(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 +} + +// ListRulesAPIClient is a client that implements the ListRules operation. +type ListRulesAPIClient interface { + ListRules(context.Context, *ListRulesInput, ...func(*Options)) (*ListRulesOutput, error) +} + +var _ ListRulesAPIClient = (*Client)(nil) + +// ListRulesPaginatorOptions is the paginator options for ListRules +type ListRulesPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListRulesPaginator is a paginator for ListRules +type ListRulesPaginator struct { + options ListRulesPaginatorOptions + client ListRulesAPIClient + params *ListRulesInput + nextToken *string + firstPage bool +} + +// NewListRulesPaginator returns a new ListRulesPaginator +func NewListRulesPaginator(client ListRulesAPIClient, params *ListRulesInput, optFns ...func(*ListRulesPaginatorOptions)) *ListRulesPaginator { + if params == nil { + params = &ListRulesInput{} + } + + options := ListRulesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRulesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRules page. +func (p *ListRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRulesOutput, 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.ListRules(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_opListRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListRules", + } +} diff --git a/service/vpclattice/api_op_ListServiceNetworkServiceAssociations.go b/service/vpclattice/api_op_ListServiceNetworkServiceAssociations.go new file mode 100644 index 00000000000..c62aa117afa --- /dev/null +++ b/service/vpclattice/api_op_ListServiceNetworkServiceAssociations.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the associations between the service network and the service. You can +// filter the list either by service or service network. You must provide either +// the service network identifier or the service identifier. Every association in +// Amazon VPC Lattice is given a unique Amazon Resource Name (ARN), such as when a +// service network is associated with a VPC or when a service is associated with a +// service network. If the association is for a resource that is shared with +// another account, the association will include the local account ID as the prefix +// in the ARN for each account the resource is shared with. +func (c *Client) ListServiceNetworkServiceAssociations(ctx context.Context, params *ListServiceNetworkServiceAssociationsInput, optFns ...func(*Options)) (*ListServiceNetworkServiceAssociationsOutput, error) { + if params == nil { + params = &ListServiceNetworkServiceAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListServiceNetworkServiceAssociations", params, optFns, c.addOperationListServiceNetworkServiceAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListServiceNetworkServiceAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListServiceNetworkServiceAssociationsInput struct { + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + // The ID or Amazon Resource Name (ARN) of the service. + ServiceIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service network. + ServiceNetworkIdentifier *string + + noSmithyDocumentSerde +} + +type ListServiceNetworkServiceAssociationsOutput struct { + + // Information about the associations. + // + // This member is required. + Items []types.ServiceNetworkServiceAssociationSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListServiceNetworkServiceAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListServiceNetworkServiceAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListServiceNetworkServiceAssociations{}, 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_opListServiceNetworkServiceAssociations(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 +} + +// ListServiceNetworkServiceAssociationsAPIClient is a client that implements the +// ListServiceNetworkServiceAssociations operation. +type ListServiceNetworkServiceAssociationsAPIClient interface { + ListServiceNetworkServiceAssociations(context.Context, *ListServiceNetworkServiceAssociationsInput, ...func(*Options)) (*ListServiceNetworkServiceAssociationsOutput, error) +} + +var _ ListServiceNetworkServiceAssociationsAPIClient = (*Client)(nil) + +// ListServiceNetworkServiceAssociationsPaginatorOptions is the paginator options +// for ListServiceNetworkServiceAssociations +type ListServiceNetworkServiceAssociationsPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListServiceNetworkServiceAssociationsPaginator is a paginator for +// ListServiceNetworkServiceAssociations +type ListServiceNetworkServiceAssociationsPaginator struct { + options ListServiceNetworkServiceAssociationsPaginatorOptions + client ListServiceNetworkServiceAssociationsAPIClient + params *ListServiceNetworkServiceAssociationsInput + nextToken *string + firstPage bool +} + +// NewListServiceNetworkServiceAssociationsPaginator returns a new +// ListServiceNetworkServiceAssociationsPaginator +func NewListServiceNetworkServiceAssociationsPaginator(client ListServiceNetworkServiceAssociationsAPIClient, params *ListServiceNetworkServiceAssociationsInput, optFns ...func(*ListServiceNetworkServiceAssociationsPaginatorOptions)) *ListServiceNetworkServiceAssociationsPaginator { + if params == nil { + params = &ListServiceNetworkServiceAssociationsInput{} + } + + options := ListServiceNetworkServiceAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListServiceNetworkServiceAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceNetworkServiceAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListServiceNetworkServiceAssociations page. +func (p *ListServiceNetworkServiceAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceNetworkServiceAssociationsOutput, 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.ListServiceNetworkServiceAssociations(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_opListServiceNetworkServiceAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListServiceNetworkServiceAssociations", + } +} diff --git a/service/vpclattice/api_op_ListServiceNetworkVpcAssociations.go b/service/vpclattice/api_op_ListServiceNetworkVpcAssociations.go new file mode 100644 index 00000000000..d544a66fc57 --- /dev/null +++ b/service/vpclattice/api_op_ListServiceNetworkVpcAssociations.go @@ -0,0 +1,227 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the service network and VPC associations. You can filter the list either +// by VPC or service network. You must provide either the service network +// identifier or the VPC identifier. +func (c *Client) ListServiceNetworkVpcAssociations(ctx context.Context, params *ListServiceNetworkVpcAssociationsInput, optFns ...func(*Options)) (*ListServiceNetworkVpcAssociationsOutput, error) { + if params == nil { + params = &ListServiceNetworkVpcAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListServiceNetworkVpcAssociations", params, optFns, c.addOperationListServiceNetworkVpcAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListServiceNetworkVpcAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListServiceNetworkVpcAssociationsInput struct { + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + // The ID or Amazon Resource Name (ARN) of the service network. + ServiceNetworkIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the VPC. + VpcIdentifier *string + + noSmithyDocumentSerde +} + +type ListServiceNetworkVpcAssociationsOutput struct { + + // Information about the associations. + // + // This member is required. + Items []types.ServiceNetworkVpcAssociationSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListServiceNetworkVpcAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListServiceNetworkVpcAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListServiceNetworkVpcAssociations{}, 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_opListServiceNetworkVpcAssociations(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 +} + +// ListServiceNetworkVpcAssociationsAPIClient is a client that implements the +// ListServiceNetworkVpcAssociations operation. +type ListServiceNetworkVpcAssociationsAPIClient interface { + ListServiceNetworkVpcAssociations(context.Context, *ListServiceNetworkVpcAssociationsInput, ...func(*Options)) (*ListServiceNetworkVpcAssociationsOutput, error) +} + +var _ ListServiceNetworkVpcAssociationsAPIClient = (*Client)(nil) + +// ListServiceNetworkVpcAssociationsPaginatorOptions is the paginator options for +// ListServiceNetworkVpcAssociations +type ListServiceNetworkVpcAssociationsPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListServiceNetworkVpcAssociationsPaginator is a paginator for +// ListServiceNetworkVpcAssociations +type ListServiceNetworkVpcAssociationsPaginator struct { + options ListServiceNetworkVpcAssociationsPaginatorOptions + client ListServiceNetworkVpcAssociationsAPIClient + params *ListServiceNetworkVpcAssociationsInput + nextToken *string + firstPage bool +} + +// NewListServiceNetworkVpcAssociationsPaginator returns a new +// ListServiceNetworkVpcAssociationsPaginator +func NewListServiceNetworkVpcAssociationsPaginator(client ListServiceNetworkVpcAssociationsAPIClient, params *ListServiceNetworkVpcAssociationsInput, optFns ...func(*ListServiceNetworkVpcAssociationsPaginatorOptions)) *ListServiceNetworkVpcAssociationsPaginator { + if params == nil { + params = &ListServiceNetworkVpcAssociationsInput{} + } + + options := ListServiceNetworkVpcAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListServiceNetworkVpcAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceNetworkVpcAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListServiceNetworkVpcAssociations page. +func (p *ListServiceNetworkVpcAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceNetworkVpcAssociationsOutput, 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.ListServiceNetworkVpcAssociations(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_opListServiceNetworkVpcAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListServiceNetworkVpcAssociations", + } +} diff --git a/service/vpclattice/api_op_ListServiceNetworks.go b/service/vpclattice/api_op_ListServiceNetworks.go new file mode 100644 index 00000000000..10d47bbb55f --- /dev/null +++ b/service/vpclattice/api_op_ListServiceNetworks.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the service networks owned by the caller account or shared with the caller +// account. Also includes the account ID in the ARN to show which account owns the +// service network. +func (c *Client) ListServiceNetworks(ctx context.Context, params *ListServiceNetworksInput, optFns ...func(*Options)) (*ListServiceNetworksOutput, error) { + if params == nil { + params = &ListServiceNetworksInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListServiceNetworks", params, optFns, c.addOperationListServiceNetworksMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListServiceNetworksOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListServiceNetworksInput struct { + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListServiceNetworksOutput struct { + + // Information about the service networks. + // + // This member is required. + Items []types.ServiceNetworkSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListServiceNetworksMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListServiceNetworks{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListServiceNetworks{}, 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_opListServiceNetworks(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 +} + +// ListServiceNetworksAPIClient is a client that implements the ListServiceNetworks +// operation. +type ListServiceNetworksAPIClient interface { + ListServiceNetworks(context.Context, *ListServiceNetworksInput, ...func(*Options)) (*ListServiceNetworksOutput, error) +} + +var _ ListServiceNetworksAPIClient = (*Client)(nil) + +// ListServiceNetworksPaginatorOptions is the paginator options for +// ListServiceNetworks +type ListServiceNetworksPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListServiceNetworksPaginator is a paginator for ListServiceNetworks +type ListServiceNetworksPaginator struct { + options ListServiceNetworksPaginatorOptions + client ListServiceNetworksAPIClient + params *ListServiceNetworksInput + nextToken *string + firstPage bool +} + +// NewListServiceNetworksPaginator returns a new ListServiceNetworksPaginator +func NewListServiceNetworksPaginator(client ListServiceNetworksAPIClient, params *ListServiceNetworksInput, optFns ...func(*ListServiceNetworksPaginatorOptions)) *ListServiceNetworksPaginator { + if params == nil { + params = &ListServiceNetworksInput{} + } + + options := ListServiceNetworksPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListServiceNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceNetworksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListServiceNetworks page. +func (p *ListServiceNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceNetworksOutput, 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.ListServiceNetworks(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_opListServiceNetworks(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListServiceNetworks", + } +} diff --git a/service/vpclattice/api_op_ListServices.go b/service/vpclattice/api_op_ListServices.go new file mode 100644 index 00000000000..5256b41b315 --- /dev/null +++ b/service/vpclattice/api_op_ListServices.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the services owned by the caller account or shared with the caller +// account. +func (c *Client) ListServices(ctx context.Context, params *ListServicesInput, optFns ...func(*Options)) (*ListServicesOutput, error) { + if params == nil { + params = &ListServicesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListServices", params, optFns, c.addOperationListServicesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListServicesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListServicesInput struct { + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListServicesOutput struct { + + // The services. + Items []types.ServiceSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListServicesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListServices{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListServices{}, 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_opListServices(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 +} + +// ListServicesAPIClient is a client that implements the ListServices operation. +type ListServicesAPIClient interface { + ListServices(context.Context, *ListServicesInput, ...func(*Options)) (*ListServicesOutput, error) +} + +var _ ListServicesAPIClient = (*Client)(nil) + +// ListServicesPaginatorOptions is the paginator options for ListServices +type ListServicesPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListServicesPaginator is a paginator for ListServices +type ListServicesPaginator struct { + options ListServicesPaginatorOptions + client ListServicesAPIClient + params *ListServicesInput + nextToken *string + firstPage bool +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + if params == nil { + params = &ListServicesInput{} + } + + options := ListServicesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListServices page. +func (p *ListServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesOutput, 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.ListServices(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_opListServices(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListServices", + } +} diff --git a/service/vpclattice/api_op_ListTagsForResource.go b/service/vpclattice/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..eb8818af627 --- /dev/null +++ b/service/vpclattice/api_op_ListTagsForResource.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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" +) + +// Lists the tags for the specified 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 Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The tags. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + 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: "vpc-lattice", + OperationName: "ListTagsForResource", + } +} diff --git a/service/vpclattice/api_op_ListTargetGroups.go b/service/vpclattice/api_op_ListTargetGroups.go new file mode 100644 index 00000000000..a3720743120 --- /dev/null +++ b/service/vpclattice/api_op_ListTargetGroups.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists your target groups. You can narrow your search by using the filters below +// in your request. +func (c *Client) ListTargetGroups(ctx context.Context, params *ListTargetGroupsInput, optFns ...func(*Options)) (*ListTargetGroupsOutput, error) { + if params == nil { + params = &ListTargetGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTargetGroups", params, optFns, c.addOperationListTargetGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTargetGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTargetGroupsInput struct { + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + // The target group type. + TargetGroupType types.TargetGroupType + + // The ID or Amazon Resource Name (ARN) of the service. + VpcIdentifier *string + + noSmithyDocumentSerde +} + +type ListTargetGroupsOutput struct { + + // Information about the target groups. + Items []types.TargetGroupSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTargetGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTargetGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTargetGroups{}, 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_opListTargetGroups(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 +} + +// ListTargetGroupsAPIClient is a client that implements the ListTargetGroups +// operation. +type ListTargetGroupsAPIClient interface { + ListTargetGroups(context.Context, *ListTargetGroupsInput, ...func(*Options)) (*ListTargetGroupsOutput, error) +} + +var _ ListTargetGroupsAPIClient = (*Client)(nil) + +// ListTargetGroupsPaginatorOptions is the paginator options for ListTargetGroups +type ListTargetGroupsPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListTargetGroupsPaginator is a paginator for ListTargetGroups +type ListTargetGroupsPaginator struct { + options ListTargetGroupsPaginatorOptions + client ListTargetGroupsAPIClient + params *ListTargetGroupsInput + nextToken *string + firstPage bool +} + +// NewListTargetGroupsPaginator returns a new ListTargetGroupsPaginator +func NewListTargetGroupsPaginator(client ListTargetGroupsAPIClient, params *ListTargetGroupsInput, optFns ...func(*ListTargetGroupsPaginatorOptions)) *ListTargetGroupsPaginator { + if params == nil { + params = &ListTargetGroupsInput{} + } + + options := ListTargetGroupsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTargetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTargetGroups page. +func (p *ListTargetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetGroupsOutput, 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.ListTargetGroups(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_opListTargetGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListTargetGroups", + } +} diff --git a/service/vpclattice/api_op_ListTargets.go b/service/vpclattice/api_op_ListTargets.go new file mode 100644 index 00000000000..09708a5920e --- /dev/null +++ b/service/vpclattice/api_op_ListTargets.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the targets for the target group. By default, all targets are included. +// You can use this API to check the health status of targets. You can also filter +// the results by target. +func (c *Client) ListTargets(ctx context.Context, params *ListTargetsInput, optFns ...func(*Options)) (*ListTargetsOutput, error) { + if params == nil { + params = &ListTargetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTargets", params, optFns, c.addOperationListTargetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTargetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTargetsInput struct { + + // The ID or Amazon Resource Name (ARN) of the target group. + // + // This member is required. + TargetGroupIdentifier *string + + // The maximum number of results to return. + MaxResults *int32 + + // A pagination token for the next page of results. + NextToken *string + + // The targets to list. + Targets []types.Target + + noSmithyDocumentSerde +} + +type ListTargetsOutput struct { + + // Information about the targets. + // + // This member is required. + Items []types.TargetSummary + + // If there are additional results, a pagination token for the next page of + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTargets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTargets{}, 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 = addOpListTargetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTargets(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 +} + +// ListTargetsAPIClient is a client that implements the ListTargets operation. +type ListTargetsAPIClient interface { + ListTargets(context.Context, *ListTargetsInput, ...func(*Options)) (*ListTargetsOutput, error) +} + +var _ ListTargetsAPIClient = (*Client)(nil) + +// ListTargetsPaginatorOptions is the paginator options for ListTargets +type ListTargetsPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListTargetsPaginator is a paginator for ListTargets +type ListTargetsPaginator struct { + options ListTargetsPaginatorOptions + client ListTargetsAPIClient + params *ListTargetsInput + nextToken *string + firstPage bool +} + +// NewListTargetsPaginator returns a new ListTargetsPaginator +func NewListTargetsPaginator(client ListTargetsAPIClient, params *ListTargetsInput, optFns ...func(*ListTargetsPaginatorOptions)) *ListTargetsPaginator { + if params == nil { + params = &ListTargetsInput{} + } + + options := ListTargetsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTargets page. +func (p *ListTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsOutput, 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.ListTargets(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_opListTargets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "ListTargets", + } +} diff --git a/service/vpclattice/api_op_PutAuthPolicy.go b/service/vpclattice/api_op_PutAuthPolicy.go new file mode 100644 index 00000000000..18db8c6c65b --- /dev/null +++ b/service/vpclattice/api_op_PutAuthPolicy.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates the auth policy. +func (c *Client) PutAuthPolicy(ctx context.Context, params *PutAuthPolicyInput, optFns ...func(*Options)) (*PutAuthPolicyOutput, error) { + if params == nil { + params = &PutAuthPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutAuthPolicy", params, optFns, c.addOperationPutAuthPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutAuthPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutAuthPolicyInput struct { + + // The auth policy. + // + // This member is required. + Policy *string + + // The ID or Amazon Resource Name (ARN) of the service network or service for which + // the policy is created. + // + // This member is required. + ResourceIdentifier *string + + noSmithyDocumentSerde +} + +type PutAuthPolicyOutput struct { + + // The auth policy. + Policy *string + + // The state of the auth policy. The auth policy is only active when the auth type + // is set to Amazon Web Services_IAM. If you provide a policy, then authentication + // and authorization decisions are made based on this policy and the client's IAM + // policy. If the Auth type is NONE, then, any auth policy you provide will remain + // inactive. For more information, see Create a service network + // (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html#create-service-network) + // in the Amazon VPC Lattice User Guide. + State types.AuthPolicyState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutAuthPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAuthPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAuthPolicy{}, 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 = addOpPutAuthPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAuthPolicy(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_opPutAuthPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "PutAuthPolicy", + } +} diff --git a/service/vpclattice/api_op_PutResourcePolicy.go b/service/vpclattice/api_op_PutResourcePolicy.go new file mode 100644 index 00000000000..e9d91bc6b5c --- /dev/null +++ b/service/vpclattice/api_op_PutResourcePolicy.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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" +) + +// Attaches a resource-based permission policy to a service or service network. The +// policy must contain the same actions and condition statements as the Amazon Web +// Services Resource Access Manager permission for sharing services and service +// networks. +func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { + if params == nil { + params = &PutResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutResourcePolicyInput struct { + + // An IAM policy. + // + // This member is required. + Policy *string + + // The ID or Amazon Resource Name (ARN) of the service network or service for which + // the policy is created. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type PutResourcePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutResourcePolicy{}, 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 = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(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_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "PutResourcePolicy", + } +} diff --git a/service/vpclattice/api_op_RegisterTargets.go b/service/vpclattice/api_op_RegisterTargets.go new file mode 100644 index 00000000000..eaf26dee9a2 --- /dev/null +++ b/service/vpclattice/api_op_RegisterTargets.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Registers the targets with the target group. If it's a Lambda target, you can +// only have one target in a target group. +func (c *Client) RegisterTargets(ctx context.Context, params *RegisterTargetsInput, optFns ...func(*Options)) (*RegisterTargetsOutput, error) { + if params == nil { + params = &RegisterTargetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterTargets", params, optFns, c.addOperationRegisterTargetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterTargetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterTargetsInput struct { + + // The ID or Amazon Resource Name (ARN) of the target group. + // + // This member is required. + TargetGroupIdentifier *string + + // The targets. + // + // This member is required. + Targets []types.Target + + noSmithyDocumentSerde +} + +type RegisterTargetsOutput struct { + + // The targets that were successfully registered. + Successful []types.Target + + // The targets that were not registered. + Unsuccessful []types.TargetFailure + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterTargets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterTargets{}, 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 = addOpRegisterTargetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterTargets(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_opRegisterTargets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "RegisterTargets", + } +} diff --git a/service/vpclattice/api_op_TagResource.go b/service/vpclattice/api_op_TagResource.go new file mode 100644 index 00000000000..5eeae3acb12 --- /dev/null +++ b/service/vpclattice/api_op_TagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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" +) + +// Adds the specified tags to the specified resource. +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 resource. + // + // This member is required. + ResourceArn *string + + // The tags for the resource. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + 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: "vpc-lattice", + OperationName: "TagResource", + } +} diff --git a/service/vpclattice/api_op_UntagResource.go b/service/vpclattice/api_op_UntagResource.go new file mode 100644 index 00000000000..bcce291d85f --- /dev/null +++ b/service/vpclattice/api_op_UntagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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 the specified tags from the specified resource. +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 resource. + // + // This member is required. + ResourceArn *string + + // The tag keys of the tags to remove. + // + // 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: "vpc-lattice", + OperationName: "UntagResource", + } +} diff --git a/service/vpclattice/api_op_UpdateAccessLogSubscription.go b/service/vpclattice/api_op_UpdateAccessLogSubscription.go new file mode 100644 index 00000000000..a2c0eca82b8 --- /dev/null +++ b/service/vpclattice/api_op_UpdateAccessLogSubscription.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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" +) + +// Updates the specified access log subscription. +func (c *Client) UpdateAccessLogSubscription(ctx context.Context, params *UpdateAccessLogSubscriptionInput, optFns ...func(*Options)) (*UpdateAccessLogSubscriptionOutput, error) { + if params == nil { + params = &UpdateAccessLogSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAccessLogSubscription", params, optFns, c.addOperationUpdateAccessLogSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAccessLogSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAccessLogSubscriptionInput struct { + + // The ID or Amazon Resource Name (ARN) of the access log subscription. + // + // This member is required. + AccessLogSubscriptionIdentifier *string + + // The Amazon Resource Name (ARN) of the access log destination. + // + // This member is required. + DestinationArn *string + + noSmithyDocumentSerde +} + +type UpdateAccessLogSubscriptionOutput struct { + + // The Amazon Resource Name (ARN) of the access log subscription. + // + // This member is required. + Arn *string + + // The Amazon Resource Name (ARN) of the access log destination. + // + // This member is required. + DestinationArn *string + + // The ID of the access log subscription. + // + // This member is required. + Id *string + + // The Amazon Resource Name (ARN) of the access log subscription. + // + // This member is required. + ResourceArn *string + + // The ID of the resource. + // + // This member is required. + ResourceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAccessLogSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAccessLogSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAccessLogSubscription{}, 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 = addOpUpdateAccessLogSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccessLogSubscription(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_opUpdateAccessLogSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "UpdateAccessLogSubscription", + } +} diff --git a/service/vpclattice/api_op_UpdateListener.go b/service/vpclattice/api_op_UpdateListener.go new file mode 100644 index 00000000000..056abeab1d3 --- /dev/null +++ b/service/vpclattice/api_op_UpdateListener.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the specified listener for the specified service. +func (c *Client) UpdateListener(ctx context.Context, params *UpdateListenerInput, optFns ...func(*Options)) (*UpdateListenerOutput, error) { + if params == nil { + params = &UpdateListenerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateListener", params, optFns, c.addOperationUpdateListenerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateListenerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateListenerInput struct { + + // The action for the default rule. + // + // This member is required. + DefaultAction types.RuleAction + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + noSmithyDocumentSerde +} + +type UpdateListenerOutput struct { + + // The Amazon Resource Name (ARN) of the listener. + Arn *string + + // The action for the default rule. + DefaultAction types.RuleAction + + // The ID of the listener. + Id *string + + // The name of the listener. + Name *string + + // The listener port. + Port *int32 + + // The protocol of the listener. + Protocol types.ListenerProtocol + + // The Amazon Resource Name (ARN) of the service. + ServiceArn *string + + // The ID of the service. + ServiceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateListenerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateListener{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateListener{}, 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 = addOpUpdateListenerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateListener(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_opUpdateListener(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "UpdateListener", + } +} diff --git a/service/vpclattice/api_op_UpdateRule.go b/service/vpclattice/api_op_UpdateRule.go new file mode 100644 index 00000000000..3e097ee00d5 --- /dev/null +++ b/service/vpclattice/api_op_UpdateRule.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a rule for the listener. You can't modify a default listener rule. To +// modify a default listener rule, use UpdateListener. +func (c *Client) UpdateRule(ctx context.Context, params *UpdateRuleInput, optFns ...func(*Options)) (*UpdateRuleOutput, error) { + if params == nil { + params = &UpdateRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRule", params, optFns, c.addOperationUpdateRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRuleInput struct { + + // The ID or Amazon Resource Name (ARN) of the listener. + // + // This member is required. + ListenerIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the rule. + // + // This member is required. + RuleIdentifier *string + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + // Information about the action for the specified listener rule. + Action types.RuleAction + + // The rule match. + Match types.RuleMatch + + // The rule priority. A listener can't have multiple rules with the same priority. + Priority *int32 + + noSmithyDocumentSerde +} + +type UpdateRuleOutput struct { + + // Information about the action for the specified listener rule. + Action types.RuleAction + + // The Amazon Resource Name (ARN) of the listener. + Arn *string + + // The ID of the listener. + Id *string + + // Indicates whether this is the default rule. + IsDefault *bool + + // The rule match. + Match types.RuleMatch + + // The name of the listener. + Name *string + + // The rule priority. + Priority *int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRule{}, 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 = addOpUpdateRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRule(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_opUpdateRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "UpdateRule", + } +} diff --git a/service/vpclattice/api_op_UpdateService.go b/service/vpclattice/api_op_UpdateService.go new file mode 100644 index 00000000000..191aee42485 --- /dev/null +++ b/service/vpclattice/api_op_UpdateService.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the specified service. +func (c *Client) UpdateService(ctx context.Context, params *UpdateServiceInput, optFns ...func(*Options)) (*UpdateServiceOutput, error) { + if params == nil { + params = &UpdateServiceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateService", params, optFns, c.addOperationUpdateServiceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateServiceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateServiceInput struct { + + // The ID or Amazon Resource Name (ARN) of the service. + // + // This member is required. + ServiceIdentifier *string + + // The type of IAM policy. + // + // * NONE: The resource does not use an IAM policy. This + // is the default. + // + // * AWS_IAM: The resource uses an IAM policy. When this type is + // used, auth is enabled and an auth policy is required. + AuthType types.AuthType + + // The Amazon Resource Name (ARN) of the certificate. + CertificateArn *string + + noSmithyDocumentSerde +} + +type UpdateServiceOutput struct { + + // The Amazon Resource Name (ARN) of the service. + Arn *string + + // The type of IAM policy. + AuthType types.AuthType + + // The Amazon Resource Name (ARN) of the certificate. + CertificateArn *string + + // The custom domain name of the service. + CustomDomainName *string + + // The ID of the service. + Id *string + + // The name of the service. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateServiceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateService{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateService{}, 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 = addOpUpdateServiceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateService(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_opUpdateService(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "UpdateService", + } +} diff --git a/service/vpclattice/api_op_UpdateServiceNetwork.go b/service/vpclattice/api_op_UpdateServiceNetwork.go new file mode 100644 index 00000000000..fa2a0526f97 --- /dev/null +++ b/service/vpclattice/api_op_UpdateServiceNetwork.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the specified service network. +func (c *Client) UpdateServiceNetwork(ctx context.Context, params *UpdateServiceNetworkInput, optFns ...func(*Options)) (*UpdateServiceNetworkOutput, error) { + if params == nil { + params = &UpdateServiceNetworkInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateServiceNetwork", params, optFns, c.addOperationUpdateServiceNetworkMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateServiceNetworkOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateServiceNetworkInput struct { + + // The type of IAM policy. + // + // * NONE: The resource does not use an IAM policy. This + // is the default. + // + // * AWS_IAM: The resource uses an IAM policy. When this type is + // used, auth is enabled and an auth policy is required. + // + // This member is required. + AuthType types.AuthType + + // The ID or Amazon Resource Name (ARN) of the service network. + // + // This member is required. + ServiceNetworkIdentifier *string + + noSmithyDocumentSerde +} + +type UpdateServiceNetworkOutput struct { + + // The Amazon Resource Name (ARN) of the service network. + Arn *string + + // The type of IAM policy. + AuthType types.AuthType + + // The ID of the service network. + Id *string + + // The name of the service network. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateServiceNetworkMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateServiceNetwork{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateServiceNetwork{}, 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 = addOpUpdateServiceNetworkValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServiceNetwork(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_opUpdateServiceNetwork(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "UpdateServiceNetwork", + } +} diff --git a/service/vpclattice/api_op_UpdateServiceNetworkVpcAssociation.go b/service/vpclattice/api_op_UpdateServiceNetworkVpcAssociation.go new file mode 100644 index 00000000000..a72ae568caf --- /dev/null +++ b/service/vpclattice/api_op_UpdateServiceNetworkVpcAssociation.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the service network and VPC association. Once you add a security group, +// it cannot be removed. +func (c *Client) UpdateServiceNetworkVpcAssociation(ctx context.Context, params *UpdateServiceNetworkVpcAssociationInput, optFns ...func(*Options)) (*UpdateServiceNetworkVpcAssociationOutput, error) { + if params == nil { + params = &UpdateServiceNetworkVpcAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateServiceNetworkVpcAssociation", params, optFns, c.addOperationUpdateServiceNetworkVpcAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateServiceNetworkVpcAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateServiceNetworkVpcAssociationInput struct { + + // The IDs of the security groups. Once you add a security group, it cannot be + // removed. + // + // This member is required. + SecurityGroupIds []string + + // The ID or Amazon Resource Name (ARN) of the association. + // + // This member is required. + ServiceNetworkVpcAssociationIdentifier *string + + noSmithyDocumentSerde +} + +type UpdateServiceNetworkVpcAssociationOutput struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The account that created the association. + CreatedBy *string + + // The ID of the association. + Id *string + + // The IDs of the security groups. + SecurityGroupIds []string + + // The status. You can retry the operation if the status is DELETE_FAILED. However, + // if you retry it while the status is DELETE_IN_PROGRESS, there is no change in + // the status. + Status types.ServiceNetworkVpcAssociationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateServiceNetworkVpcAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateServiceNetworkVpcAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateServiceNetworkVpcAssociation{}, 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 = addOpUpdateServiceNetworkVpcAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServiceNetworkVpcAssociation(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_opUpdateServiceNetworkVpcAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "UpdateServiceNetworkVpcAssociation", + } +} diff --git a/service/vpclattice/api_op_UpdateTargetGroup.go b/service/vpclattice/api_op_UpdateTargetGroup.go new file mode 100644 index 00000000000..4e14beaab5b --- /dev/null +++ b/service/vpclattice/api_op_UpdateTargetGroup.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the specified target group. +func (c *Client) UpdateTargetGroup(ctx context.Context, params *UpdateTargetGroupInput, optFns ...func(*Options)) (*UpdateTargetGroupOutput, error) { + if params == nil { + params = &UpdateTargetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateTargetGroup", params, optFns, c.addOperationUpdateTargetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateTargetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateTargetGroupInput struct { + + // The health check configuration. + // + // This member is required. + HealthCheck *types.HealthCheckConfig + + // The ID or Amazon Resource Name (ARN) of the target group. + // + // This member is required. + TargetGroupIdentifier *string + + noSmithyDocumentSerde +} + +type UpdateTargetGroupOutput struct { + + // The Amazon Resource Name (ARN) of the target group. + Arn *string + + // The target group configuration. + Config *types.TargetGroupConfig + + // The ID of the target group. + Id *string + + // The name of the target group. + Name *string + + // The status. + Status types.TargetGroupStatus + + // The target group type. + Type types.TargetGroupType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateTargetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateTargetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateTargetGroup{}, 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 = addOpUpdateTargetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTargetGroup(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_opUpdateTargetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "vpc-lattice", + OperationName: "UpdateTargetGroup", + } +} diff --git a/service/vpclattice/deserializers.go b/service/vpclattice/deserializers.go new file mode 100644 index 00000000000..4adfaf55599 --- /dev/null +++ b/service/vpclattice/deserializers.go @@ -0,0 +1,12985 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/vpclattice/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" + "strconv" + "strings" +) + +type awsRestjson1_deserializeOpBatchUpdateRule struct { +} + +func (*awsRestjson1_deserializeOpBatchUpdateRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchUpdateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorBatchUpdateRule(response, &metadata) + } + output := &BatchUpdateRuleOutput{} + 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_deserializeOpDocumentBatchUpdateRuleOutput(&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_deserializeOpErrorBatchUpdateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchUpdateRuleOutput(v **BatchUpdateRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchUpdateRuleOutput + if *v == nil { + sv = &BatchUpdateRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "successful": + if err := awsRestjson1_deserializeDocumentRuleUpdateSuccessList(&sv.Successful, value); err != nil { + return err + } + + case "unsuccessful": + if err := awsRestjson1_deserializeDocumentRuleUpdateFailureList(&sv.Unsuccessful, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateAccessLogSubscription struct { +} + +func (*awsRestjson1_deserializeOpCreateAccessLogSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateAccessLogSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateAccessLogSubscription(response, &metadata) + } + output := &CreateAccessLogSubscriptionOutput{} + 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_deserializeOpDocumentCreateAccessLogSubscriptionOutput(&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_deserializeOpErrorCreateAccessLogSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateAccessLogSubscriptionOutput(v **CreateAccessLogSubscriptionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateAccessLogSubscriptionOutput + if *v == nil { + sv = &CreateAccessLogSubscriptionOutput{} + } 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 AccessLogSubscriptionArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "destinationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogDestinationArn to be of type string, got %T instead", value) + } + sv.DestinationArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogSubscriptionId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateListener struct { +} + +func (*awsRestjson1_deserializeOpCreateListener) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateListener(response, &metadata) + } + output := &CreateListenerOutput{} + 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_deserializeOpDocumentCreateListenerOutput(&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_deserializeOpErrorCreateListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateListenerOutput(v **CreateListenerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateListenerOutput + if *v == nil { + sv = &CreateListenerOutput{} + } 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 ListenerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "defaultAction": + if err := awsRestjson1_deserializeDocumentRuleAction(&sv.DefaultAction, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.ListenerProtocol(jtv) + } + + case "serviceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceArn to be of type string, got %T instead", value) + } + sv.ServiceArn = ptr.String(jtv) + } + + case "serviceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.ServiceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateRule struct { +} + +func (*awsRestjson1_deserializeOpCreateRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateRule(response, &metadata) + } + output := &CreateRuleOutput{} + 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_deserializeOpDocumentCreateRuleOutput(&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_deserializeOpErrorCreateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateRuleOutput(v **CreateRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateRuleOutput + if *v == nil { + sv = &CreateRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if err := awsRestjson1_deserializeDocumentRuleAction(&sv.Action, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "match": + if err := awsRestjson1_deserializeDocumentRuleMatch(&sv.Match, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateService struct { +} + +func (*awsRestjson1_deserializeOpCreateService) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateService) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateService(response, &metadata) + } + output := &CreateServiceOutput{} + 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_deserializeOpDocumentCreateServiceOutput(&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_deserializeOpErrorCreateService(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateServiceOutput(v **CreateServiceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateServiceOutput + if *v == nil { + sv = &CreateServiceOutput{} + } 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 ServiceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "authType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthType to be of type string, got %T instead", value) + } + sv.AuthType = types.AuthType(jtv) + } + + case "certificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + } + sv.CertificateArn = ptr.String(jtv) + } + + case "customDomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCustomDomainName to be of type string, got %T instead", value) + } + sv.CustomDomainName = ptr.String(jtv) + } + + case "dnsEntry": + if err := awsRestjson1_deserializeDocumentDnsEntry(&sv.DnsEntry, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateServiceNetwork struct { +} + +func (*awsRestjson1_deserializeOpCreateServiceNetwork) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateServiceNetwork) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateServiceNetwork(response, &metadata) + } + output := &CreateServiceNetworkOutput{} + 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_deserializeOpDocumentCreateServiceNetworkOutput(&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_deserializeOpErrorCreateServiceNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateServiceNetworkOutput(v **CreateServiceNetworkOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateServiceNetworkOutput + if *v == nil { + sv = &CreateServiceNetworkOutput{} + } 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 ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "authType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthType to be of type string, got %T instead", value) + } + sv.AuthType = types.AuthType(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateServiceNetworkServiceAssociation struct { +} + +func (*awsRestjson1_deserializeOpCreateServiceNetworkServiceAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateServiceNetworkServiceAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateServiceNetworkServiceAssociation(response, &metadata) + } + output := &CreateServiceNetworkServiceAssociationOutput{} + 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_deserializeOpDocumentCreateServiceNetworkServiceAssociationOutput(&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_deserializeOpErrorCreateServiceNetworkServiceAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateServiceNetworkServiceAssociationOutput(v **CreateServiceNetworkServiceAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateServiceNetworkServiceAssociationOutput + if *v == nil { + sv = &CreateServiceNetworkServiceAssociationOutput{} + } 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 ServiceNetworkServiceAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "customDomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCustomDomainName to be of type string, got %T instead", value) + } + sv.CustomDomainName = ptr.String(jtv) + } + + case "dnsEntry": + if err := awsRestjson1_deserializeDocumentDnsEntry(&sv.DnsEntry, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationIdentifier to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkServiceAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_deserializeOpCreateServiceNetworkVpcAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateServiceNetworkVpcAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateServiceNetworkVpcAssociation(response, &metadata) + } + output := &CreateServiceNetworkVpcAssociationOutput{} + 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_deserializeOpDocumentCreateServiceNetworkVpcAssociationOutput(&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_deserializeOpErrorCreateServiceNetworkVpcAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateServiceNetworkVpcAssociationOutput(v **CreateServiceNetworkVpcAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateServiceNetworkVpcAssociationOutput + if *v == nil { + sv = &CreateServiceNetworkVpcAssociationOutput{} + } 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 ServiceNetworkVpcAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "securityGroupIds": + if err := awsRestjson1_deserializeDocumentSecurityGroupList(&sv.SecurityGroupIds, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkVpcAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateTargetGroup struct { +} + +func (*awsRestjson1_deserializeOpCreateTargetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorCreateTargetGroup(response, &metadata) + } + output := &CreateTargetGroupOutput{} + 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_deserializeOpDocumentCreateTargetGroupOutput(&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_deserializeOpErrorCreateTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateTargetGroupOutput(v **CreateTargetGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateTargetGroupOutput + if *v == nil { + sv = &CreateTargetGroupOutput{} + } 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 TargetGroupArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "config": + if err := awsRestjson1_deserializeDocumentTargetGroupConfig(&sv.Config, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupStatus to be of type string, got %T instead", value) + } + sv.Status = types.TargetGroupStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupType to be of type string, got %T instead", value) + } + sv.Type = types.TargetGroupType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteAccessLogSubscription struct { +} + +func (*awsRestjson1_deserializeOpDeleteAccessLogSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteAccessLogSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteAccessLogSubscription(response, &metadata) + } + output := &DeleteAccessLogSubscriptionOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteAccessLogSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteAuthPolicy struct { +} + +func (*awsRestjson1_deserializeOpDeleteAuthPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteAuthPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteAuthPolicy(response, &metadata) + } + output := &DeleteAuthPolicyOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteAuthPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteListener struct { +} + +func (*awsRestjson1_deserializeOpDeleteListener) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteListener(response, &metadata) + } + output := &DeleteListenerOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteResourcePolicy struct { +} + +func (*awsRestjson1_deserializeOpDeleteResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteResourcePolicy(response, &metadata) + } + output := &DeleteResourcePolicyOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteRule struct { +} + +func (*awsRestjson1_deserializeOpDeleteRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteRule(response, &metadata) + } + output := &DeleteRuleOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteService struct { +} + +func (*awsRestjson1_deserializeOpDeleteService) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteService) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteService(response, &metadata) + } + output := &DeleteServiceOutput{} + 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_deserializeOpDocumentDeleteServiceOutput(&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_deserializeOpErrorDeleteService(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteServiceOutput(v **DeleteServiceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteServiceOutput + if *v == nil { + sv = &DeleteServiceOutput{} + } 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 ServiceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteServiceNetwork struct { +} + +func (*awsRestjson1_deserializeOpDeleteServiceNetwork) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteServiceNetwork) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteServiceNetwork(response, &metadata) + } + output := &DeleteServiceNetworkOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteServiceNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteServiceNetworkServiceAssociation struct { +} + +func (*awsRestjson1_deserializeOpDeleteServiceNetworkServiceAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteServiceNetworkServiceAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteServiceNetworkServiceAssociation(response, &metadata) + } + output := &DeleteServiceNetworkServiceAssociationOutput{} + 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_deserializeOpDocumentDeleteServiceNetworkServiceAssociationOutput(&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_deserializeOpErrorDeleteServiceNetworkServiceAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteServiceNetworkServiceAssociationOutput(v **DeleteServiceNetworkServiceAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteServiceNetworkServiceAssociationOutput + if *v == nil { + sv = &DeleteServiceNetworkServiceAssociationOutput{} + } 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 ServiceNetworkServiceAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationIdentifier to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkServiceAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_deserializeOpDeleteServiceNetworkVpcAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteServiceNetworkVpcAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteServiceNetworkVpcAssociation(response, &metadata) + } + output := &DeleteServiceNetworkVpcAssociationOutput{} + 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_deserializeOpDocumentDeleteServiceNetworkVpcAssociationOutput(&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_deserializeOpErrorDeleteServiceNetworkVpcAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteServiceNetworkVpcAssociationOutput(v **DeleteServiceNetworkVpcAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteServiceNetworkVpcAssociationOutput + if *v == nil { + sv = &DeleteServiceNetworkVpcAssociationOutput{} + } 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 ServiceNetworkVpcAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkVpcAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteTargetGroup struct { +} + +func (*awsRestjson1_deserializeOpDeleteTargetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeleteTargetGroup(response, &metadata) + } + output := &DeleteTargetGroupOutput{} + 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_deserializeOpDocumentDeleteTargetGroupOutput(&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_deserializeOpErrorDeleteTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentDeleteTargetGroupOutput(v **DeleteTargetGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteTargetGroupOutput + if *v == nil { + sv = &DeleteTargetGroupOutput{} + } 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 TargetGroupArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupStatus to be of type string, got %T instead", value) + } + sv.Status = types.TargetGroupStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeregisterTargets struct { +} + +func (*awsRestjson1_deserializeOpDeregisterTargets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeregisterTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorDeregisterTargets(response, &metadata) + } + output := &DeregisterTargetsOutput{} + 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_deserializeOpDocumentDeregisterTargetsOutput(&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_deserializeOpErrorDeregisterTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeregisterTargetsOutput(v **DeregisterTargetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeregisterTargetsOutput + if *v == nil { + sv = &DeregisterTargetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "successful": + if err := awsRestjson1_deserializeDocumentTargetList(&sv.Successful, value); err != nil { + return err + } + + case "unsuccessful": + if err := awsRestjson1_deserializeDocumentTargetFailureList(&sv.Unsuccessful, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetAccessLogSubscription struct { +} + +func (*awsRestjson1_deserializeOpGetAccessLogSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAccessLogSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetAccessLogSubscription(response, &metadata) + } + output := &GetAccessLogSubscriptionOutput{} + 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_deserializeOpDocumentGetAccessLogSubscriptionOutput(&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_deserializeOpErrorGetAccessLogSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetAccessLogSubscriptionOutput(v **GetAccessLogSubscriptionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAccessLogSubscriptionOutput + if *v == nil { + sv = &GetAccessLogSubscriptionOutput{} + } 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 AccessLogSubscriptionArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "destinationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogDestinationArn to be of type string, got %T instead", value) + } + sv.DestinationArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogSubscriptionId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetAuthPolicy struct { +} + +func (*awsRestjson1_deserializeOpGetAuthPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAuthPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetAuthPolicy(response, &metadata) + } + output := &GetAuthPolicyOutput{} + 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_deserializeOpDocumentGetAuthPolicyOutput(&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_deserializeOpErrorGetAuthPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetAuthPolicyOutput(v **GetAuthPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAuthPolicyOutput + if *v == nil { + sv = &GetAuthPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthPolicyString to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthPolicyState to be of type string, got %T instead", value) + } + sv.State = types.AuthPolicyState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetListener struct { +} + +func (*awsRestjson1_deserializeOpGetListener) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetListener(response, &metadata) + } + output := &GetListenerOutput{} + 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_deserializeOpDocumentGetListenerOutput(&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_deserializeOpErrorGetListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetListenerOutput(v **GetListenerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetListenerOutput + if *v == nil { + sv = &GetListenerOutput{} + } 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 ListenerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "defaultAction": + if err := awsRestjson1_deserializeDocumentRuleAction(&sv.DefaultAction, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.ListenerProtocol(jtv) + } + + case "serviceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceArn to be of type string, got %T instead", value) + } + sv.ServiceArn = ptr.String(jtv) + } + + case "serviceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.ServiceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetResourcePolicy struct { +} + +func (*awsRestjson1_deserializeOpGetResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetResourcePolicy(response, &metadata) + } + output := &GetResourcePolicyOutput{} + 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_deserializeOpDocumentGetResourcePolicyOutput(&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_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetResourcePolicyOutput + if *v == nil { + sv = &GetResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyString to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetRule struct { +} + +func (*awsRestjson1_deserializeOpGetRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetRule(response, &metadata) + } + output := &GetRuleOutput{} + 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_deserializeOpDocumentGetRuleOutput(&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_deserializeOpErrorGetRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetRuleOutput(v **GetRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetRuleOutput + if *v == nil { + sv = &GetRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if err := awsRestjson1_deserializeDocumentRuleAction(&sv.Action, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "isDefault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsDefault = ptr.Bool(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "match": + if err := awsRestjson1_deserializeDocumentRuleMatch(&sv.Match, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetService struct { +} + +func (*awsRestjson1_deserializeOpGetService) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetService) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetService(response, &metadata) + } + output := &GetServiceOutput{} + 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_deserializeOpDocumentGetServiceOutput(&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_deserializeOpErrorGetService(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetServiceOutput(v **GetServiceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetServiceOutput + if *v == nil { + sv = &GetServiceOutput{} + } 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 ServiceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "authType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthType to be of type string, got %T instead", value) + } + sv.AuthType = types.AuthType(jtv) + } + + case "certificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + } + sv.CertificateArn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customDomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCustomDomainName to be of type string, got %T instead", value) + } + sv.CustomDomainName = ptr.String(jtv) + } + + case "dnsEntry": + if err := awsRestjson1_deserializeDocumentDnsEntry(&sv.DnsEntry, value); err != nil { + return err + } + + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value) + } + sv.FailureCode = ptr.String(jtv) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureMessage to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetServiceNetwork struct { +} + +func (*awsRestjson1_deserializeOpGetServiceNetwork) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetServiceNetwork) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetServiceNetwork(response, &metadata) + } + output := &GetServiceNetworkOutput{} + 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_deserializeOpDocumentGetServiceNetworkOutput(&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_deserializeOpErrorGetServiceNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetServiceNetworkOutput(v **GetServiceNetworkOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetServiceNetworkOutput + if *v == nil { + sv = &GetServiceNetworkOutput{} + } 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 ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "authType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthType to be of type string, got %T instead", value) + } + sv.AuthType = types.AuthType(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "numberOfAssociatedServices": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfAssociatedServices = ptr.Int64(i64) + } + + case "numberOfAssociatedVPCs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfAssociatedVPCs = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetServiceNetworkServiceAssociation struct { +} + +func (*awsRestjson1_deserializeOpGetServiceNetworkServiceAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetServiceNetworkServiceAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetServiceNetworkServiceAssociation(response, &metadata) + } + output := &GetServiceNetworkServiceAssociationOutput{} + 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_deserializeOpDocumentGetServiceNetworkServiceAssociationOutput(&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_deserializeOpErrorGetServiceNetworkServiceAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetServiceNetworkServiceAssociationOutput(v **GetServiceNetworkServiceAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetServiceNetworkServiceAssociationOutput + if *v == nil { + sv = &GetServiceNetworkServiceAssociationOutput{} + } 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 ServiceNetworkServiceAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "customDomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCustomDomainName to be of type string, got %T instead", value) + } + sv.CustomDomainName = ptr.String(jtv) + } + + case "dnsEntry": + if err := awsRestjson1_deserializeDocumentDnsEntry(&sv.DnsEntry, value); err != nil { + return err + } + + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureCode = ptr.String(jtv) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationIdentifier to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "serviceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceArn to be of type string, got %T instead", value) + } + sv.ServiceArn = ptr.String(jtv) + } + + case "serviceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.ServiceId = ptr.String(jtv) + } + + case "serviceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value) + } + sv.ServiceName = ptr.String(jtv) + } + + case "serviceNetworkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.ServiceNetworkArn = ptr.String(jtv) + } + + case "serviceNetworkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.ServiceNetworkId = ptr.String(jtv) + } + + case "serviceNetworkName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.ServiceNetworkName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkServiceAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_deserializeOpGetServiceNetworkVpcAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetServiceNetworkVpcAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetServiceNetworkVpcAssociation(response, &metadata) + } + output := &GetServiceNetworkVpcAssociationOutput{} + 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_deserializeOpDocumentGetServiceNetworkVpcAssociationOutput(&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_deserializeOpErrorGetServiceNetworkVpcAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetServiceNetworkVpcAssociationOutput(v **GetServiceNetworkVpcAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetServiceNetworkVpcAssociationOutput + if *v == nil { + sv = &GetServiceNetworkVpcAssociationOutput{} + } 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 ServiceNetworkVpcAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureCode = ptr.String(jtv) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "securityGroupIds": + if err := awsRestjson1_deserializeDocumentSecurityGroupList(&sv.SecurityGroupIds, value); err != nil { + return err + } + + case "serviceNetworkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.ServiceNetworkArn = ptr.String(jtv) + } + + case "serviceNetworkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.ServiceNetworkId = ptr.String(jtv) + } + + case "serviceNetworkName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.ServiceNetworkName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkVpcAssociationStatus(jtv) + } + + case "vpcId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) + } + sv.VpcId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetTargetGroup struct { +} + +func (*awsRestjson1_deserializeOpGetTargetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetTargetGroup(response, &metadata) + } + output := &GetTargetGroupOutput{} + 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_deserializeOpDocumentGetTargetGroupOutput(&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_deserializeOpErrorGetTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetTargetGroupOutput(v **GetTargetGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTargetGroupOutput + if *v == nil { + sv = &GetTargetGroupOutput{} + } 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 TargetGroupArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "config": + if err := awsRestjson1_deserializeDocumentTargetGroupConfig(&sv.Config, value); err != nil { + return err + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureCode = ptr.String(jtv) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "serviceArns": + if err := awsRestjson1_deserializeDocumentServiceArnList(&sv.ServiceArns, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupStatus to be of type string, got %T instead", value) + } + sv.Status = types.TargetGroupStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupType to be of type string, got %T instead", value) + } + sv.Type = types.TargetGroupType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAccessLogSubscriptions struct { +} + +func (*awsRestjson1_deserializeOpListAccessLogSubscriptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAccessLogSubscriptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListAccessLogSubscriptions(response, &metadata) + } + output := &ListAccessLogSubscriptionsOutput{} + 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_deserializeOpDocumentListAccessLogSubscriptionsOutput(&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_deserializeOpErrorListAccessLogSubscriptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentListAccessLogSubscriptionsOutput(v **ListAccessLogSubscriptionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListAccessLogSubscriptionsOutput + if *v == nil { + sv = &ListAccessLogSubscriptionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentAccessLogSubscriptionList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListListeners struct { +} + +func (*awsRestjson1_deserializeOpListListeners) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListListeners(response, &metadata) + } + output := &ListListenersOutput{} + 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_deserializeOpDocumentListListenersOutput(&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_deserializeOpErrorListListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListListenersOutput(v **ListListenersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListListenersOutput + if *v == nil { + sv = &ListListenersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentListenerSummaryList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRules struct { +} + +func (*awsRestjson1_deserializeOpListRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListRules(response, &metadata) + } + output := &ListRulesOutput{} + 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_deserializeOpDocumentListRulesOutput(&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_deserializeOpErrorListRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListRulesOutput + if *v == nil { + sv = &ListRulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentRuleSummaryList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListServiceNetworks struct { +} + +func (*awsRestjson1_deserializeOpListServiceNetworks) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListServiceNetworks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListServiceNetworks(response, &metadata) + } + output := &ListServiceNetworksOutput{} + 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_deserializeOpDocumentListServiceNetworksOutput(&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_deserializeOpErrorListServiceNetworks(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListServiceNetworksOutput(v **ListServiceNetworksOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListServiceNetworksOutput + if *v == nil { + sv = &ListServiceNetworksOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentServiceNetworkList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListServiceNetworkServiceAssociations struct { +} + +func (*awsRestjson1_deserializeOpListServiceNetworkServiceAssociations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListServiceNetworkServiceAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListServiceNetworkServiceAssociations(response, &metadata) + } + output := &ListServiceNetworkServiceAssociationsOutput{} + 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_deserializeOpDocumentListServiceNetworkServiceAssociationsOutput(&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_deserializeOpErrorListServiceNetworkServiceAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListServiceNetworkServiceAssociationsOutput(v **ListServiceNetworkServiceAssociationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListServiceNetworkServiceAssociationsOutput + if *v == nil { + sv = &ListServiceNetworkServiceAssociationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentServiceNetworkServiceAssociationList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListServiceNetworkVpcAssociations struct { +} + +func (*awsRestjson1_deserializeOpListServiceNetworkVpcAssociations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListServiceNetworkVpcAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListServiceNetworkVpcAssociations(response, &metadata) + } + output := &ListServiceNetworkVpcAssociationsOutput{} + 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_deserializeOpDocumentListServiceNetworkVpcAssociationsOutput(&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_deserializeOpErrorListServiceNetworkVpcAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListServiceNetworkVpcAssociationsOutput(v **ListServiceNetworkVpcAssociationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListServiceNetworkVpcAssociationsOutput + if *v == nil { + sv = &ListServiceNetworkVpcAssociationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentServiceNetworkVpcAssociationList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListServices struct { +} + +func (*awsRestjson1_deserializeOpListServices) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListServices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListServices(response, &metadata) + } + output := &ListServicesOutput{} + 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_deserializeOpDocumentListServicesOutput(&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_deserializeOpErrorListServices(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListServicesOutput(v **ListServicesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListServicesOutput + if *v == nil { + sv = &ListServicesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentServiceList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTargetGroups struct { +} + +func (*awsRestjson1_deserializeOpListTargetGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTargetGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListTargetGroups(response, &metadata) + } + output := &ListTargetGroupsOutput{} + 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_deserializeOpDocumentListTargetGroupsOutput(&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_deserializeOpErrorListTargetGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTargetGroupsOutput(v **ListTargetGroupsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTargetGroupsOutput + if *v == nil { + sv = &ListTargetGroupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentTargetGroupList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTargets struct { +} + +func (*awsRestjson1_deserializeOpListTargets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorListTargets(response, &metadata) + } + output := &ListTargetsOutput{} + 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_deserializeOpDocumentListTargetsOutput(&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_deserializeOpErrorListTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTargetsOutput(v **ListTargetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTargetsOutput + if *v == nil { + sv = &ListTargetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentTargetSummaryList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutAuthPolicy struct { +} + +func (*awsRestjson1_deserializeOpPutAuthPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutAuthPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorPutAuthPolicy(response, &metadata) + } + output := &PutAuthPolicyOutput{} + 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_deserializeOpDocumentPutAuthPolicyOutput(&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_deserializeOpErrorPutAuthPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutAuthPolicyOutput(v **PutAuthPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutAuthPolicyOutput + if *v == nil { + sv = &PutAuthPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthPolicyString to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthPolicyState to be of type string, got %T instead", value) + } + sv.State = types.AuthPolicyState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutResourcePolicy struct { +} + +func (*awsRestjson1_deserializeOpPutResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + 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_deserializeOpErrorPutResourcePolicy(response, &metadata) + } + output := &PutResourcePolicyOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpRegisterTargets struct { +} + +func (*awsRestjson1_deserializeOpRegisterTargets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRegisterTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorRegisterTargets(response, &metadata) + } + output := &RegisterTargetsOutput{} + 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_deserializeOpDocumentRegisterTargetsOutput(&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_deserializeOpErrorRegisterTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRegisterTargetsOutput(v **RegisterTargetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RegisterTargetsOutput + if *v == nil { + sv = &RegisterTargetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "successful": + if err := awsRestjson1_deserializeDocumentTargetList(&sv.Successful, value); err != nil { + return err + } + + case "unsuccessful": + if err := awsRestjson1_deserializeDocumentTargetFailureList(&sv.Unsuccessful, 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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateAccessLogSubscription struct { +} + +func (*awsRestjson1_deserializeOpUpdateAccessLogSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAccessLogSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateAccessLogSubscription(response, &metadata) + } + output := &UpdateAccessLogSubscriptionOutput{} + 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_deserializeOpDocumentUpdateAccessLogSubscriptionOutput(&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_deserializeOpErrorUpdateAccessLogSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAccessLogSubscriptionOutput(v **UpdateAccessLogSubscriptionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAccessLogSubscriptionOutput + if *v == nil { + sv = &UpdateAccessLogSubscriptionOutput{} + } 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 AccessLogSubscriptionArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "destinationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogDestinationArn to be of type string, got %T instead", value) + } + sv.DestinationArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogSubscriptionId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateListener struct { +} + +func (*awsRestjson1_deserializeOpUpdateListener) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateListener(response, &metadata) + } + output := &UpdateListenerOutput{} + 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_deserializeOpDocumentUpdateListenerOutput(&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_deserializeOpErrorUpdateListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateListenerOutput(v **UpdateListenerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateListenerOutput + if *v == nil { + sv = &UpdateListenerOutput{} + } 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 ListenerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "defaultAction": + if err := awsRestjson1_deserializeDocumentRuleAction(&sv.DefaultAction, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.ListenerProtocol(jtv) + } + + case "serviceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceArn to be of type string, got %T instead", value) + } + sv.ServiceArn = ptr.String(jtv) + } + + case "serviceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.ServiceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateRule struct { +} + +func (*awsRestjson1_deserializeOpUpdateRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateRule(response, &metadata) + } + output := &UpdateRuleOutput{} + 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_deserializeOpDocumentUpdateRuleOutput(&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_deserializeOpErrorUpdateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateRuleOutput(v **UpdateRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateRuleOutput + if *v == nil { + sv = &UpdateRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if err := awsRestjson1_deserializeDocumentRuleAction(&sv.Action, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "isDefault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsDefault = ptr.Bool(jtv) + } + + case "match": + if err := awsRestjson1_deserializeDocumentRuleMatch(&sv.Match, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateService struct { +} + +func (*awsRestjson1_deserializeOpUpdateService) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateService) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateService(response, &metadata) + } + output := &UpdateServiceOutput{} + 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_deserializeOpDocumentUpdateServiceOutput(&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_deserializeOpErrorUpdateService(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateServiceOutput(v **UpdateServiceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateServiceOutput + if *v == nil { + sv = &UpdateServiceOutput{} + } 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 ServiceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "authType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthType to be of type string, got %T instead", value) + } + sv.AuthType = types.AuthType(jtv) + } + + case "certificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + } + sv.CertificateArn = ptr.String(jtv) + } + + case "customDomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCustomDomainName to be of type string, got %T instead", value) + } + sv.CustomDomainName = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateServiceNetwork struct { +} + +func (*awsRestjson1_deserializeOpUpdateServiceNetwork) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateServiceNetwork) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateServiceNetwork(response, &metadata) + } + output := &UpdateServiceNetworkOutput{} + 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_deserializeOpDocumentUpdateServiceNetworkOutput(&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_deserializeOpErrorUpdateServiceNetwork(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateServiceNetworkOutput(v **UpdateServiceNetworkOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateServiceNetworkOutput + if *v == nil { + sv = &UpdateServiceNetworkOutput{} + } 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 ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "authType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthType to be of type string, got %T instead", value) + } + sv.AuthType = types.AuthType(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_deserializeOpUpdateServiceNetworkVpcAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateServiceNetworkVpcAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateServiceNetworkVpcAssociation(response, &metadata) + } + output := &UpdateServiceNetworkVpcAssociationOutput{} + 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_deserializeOpDocumentUpdateServiceNetworkVpcAssociationOutput(&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_deserializeOpErrorUpdateServiceNetworkVpcAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateServiceNetworkVpcAssociationOutput(v **UpdateServiceNetworkVpcAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateServiceNetworkVpcAssociationOutput + if *v == nil { + sv = &UpdateServiceNetworkVpcAssociationOutput{} + } 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 ServiceNetworkVpcAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "securityGroupIds": + if err := awsRestjson1_deserializeDocumentSecurityGroupList(&sv.SecurityGroupIds, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkVpcAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateTargetGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateTargetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateTargetGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorUpdateTargetGroup(response, &metadata) + } + output := &UpdateTargetGroupOutput{} + 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_deserializeOpDocumentUpdateTargetGroupOutput(&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_deserializeOpErrorUpdateTargetGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentUpdateTargetGroupOutput(v **UpdateTargetGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateTargetGroupOutput + if *v == nil { + sv = &UpdateTargetGroupOutput{} + } 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 TargetGroupArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "config": + if err := awsRestjson1_deserializeDocumentTargetGroupConfig(&sv.Config, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupStatus to be of type string, got %T instead", value) + } + sv.Status = types.TargetGroupStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupType to be of type string, got %T instead", value) + } + sv.Type = types.TargetGroupType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccessLogSubscriptionList(v *[]types.AccessLogSubscriptionSummary, 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.AccessLogSubscriptionSummary + if *v == nil { + cv = []types.AccessLogSubscriptionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccessLogSubscriptionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccessLogSubscriptionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAccessLogSubscriptionSummary(v **types.AccessLogSubscriptionSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AccessLogSubscriptionSummary + if *v == nil { + sv = &types.AccessLogSubscriptionSummary{} + } 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 AccessLogSubscriptionArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "destinationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogDestinationArn to be of type string, got %T instead", value) + } + sv.DestinationArn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessLogSubscriptionId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_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) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDnsEntry(v **types.DnsEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DnsEntry + if *v == nil { + sv = &types.DnsEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "domainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "hostedZoneId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HostedZoneId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFixedResponseAction(v **types.FixedResponseAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FixedResponseAction + if *v == nil { + sv = &types.FixedResponseAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "statusCode": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HttpStatusCode to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StatusCode = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentForwardAction(v **types.ForwardAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ForwardAction + if *v == nil { + sv = &types.ForwardAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "targetGroups": + if err := awsRestjson1_deserializeDocumentWeightedTargetGroupList(&sv.TargetGroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHeaderMatch(v **types.HeaderMatch, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.HeaderMatch + if *v == nil { + sv = &types.HeaderMatch{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "caseSensitive": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.CaseSensitive = ptr.Bool(jtv) + } + + case "match": + if err := awsRestjson1_deserializeDocumentHeaderMatchType(&sv.Match, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HeaderMatchName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHeaderMatchList(v *[]types.HeaderMatch, 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.HeaderMatch + if *v == nil { + cv = []types.HeaderMatch{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.HeaderMatch + destAddr := &col + if err := awsRestjson1_deserializeDocumentHeaderMatch(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentHeaderMatchType(v *types.HeaderMatchType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.HeaderMatchType +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "contains": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HeaderMatchContains to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.HeaderMatchTypeMemberContains{Value: mv} + break loop + + case "exact": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HeaderMatchExact to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.HeaderMatchTypeMemberExact{Value: mv} + break loop + + case "prefix": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HeaderMatchPrefix to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.HeaderMatchTypeMemberPrefix{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.HealthCheckConfig + if *v == nil { + sv = &types.HealthCheckConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = ptr.Bool(jtv) + } + + case "healthCheckIntervalSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HealthCheckIntervalSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.HealthCheckIntervalSeconds = ptr.Int32(int32(i64)) + } + + case "healthCheckTimeoutSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HealthCheckTimeoutSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.HealthCheckTimeoutSeconds = ptr.Int32(int32(i64)) + } + + case "healthyThresholdCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HealthyThresholdCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.HealthyThresholdCount = ptr.Int32(int32(i64)) + } + + case "matcher": + if err := awsRestjson1_deserializeDocumentMatcher(&sv.Matcher, value); err != nil { + return err + } + + case "path": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HealthCheckPath to be of type string, got %T instead", value) + } + sv.Path = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected HealthCheckPort to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.TargetGroupProtocol(jtv) + } + + case "protocolVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HealthCheckProtocolVersion to be of type string, got %T instead", value) + } + sv.ProtocolVersion = types.HealthCheckProtocolVersion(jtv) + } + + case "unhealthyThresholdCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UnhealthyThresholdCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UnhealthyThresholdCount = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHttpMatch(v **types.HttpMatch, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.HttpMatch + if *v == nil { + sv = &types.HttpMatch{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "headerMatches": + if err := awsRestjson1_deserializeDocumentHeaderMatchList(&sv.HeaderMatches, value); err != nil { + return err + } + + case "method": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HttpMethod to be of type string, got %T instead", value) + } + sv.Method = ptr.String(jtv) + } + + case "pathMatch": + if err := awsRestjson1_deserializeDocumentPathMatch(&sv.PathMatch, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListenerSummary(v **types.ListenerSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ListenerSummary + if *v == nil { + sv = &types.ListenerSummary{} + } 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 ListenerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListenerProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.ListenerProtocol(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListenerSummaryList(v *[]types.ListenerSummary, 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.ListenerSummary + if *v == nil { + cv = []types.ListenerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListenerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentListenerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMatcher(v *types.Matcher, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.Matcher +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "httpCode": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HttpCodeMatcher to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.MatcherMemberHttpCode{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentPathMatch(v **types.PathMatch, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PathMatch + if *v == nil { + sv = &types.PathMatch{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "caseSensitive": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.CaseSensitive = ptr.Bool(jtv) + } + + case "match": + if err := awsRestjson1_deserializeDocumentPathMatchType(&sv.Match, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPathMatchType(v *types.PathMatchType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.PathMatchType +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "exact": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PathMatchExact to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.PathMatchTypeMemberExact{Value: mv} + break loop + + case "prefix": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PathMatchPrefix to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.PathMatchTypeMemberPrefix{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuleAction(v *types.RuleAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.RuleAction +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "fixedResponse": + var mv types.FixedResponseAction + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFixedResponseAction(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.RuleActionMemberFixedResponse{Value: mv} + break loop + + case "forward": + var mv types.ForwardAction + destAddr := &mv + if err := awsRestjson1_deserializeDocumentForwardAction(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.RuleActionMemberForward{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentRuleMatch(v *types.RuleMatch, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.RuleMatch +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "httpMatch": + var mv types.HttpMatch + destAddr := &mv + if err := awsRestjson1_deserializeDocumentHttpMatch(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.RuleMatchMemberHttpMatch{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentRuleSummary(v **types.RuleSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RuleSummary + if *v == nil { + sv = &types.RuleSummary{} + } 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 RuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "isDefault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsDefault = ptr.Bool(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuleSummaryList(v *[]types.RuleSummary, 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.RuleSummary + if *v == nil { + cv = []types.RuleSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RuleSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentRuleSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRuleUpdateFailure(v **types.RuleUpdateFailure, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RuleUpdateFailure + if *v == nil { + sv = &types.RuleUpdateFailure{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureCode to be of type string, got %T instead", value) + } + sv.FailureCode = ptr.String(jtv) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureMessage to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "ruleIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleIdentifier to be of type string, got %T instead", value) + } + sv.RuleIdentifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuleUpdateFailureList(v *[]types.RuleUpdateFailure, 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.RuleUpdateFailure + if *v == nil { + cv = []types.RuleUpdateFailure{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RuleUpdateFailure + destAddr := &col + if err := awsRestjson1_deserializeDocumentRuleUpdateFailure(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRuleUpdateSuccess(v **types.RuleUpdateSuccess, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RuleUpdateSuccess + if *v == nil { + sv = &types.RuleUpdateSuccess{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if err := awsRestjson1_deserializeDocumentRuleAction(&sv.Action, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "isDefault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsDefault = ptr.Bool(jtv) + } + + case "match": + if err := awsRestjson1_deserializeDocumentRuleMatch(&sv.Match, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRuleUpdateSuccessList(v *[]types.RuleUpdateSuccess, 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.RuleUpdateSuccess + if *v == nil { + cv = []types.RuleUpdateSuccess{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RuleUpdateSuccess + destAddr := &col + if err := awsRestjson1_deserializeDocumentRuleUpdateSuccess(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSecurityGroupList(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 SecurityGroupId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceArnList(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 ServiceArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceList(v *[]types.ServiceSummary, 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.ServiceSummary + if *v == nil { + cv = []types.ServiceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentServiceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceNetworkList(v *[]types.ServiceNetworkSummary, 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.ServiceNetworkSummary + if *v == nil { + cv = []types.ServiceNetworkSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceNetworkSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentServiceNetworkSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceNetworkServiceAssociationList(v *[]types.ServiceNetworkServiceAssociationSummary, 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.ServiceNetworkServiceAssociationSummary + if *v == nil { + cv = []types.ServiceNetworkServiceAssociationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceNetworkServiceAssociationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentServiceNetworkServiceAssociationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceNetworkServiceAssociationSummary(v **types.ServiceNetworkServiceAssociationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServiceNetworkServiceAssociationSummary + if *v == nil { + sv = &types.ServiceNetworkServiceAssociationSummary{} + } 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 ServiceNetworkServiceAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "customDomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCustomDomainName to be of type string, got %T instead", value) + } + sv.CustomDomainName = ptr.String(jtv) + } + + case "dnsEntry": + if err := awsRestjson1_deserializeDocumentDnsEntry(&sv.DnsEntry, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationIdentifier to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "serviceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceArn to be of type string, got %T instead", value) + } + sv.ServiceArn = ptr.String(jtv) + } + + case "serviceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.ServiceId = ptr.String(jtv) + } + + case "serviceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value) + } + sv.ServiceName = ptr.String(jtv) + } + + case "serviceNetworkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.ServiceNetworkArn = ptr.String(jtv) + } + + case "serviceNetworkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.ServiceNetworkId = ptr.String(jtv) + } + + case "serviceNetworkName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.ServiceNetworkName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkServiceAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkServiceAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceNetworkSummary(v **types.ServiceNetworkSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServiceNetworkSummary + if *v == nil { + sv = &types.ServiceNetworkSummary{} + } 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 ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "numberOfAssociatedServices": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfAssociatedServices = ptr.Int64(i64) + } + + case "numberOfAssociatedVPCs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfAssociatedVPCs = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceNetworkVpcAssociationList(v *[]types.ServiceNetworkVpcAssociationSummary, 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.ServiceNetworkVpcAssociationSummary + if *v == nil { + cv = []types.ServiceNetworkVpcAssociationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceNetworkVpcAssociationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentServiceNetworkVpcAssociationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceNetworkVpcAssociationSummary(v **types.ServiceNetworkVpcAssociationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServiceNetworkVpcAssociationSummary + if *v == nil { + sv = &types.ServiceNetworkVpcAssociationSummary{} + } 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 ServiceNetworkVpcAssociationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "createdBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.CreatedBy = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "serviceNetworkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkArn to be of type string, got %T instead", value) + } + sv.ServiceNetworkArn = ptr.String(jtv) + } + + case "serviceNetworkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkId to be of type string, got %T instead", value) + } + sv.ServiceNetworkId = ptr.String(jtv) + } + + case "serviceNetworkName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkName to be of type string, got %T instead", value) + } + sv.ServiceNetworkName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceNetworkVpcAssociationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceNetworkVpcAssociationStatus(jtv) + } + + case "vpcId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) + } + sv.VpcId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceSummary(v **types.ServiceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ServiceSummary + if *v == nil { + sv = &types.ServiceSummary{} + } 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 ServiceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "customDomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCustomDomainName to be of type string, got %T instead", value) + } + sv.CustomDomainName = ptr.String(jtv) + } + + case "dnsEntry": + if err := awsRestjson1_deserializeDocumentDnsEntry(&sv.DnsEntry, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_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 "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTargetFailure(v **types.TargetFailure, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TargetFailure + if *v == nil { + sv = &types.TargetFailure{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureCode = ptr.String(jtv) + } + + case "failureMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureMessage = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTargetFailureList(v *[]types.TargetFailure, 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.TargetFailure + if *v == nil { + cv = []types.TargetFailure{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TargetFailure + destAddr := &col + if err := awsRestjson1_deserializeDocumentTargetFailure(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTargetGroupConfig(v **types.TargetGroupConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TargetGroupConfig + if *v == nil { + sv = &types.TargetGroupConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "healthCheck": + if err := awsRestjson1_deserializeDocumentHealthCheckConfig(&sv.HealthCheck, value); err != nil { + return err + } + + case "ipAddressType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddressType to be of type string, got %T instead", value) + } + sv.IpAddressType = types.IpAddressType(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.TargetGroupProtocol(jtv) + } + + case "protocolVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupProtocolVersion to be of type string, got %T instead", value) + } + sv.ProtocolVersion = types.TargetGroupProtocolVersion(jtv) + } + + case "vpcIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) + } + sv.VpcIdentifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTargetGroupList(v *[]types.TargetGroupSummary, 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.TargetGroupSummary + if *v == nil { + cv = []types.TargetGroupSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TargetGroupSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentTargetGroupSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTargetGroupSummary(v **types.TargetGroupSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TargetGroupSummary + if *v == nil { + sv = &types.TargetGroupSummary{} + } 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 TargetGroupArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "ipAddressType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddressType to be of type string, got %T instead", value) + } + sv.IpAddressType = types.IpAddressType(jtv) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.TargetGroupProtocol(jtv) + } + + case "serviceArns": + if err := awsRestjson1_deserializeDocumentServiceArnList(&sv.ServiceArns, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupStatus to be of type string, got %T instead", value) + } + sv.Status = types.TargetGroupStatus(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupType to be of type string, got %T instead", value) + } + sv.Type = types.TargetGroupType(jtv) + } + + case "vpcIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcId to be of type string, got %T instead", value) + } + sv.VpcIdentifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTargetList(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.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Target + if *v == nil { + cv = []types.Target{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Target + destAddr := &col + if err := awsRestjson1_deserializeDocumentTarget(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "reasonCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReasonCode = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetStatus to be of type string, got %T instead", value) + } + sv.Status = types.TargetStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTargetSummaryList(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.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.TargetSummary + if *v == nil { + cv = []types.TargetSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TargetSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentTargetSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWeightedTargetGroup(v **types.WeightedTargetGroup, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.WeightedTargetGroup + if *v == nil { + sv = &types.WeightedTargetGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "targetGroupIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetGroupIdentifier to be of type string, got %T instead", value) + } + sv.TargetGroupIdentifier = ptr.String(jtv) + } + + case "weight": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TargetGroupWeight to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Weight = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWeightedTargetGroupList(v *[]types.WeightedTargetGroup, 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.WeightedTargetGroup + if *v == nil { + cv = []types.WeightedTargetGroup{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WeightedTargetGroup + destAddr := &col + if err := awsRestjson1_deserializeDocumentWeightedTargetGroup(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/vpclattice/doc.go b/service/vpclattice/doc.go new file mode 100644 index 00000000000..06344ed84cb --- /dev/null +++ b/service/vpclattice/doc.go @@ -0,0 +1,13 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package vpclattice provides the API client, operations, and parameter types for +// Amazon VPC Lattice. +// +// Amazon VPC Lattice is a fully managed application networking service that you +// use to connect, secure, and monitor all of your services across multiple +// accounts and virtual private clouds (VPCs). Amazon VPC Lattice interconnects +// your microservices and legacy services within a logical boundary, so that you +// can discover and manage them more efficiently. For more information, see the +// Amazon VPC Lattice User Guide +// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/) +package vpclattice diff --git a/service/vpclattice/endpoints.go b/service/vpclattice/endpoints.go new file mode 100644 index 00000000000..51b9e28509b --- /dev/null +++ b/service/vpclattice/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +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/vpclattice/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 = "vpc-lattice" + } + 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/vpclattice/generated.json b/service/vpclattice/generated.json new file mode 100644 index 00000000000..f6550d21f7b --- /dev/null +++ b/service/vpclattice/generated.json @@ -0,0 +1,80 @@ +{ + "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_BatchUpdateRule.go", + "api_op_CreateAccessLogSubscription.go", + "api_op_CreateListener.go", + "api_op_CreateRule.go", + "api_op_CreateService.go", + "api_op_CreateServiceNetwork.go", + "api_op_CreateServiceNetworkServiceAssociation.go", + "api_op_CreateServiceNetworkVpcAssociation.go", + "api_op_CreateTargetGroup.go", + "api_op_DeleteAccessLogSubscription.go", + "api_op_DeleteAuthPolicy.go", + "api_op_DeleteListener.go", + "api_op_DeleteResourcePolicy.go", + "api_op_DeleteRule.go", + "api_op_DeleteService.go", + "api_op_DeleteServiceNetwork.go", + "api_op_DeleteServiceNetworkServiceAssociation.go", + "api_op_DeleteServiceNetworkVpcAssociation.go", + "api_op_DeleteTargetGroup.go", + "api_op_DeregisterTargets.go", + "api_op_GetAccessLogSubscription.go", + "api_op_GetAuthPolicy.go", + "api_op_GetListener.go", + "api_op_GetResourcePolicy.go", + "api_op_GetRule.go", + "api_op_GetService.go", + "api_op_GetServiceNetwork.go", + "api_op_GetServiceNetworkServiceAssociation.go", + "api_op_GetServiceNetworkVpcAssociation.go", + "api_op_GetTargetGroup.go", + "api_op_ListAccessLogSubscriptions.go", + "api_op_ListListeners.go", + "api_op_ListRules.go", + "api_op_ListServiceNetworkServiceAssociations.go", + "api_op_ListServiceNetworkVpcAssociations.go", + "api_op_ListServiceNetworks.go", + "api_op_ListServices.go", + "api_op_ListTagsForResource.go", + "api_op_ListTargetGroups.go", + "api_op_ListTargets.go", + "api_op_PutAuthPolicy.go", + "api_op_PutResourcePolicy.go", + "api_op_RegisterTargets.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateAccessLogSubscription.go", + "api_op_UpdateListener.go", + "api_op_UpdateRule.go", + "api_op_UpdateService.go", + "api_op_UpdateServiceNetwork.go", + "api_op_UpdateServiceNetworkVpcAssociation.go", + "api_op_UpdateTargetGroup.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/vpclattice", + "unstable": false +} diff --git a/service/vpclattice/go.mod b/service/vpclattice/go.mod new file mode 100644 index 00000000000..26466face87 --- /dev/null +++ b/service/vpclattice/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/vpclattice + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.7 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25 + github.com/aws/smithy-go v1.13.5 +) + +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/vpclattice/go.sum b/service/vpclattice/go.sum new file mode 100644 index 00000000000..6f859610e44 --- /dev/null +++ b/service/vpclattice/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= +github.com/aws/smithy-go v1.13.5/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/vpclattice/go_module_metadata.go b/service/vpclattice/go_module_metadata.go new file mode 100644 index 00000000000..46ea2ee2650 --- /dev/null +++ b/service/vpclattice/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package vpclattice + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/vpclattice/internal/endpoints/endpoints.go b/service/vpclattice/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..bb52480c194 --- /dev/null +++ b/service/vpclattice/internal/endpoints/endpoints.go @@ -0,0 +1,273 @@ +// 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 VPC Lattice 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: "vpc-lattice.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "vpc-lattice-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "vpc-lattice-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "vpc-lattice.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "vpc-lattice.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "vpc-lattice-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "vpc-lattice-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "vpc-lattice.{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: "vpc-lattice-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "vpc-lattice.{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: "vpc-lattice-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "vpc-lattice.{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: "vpc-lattice.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "vpc-lattice-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "vpc-lattice-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "vpc-lattice.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/vpclattice/internal/endpoints/endpoints_test.go b/service/vpclattice/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/vpclattice/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/vpclattice/protocol_test.go b/service/vpclattice/protocol_test.go new file mode 100644 index 00000000000..91e955c6f69 --- /dev/null +++ b/service/vpclattice/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice diff --git a/service/vpclattice/serializers.go b/service/vpclattice/serializers.go new file mode 100644 index 00000000000..bddfe12600b --- /dev/null +++ b/service/vpclattice/serializers.go @@ -0,0 +1,4274 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpBatchUpdateRule struct { +} + +func (*awsRestjson1_serializeOpBatchUpdateRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchUpdateRule) 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.(*BatchUpdateRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsBatchUpdateRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchUpdateRuleInput(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_serializeOpHttpBindingsBatchUpdateRuleInput(v *BatchUpdateRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchUpdateRuleInput(v *BatchUpdateRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Rules != nil { + ok := object.Key("rules") + if err := awsRestjson1_serializeDocumentRuleUpdateList(v.Rules, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateAccessLogSubscription struct { +} + +func (*awsRestjson1_serializeOpCreateAccessLogSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateAccessLogSubscription) 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.(*CreateAccessLogSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accesslogsubscriptions") + 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_serializeOpDocumentCreateAccessLogSubscriptionInput(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_serializeOpHttpBindingsCreateAccessLogSubscriptionInput(v *CreateAccessLogSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateAccessLogSubscriptionInput(v *CreateAccessLogSubscriptionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.DestinationArn != nil { + ok := object.Key("destinationArn") + ok.String(*v.DestinationArn) + } + + if v.ResourceIdentifier != nil { + ok := object.Key("resourceIdentifier") + ok.String(*v.ResourceIdentifier) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateListener struct { +} + +func (*awsRestjson1_serializeOpCreateListener) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateListener) 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.(*CreateListenerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners") + 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_serializeOpHttpBindingsCreateListenerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateListenerInput(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_serializeOpHttpBindingsCreateListenerInput(v *CreateListenerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateListenerInput(v *CreateListenerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.DefaultAction != nil { + ok := object.Key("defaultAction") + if err := awsRestjson1_serializeDocumentRuleAction(v.DefaultAction, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Port != nil { + ok := object.Key("port") + ok.Integer(*v.Port) + } + + if len(v.Protocol) > 0 { + ok := object.Key("protocol") + ok.String(string(v.Protocol)) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateRule struct { +} + +func (*awsRestjson1_serializeOpCreateRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateRule) 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.(*CreateRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateRuleInput(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_serializeOpHttpBindingsCreateRuleInput(v *CreateRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateRuleInput(v *CreateRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("action") + if err := awsRestjson1_serializeDocumentRuleAction(v.Action, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Match != nil { + ok := object.Key("match") + if err := awsRestjson1_serializeDocumentRuleMatch(v.Match, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Priority != nil { + ok := object.Key("priority") + ok.Integer(*v.Priority) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateService struct { +} + +func (*awsRestjson1_serializeOpCreateService) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateService) 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.(*CreateServiceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services") + 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_serializeOpDocumentCreateServiceInput(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_serializeOpHttpBindingsCreateServiceInput(v *CreateServiceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateServiceInput(v *CreateServiceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + if v.CertificateArn != nil { + ok := object.Key("certificateArn") + ok.String(*v.CertificateArn) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.CustomDomainName != nil { + ok := object.Key("customDomainName") + ok.String(*v.CustomDomainName) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateServiceNetwork struct { +} + +func (*awsRestjson1_serializeOpCreateServiceNetwork) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateServiceNetwork) 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.(*CreateServiceNetworkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworks") + 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_serializeOpDocumentCreateServiceNetworkInput(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_serializeOpHttpBindingsCreateServiceNetworkInput(v *CreateServiceNetworkInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateServiceNetworkInput(v *CreateServiceNetworkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateServiceNetworkServiceAssociation struct { +} + +func (*awsRestjson1_serializeOpCreateServiceNetworkServiceAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateServiceNetworkServiceAssociation) 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.(*CreateServiceNetworkServiceAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkserviceassociations") + 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_serializeOpDocumentCreateServiceNetworkServiceAssociationInput(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_serializeOpHttpBindingsCreateServiceNetworkServiceAssociationInput(v *CreateServiceNetworkServiceAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateServiceNetworkServiceAssociationInput(v *CreateServiceNetworkServiceAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.ServiceIdentifier != nil { + ok := object.Key("serviceIdentifier") + ok.String(*v.ServiceIdentifier) + } + + if v.ServiceNetworkIdentifier != nil { + ok := object.Key("serviceNetworkIdentifier") + ok.String(*v.ServiceNetworkIdentifier) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_serializeOpCreateServiceNetworkVpcAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateServiceNetworkVpcAssociation) 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.(*CreateServiceNetworkVpcAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkvpcassociations") + 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_serializeOpDocumentCreateServiceNetworkVpcAssociationInput(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_serializeOpHttpBindingsCreateServiceNetworkVpcAssociationInput(v *CreateServiceNetworkVpcAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateServiceNetworkVpcAssociationInput(v *CreateServiceNetworkVpcAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.SecurityGroupIds != nil { + ok := object.Key("securityGroupIds") + if err := awsRestjson1_serializeDocumentSecurityGroupList(v.SecurityGroupIds, ok); err != nil { + return err + } + } + + if v.ServiceNetworkIdentifier != nil { + ok := object.Key("serviceNetworkIdentifier") + ok.String(*v.ServiceNetworkIdentifier) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.VpcIdentifier != nil { + ok := object.Key("vpcIdentifier") + ok.String(*v.VpcIdentifier) + } + + return nil +} + +type awsRestjson1_serializeOpCreateTargetGroup struct { +} + +func (*awsRestjson1_serializeOpCreateTargetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateTargetGroup) 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.(*CreateTargetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups") + 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_serializeOpDocumentCreateTargetGroupInput(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_serializeOpHttpBindingsCreateTargetGroupInput(v *CreateTargetGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTargetGroupInput(v *CreateTargetGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Config != nil { + ok := object.Key("config") + if err := awsRestjson1_serializeDocumentTargetGroupConfig(v.Config, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAccessLogSubscription struct { +} + +func (*awsRestjson1_serializeOpDeleteAccessLogSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAccessLogSubscription) 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.(*DeleteAccessLogSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accesslogsubscriptions/{accessLogSubscriptionIdentifier}") + 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_serializeOpHttpBindingsDeleteAccessLogSubscriptionInput(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_serializeOpHttpBindingsDeleteAccessLogSubscriptionInput(v *DeleteAccessLogSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessLogSubscriptionIdentifier == nil || len(*v.AccessLogSubscriptionIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member accessLogSubscriptionIdentifier must not be empty")} + } + if v.AccessLogSubscriptionIdentifier != nil { + if err := encoder.SetURI("accessLogSubscriptionIdentifier").String(*v.AccessLogSubscriptionIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteAuthPolicy struct { +} + +func (*awsRestjson1_serializeOpDeleteAuthPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAuthPolicy) 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.(*DeleteAuthPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/authpolicy/{resourceIdentifier}") + 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_serializeOpHttpBindingsDeleteAuthPolicyInput(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_serializeOpHttpBindingsDeleteAuthPolicyInput(v *DeleteAuthPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceIdentifier == nil || len(*v.ResourceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceIdentifier must not be empty")} + } + if v.ResourceIdentifier != nil { + if err := encoder.SetURI("resourceIdentifier").String(*v.ResourceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteListener struct { +} + +func (*awsRestjson1_serializeOpDeleteListener) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteListener) 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.(*DeleteListenerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}") + 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_serializeOpHttpBindingsDeleteListenerInput(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_serializeOpHttpBindingsDeleteListenerInput(v *DeleteListenerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteResourcePolicy struct { +} + +func (*awsRestjson1_serializeOpDeleteResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteResourcePolicy) 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.(*DeleteResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/resourcepolicy/{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_serializeOpHttpBindingsDeleteResourcePolicyInput(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_serializeOpHttpBindingsDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, 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_serializeOpDeleteRule struct { +} + +func (*awsRestjson1_serializeOpDeleteRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteRule) 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.(*DeleteRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}") + 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_serializeOpHttpBindingsDeleteRuleInput(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_serializeOpHttpBindingsDeleteRuleInput(v *DeleteRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.RuleIdentifier == nil || len(*v.RuleIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ruleIdentifier must not be empty")} + } + if v.RuleIdentifier != nil { + if err := encoder.SetURI("ruleIdentifier").String(*v.RuleIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteService struct { +} + +func (*awsRestjson1_serializeOpDeleteService) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteService) 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.(*DeleteServiceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}") + 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_serializeOpHttpBindingsDeleteServiceInput(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_serializeOpHttpBindingsDeleteServiceInput(v *DeleteServiceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteServiceNetwork struct { +} + +func (*awsRestjson1_serializeOpDeleteServiceNetwork) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteServiceNetwork) 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.(*DeleteServiceNetworkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworks/{serviceNetworkIdentifier}") + 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_serializeOpHttpBindingsDeleteServiceNetworkInput(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_serializeOpHttpBindingsDeleteServiceNetworkInput(v *DeleteServiceNetworkInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkIdentifier == nil || len(*v.ServiceNetworkIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkIdentifier must not be empty")} + } + if v.ServiceNetworkIdentifier != nil { + if err := encoder.SetURI("serviceNetworkIdentifier").String(*v.ServiceNetworkIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteServiceNetworkServiceAssociation struct { +} + +func (*awsRestjson1_serializeOpDeleteServiceNetworkServiceAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteServiceNetworkServiceAssociation) 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.(*DeleteServiceNetworkServiceAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkserviceassociations/{serviceNetworkServiceAssociationIdentifier}") + 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_serializeOpHttpBindingsDeleteServiceNetworkServiceAssociationInput(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_serializeOpHttpBindingsDeleteServiceNetworkServiceAssociationInput(v *DeleteServiceNetworkServiceAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkServiceAssociationIdentifier == nil || len(*v.ServiceNetworkServiceAssociationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkServiceAssociationIdentifier must not be empty")} + } + if v.ServiceNetworkServiceAssociationIdentifier != nil { + if err := encoder.SetURI("serviceNetworkServiceAssociationIdentifier").String(*v.ServiceNetworkServiceAssociationIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_serializeOpDeleteServiceNetworkVpcAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteServiceNetworkVpcAssociation) 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.(*DeleteServiceNetworkVpcAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}") + 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_serializeOpHttpBindingsDeleteServiceNetworkVpcAssociationInput(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_serializeOpHttpBindingsDeleteServiceNetworkVpcAssociationInput(v *DeleteServiceNetworkVpcAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkVpcAssociationIdentifier == nil || len(*v.ServiceNetworkVpcAssociationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkVpcAssociationIdentifier must not be empty")} + } + if v.ServiceNetworkVpcAssociationIdentifier != nil { + if err := encoder.SetURI("serviceNetworkVpcAssociationIdentifier").String(*v.ServiceNetworkVpcAssociationIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteTargetGroup struct { +} + +func (*awsRestjson1_serializeOpDeleteTargetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteTargetGroup) 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.(*DeleteTargetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups/{targetGroupIdentifier}") + 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_serializeOpHttpBindingsDeleteTargetGroupInput(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_serializeOpHttpBindingsDeleteTargetGroupInput(v *DeleteTargetGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.TargetGroupIdentifier == nil || len(*v.TargetGroupIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member targetGroupIdentifier must not be empty")} + } + if v.TargetGroupIdentifier != nil { + if err := encoder.SetURI("targetGroupIdentifier").String(*v.TargetGroupIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeregisterTargets struct { +} + +func (*awsRestjson1_serializeOpDeregisterTargets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeregisterTargets) 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.(*DeregisterTargetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups/{targetGroupIdentifier}/deregistertargets") + 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_serializeOpHttpBindingsDeregisterTargetsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeregisterTargetsInput(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_serializeOpHttpBindingsDeregisterTargetsInput(v *DeregisterTargetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.TargetGroupIdentifier == nil || len(*v.TargetGroupIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member targetGroupIdentifier must not be empty")} + } + if v.TargetGroupIdentifier != nil { + if err := encoder.SetURI("targetGroupIdentifier").String(*v.TargetGroupIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeregisterTargetsInput(v *DeregisterTargetsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Targets != nil { + ok := object.Key("targets") + if err := awsRestjson1_serializeDocumentTargetList(v.Targets, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetAccessLogSubscription struct { +} + +func (*awsRestjson1_serializeOpGetAccessLogSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAccessLogSubscription) 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.(*GetAccessLogSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accesslogsubscriptions/{accessLogSubscriptionIdentifier}") + 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_serializeOpHttpBindingsGetAccessLogSubscriptionInput(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_serializeOpHttpBindingsGetAccessLogSubscriptionInput(v *GetAccessLogSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessLogSubscriptionIdentifier == nil || len(*v.AccessLogSubscriptionIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member accessLogSubscriptionIdentifier must not be empty")} + } + if v.AccessLogSubscriptionIdentifier != nil { + if err := encoder.SetURI("accessLogSubscriptionIdentifier").String(*v.AccessLogSubscriptionIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetAuthPolicy struct { +} + +func (*awsRestjson1_serializeOpGetAuthPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAuthPolicy) 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.(*GetAuthPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/authpolicy/{resourceIdentifier}") + 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_serializeOpHttpBindingsGetAuthPolicyInput(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_serializeOpHttpBindingsGetAuthPolicyInput(v *GetAuthPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceIdentifier == nil || len(*v.ResourceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceIdentifier must not be empty")} + } + if v.ResourceIdentifier != nil { + if err := encoder.SetURI("resourceIdentifier").String(*v.ResourceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetListener struct { +} + +func (*awsRestjson1_serializeOpGetListener) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetListener) 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.(*GetListenerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}") + 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_serializeOpHttpBindingsGetListenerInput(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_serializeOpHttpBindingsGetListenerInput(v *GetListenerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetResourcePolicy struct { +} + +func (*awsRestjson1_serializeOpGetResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetResourcePolicy) 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.(*GetResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/resourcepolicy/{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_serializeOpHttpBindingsGetResourcePolicyInput(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_serializeOpHttpBindingsGetResourcePolicyInput(v *GetResourcePolicyInput, 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_serializeOpGetRule struct { +} + +func (*awsRestjson1_serializeOpGetRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRule) 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.(*GetRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}") + 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_serializeOpHttpBindingsGetRuleInput(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_serializeOpHttpBindingsGetRuleInput(v *GetRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.RuleIdentifier == nil || len(*v.RuleIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ruleIdentifier must not be empty")} + } + if v.RuleIdentifier != nil { + if err := encoder.SetURI("ruleIdentifier").String(*v.RuleIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetService struct { +} + +func (*awsRestjson1_serializeOpGetService) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetService) 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.(*GetServiceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}") + 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_serializeOpHttpBindingsGetServiceInput(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_serializeOpHttpBindingsGetServiceInput(v *GetServiceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetServiceNetwork struct { +} + +func (*awsRestjson1_serializeOpGetServiceNetwork) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetServiceNetwork) 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.(*GetServiceNetworkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworks/{serviceNetworkIdentifier}") + 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_serializeOpHttpBindingsGetServiceNetworkInput(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_serializeOpHttpBindingsGetServiceNetworkInput(v *GetServiceNetworkInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkIdentifier == nil || len(*v.ServiceNetworkIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkIdentifier must not be empty")} + } + if v.ServiceNetworkIdentifier != nil { + if err := encoder.SetURI("serviceNetworkIdentifier").String(*v.ServiceNetworkIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetServiceNetworkServiceAssociation struct { +} + +func (*awsRestjson1_serializeOpGetServiceNetworkServiceAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetServiceNetworkServiceAssociation) 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.(*GetServiceNetworkServiceAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkserviceassociations/{serviceNetworkServiceAssociationIdentifier}") + 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_serializeOpHttpBindingsGetServiceNetworkServiceAssociationInput(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_serializeOpHttpBindingsGetServiceNetworkServiceAssociationInput(v *GetServiceNetworkServiceAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkServiceAssociationIdentifier == nil || len(*v.ServiceNetworkServiceAssociationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkServiceAssociationIdentifier must not be empty")} + } + if v.ServiceNetworkServiceAssociationIdentifier != nil { + if err := encoder.SetURI("serviceNetworkServiceAssociationIdentifier").String(*v.ServiceNetworkServiceAssociationIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_serializeOpGetServiceNetworkVpcAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetServiceNetworkVpcAssociation) 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.(*GetServiceNetworkVpcAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}") + 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_serializeOpHttpBindingsGetServiceNetworkVpcAssociationInput(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_serializeOpHttpBindingsGetServiceNetworkVpcAssociationInput(v *GetServiceNetworkVpcAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkVpcAssociationIdentifier == nil || len(*v.ServiceNetworkVpcAssociationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkVpcAssociationIdentifier must not be empty")} + } + if v.ServiceNetworkVpcAssociationIdentifier != nil { + if err := encoder.SetURI("serviceNetworkVpcAssociationIdentifier").String(*v.ServiceNetworkVpcAssociationIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetTargetGroup struct { +} + +func (*awsRestjson1_serializeOpGetTargetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetTargetGroup) 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.(*GetTargetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups/{targetGroupIdentifier}") + 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_serializeOpHttpBindingsGetTargetGroupInput(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_serializeOpHttpBindingsGetTargetGroupInput(v *GetTargetGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.TargetGroupIdentifier == nil || len(*v.TargetGroupIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member targetGroupIdentifier must not be empty")} + } + if v.TargetGroupIdentifier != nil { + if err := encoder.SetURI("targetGroupIdentifier").String(*v.TargetGroupIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListAccessLogSubscriptions struct { +} + +func (*awsRestjson1_serializeOpListAccessLogSubscriptions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAccessLogSubscriptions) 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.(*ListAccessLogSubscriptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accesslogsubscriptions") + 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_serializeOpHttpBindingsListAccessLogSubscriptionsInput(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_serializeOpHttpBindingsListAccessLogSubscriptionsInput(v *ListAccessLogSubscriptionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ResourceIdentifier != nil { + encoder.SetQuery("resourceIdentifier").String(*v.ResourceIdentifier) + } + + return nil +} + +type awsRestjson1_serializeOpListListeners struct { +} + +func (*awsRestjson1_serializeOpListListeners) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListListeners) 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.(*ListListenersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners") + 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_serializeOpHttpBindingsListListenersInput(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_serializeOpHttpBindingsListListenersInput(v *ListListenersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListRules struct { +} + +func (*awsRestjson1_serializeOpListRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRules) 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.(*ListRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListRulesInput(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_serializeOpHttpBindingsListRulesInput(v *ListRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListServiceNetworks struct { +} + +func (*awsRestjson1_serializeOpListServiceNetworks) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListServiceNetworks) 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.(*ListServiceNetworksInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworks") + 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_serializeOpHttpBindingsListServiceNetworksInput(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_serializeOpHttpBindingsListServiceNetworksInput(v *ListServiceNetworksInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListServiceNetworkServiceAssociations struct { +} + +func (*awsRestjson1_serializeOpListServiceNetworkServiceAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListServiceNetworkServiceAssociations) 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.(*ListServiceNetworkServiceAssociationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkserviceassociations") + 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_serializeOpHttpBindingsListServiceNetworkServiceAssociationsInput(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_serializeOpHttpBindingsListServiceNetworkServiceAssociationsInput(v *ListServiceNetworkServiceAssociationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ServiceIdentifier != nil { + encoder.SetQuery("serviceIdentifier").String(*v.ServiceIdentifier) + } + + if v.ServiceNetworkIdentifier != nil { + encoder.SetQuery("serviceNetworkIdentifier").String(*v.ServiceNetworkIdentifier) + } + + return nil +} + +type awsRestjson1_serializeOpListServiceNetworkVpcAssociations struct { +} + +func (*awsRestjson1_serializeOpListServiceNetworkVpcAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListServiceNetworkVpcAssociations) 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.(*ListServiceNetworkVpcAssociationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkvpcassociations") + 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_serializeOpHttpBindingsListServiceNetworkVpcAssociationsInput(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_serializeOpHttpBindingsListServiceNetworkVpcAssociationsInput(v *ListServiceNetworkVpcAssociationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ServiceNetworkIdentifier != nil { + encoder.SetQuery("serviceNetworkIdentifier").String(*v.ServiceNetworkIdentifier) + } + + if v.VpcIdentifier != nil { + encoder.SetQuery("vpcIdentifier").String(*v.VpcIdentifier) + } + + return nil +} + +type awsRestjson1_serializeOpListServices struct { +} + +func (*awsRestjson1_serializeOpListServices) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListServices) 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.(*ListServicesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services") + 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_serializeOpHttpBindingsListServicesInput(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_serializeOpHttpBindingsListServicesInput(v *ListServicesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := 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_serializeOpListTargetGroups struct { +} + +func (*awsRestjson1_serializeOpListTargetGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTargetGroups) 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.(*ListTargetGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups") + 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_serializeOpHttpBindingsListTargetGroupsInput(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_serializeOpHttpBindingsListTargetGroupsInput(v *ListTargetGroupsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.TargetGroupType) > 0 { + encoder.SetQuery("targetGroupType").String(string(v.TargetGroupType)) + } + + if v.VpcIdentifier != nil { + encoder.SetQuery("vpcIdentifier").String(*v.VpcIdentifier) + } + + return nil +} + +type awsRestjson1_serializeOpListTargets struct { +} + +func (*awsRestjson1_serializeOpListTargets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTargets) 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.(*ListTargetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups/{targetGroupIdentifier}/listtargets") + 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_serializeOpHttpBindingsListTargetsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListTargetsInput(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_serializeOpHttpBindingsListTargetsInput(v *ListTargetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.TargetGroupIdentifier == nil || len(*v.TargetGroupIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member targetGroupIdentifier must not be empty")} + } + if v.TargetGroupIdentifier != nil { + if err := encoder.SetURI("targetGroupIdentifier").String(*v.TargetGroupIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListTargetsInput(v *ListTargetsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Targets != nil { + ok := object.Key("targets") + if err := awsRestjson1_serializeDocumentTargetList(v.Targets, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutAuthPolicy struct { +} + +func (*awsRestjson1_serializeOpPutAuthPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutAuthPolicy) 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.(*PutAuthPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/authpolicy/{resourceIdentifier}") + 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_serializeOpHttpBindingsPutAuthPolicyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutAuthPolicyInput(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_serializeOpHttpBindingsPutAuthPolicyInput(v *PutAuthPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceIdentifier == nil || len(*v.ResourceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceIdentifier must not be empty")} + } + if v.ResourceIdentifier != nil { + if err := encoder.SetURI("resourceIdentifier").String(*v.ResourceIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutAuthPolicyInput(v *PutAuthPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Policy != nil { + ok := object.Key("policy") + ok.String(*v.Policy) + } + + return nil +} + +type awsRestjson1_serializeOpPutResourcePolicy struct { +} + +func (*awsRestjson1_serializeOpPutResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutResourcePolicy) 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.(*PutResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/resourcepolicy/{resourceArn}") + 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_serializeOpHttpBindingsPutResourcePolicyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutResourcePolicyInput(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_serializeOpHttpBindingsPutResourcePolicyInput(v *PutResourcePolicyInput, 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_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Policy != nil { + ok := object.Key("policy") + ok.String(*v.Policy) + } + + return nil +} + +type awsRestjson1_serializeOpRegisterTargets struct { +} + +func (*awsRestjson1_serializeOpRegisterTargets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRegisterTargets) 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.(*RegisterTargetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups/{targetGroupIdentifier}/registertargets") + 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_serializeOpHttpBindingsRegisterTargetsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRegisterTargetsInput(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_serializeOpHttpBindingsRegisterTargetsInput(v *RegisterTargetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.TargetGroupIdentifier == nil || len(*v.TargetGroupIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member targetGroupIdentifier must not be empty")} + } + if v.TargetGroupIdentifier != nil { + if err := encoder.SetURI("targetGroupIdentifier").String(*v.TargetGroupIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRegisterTargetsInput(v *RegisterTargetsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Targets != nil { + ok := object.Key("targets") + if err := awsRestjson1_serializeDocumentTargetList(v.Targets, ok); 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_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := 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_serializeOpUpdateAccessLogSubscription struct { +} + +func (*awsRestjson1_serializeOpUpdateAccessLogSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAccessLogSubscription) 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.(*UpdateAccessLogSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accesslogsubscriptions/{accessLogSubscriptionIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateAccessLogSubscriptionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAccessLogSubscriptionInput(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_serializeOpHttpBindingsUpdateAccessLogSubscriptionInput(v *UpdateAccessLogSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessLogSubscriptionIdentifier == nil || len(*v.AccessLogSubscriptionIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member accessLogSubscriptionIdentifier must not be empty")} + } + if v.AccessLogSubscriptionIdentifier != nil { + if err := encoder.SetURI("accessLogSubscriptionIdentifier").String(*v.AccessLogSubscriptionIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAccessLogSubscriptionInput(v *UpdateAccessLogSubscriptionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DestinationArn != nil { + ok := object.Key("destinationArn") + ok.String(*v.DestinationArn) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateListener struct { +} + +func (*awsRestjson1_serializeOpUpdateListener) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateListener) 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.(*UpdateListenerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateListenerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateListenerInput(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_serializeOpHttpBindingsUpdateListenerInput(v *UpdateListenerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateListenerInput(v *UpdateListenerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DefaultAction != nil { + ok := object.Key("defaultAction") + if err := awsRestjson1_serializeDocumentRuleAction(v.DefaultAction, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateRule struct { +} + +func (*awsRestjson1_serializeOpUpdateRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateRule) 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.(*UpdateRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateRuleInput(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_serializeOpHttpBindingsUpdateRuleInput(v *UpdateRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ListenerIdentifier == nil || len(*v.ListenerIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member listenerIdentifier must not be empty")} + } + if v.ListenerIdentifier != nil { + if err := encoder.SetURI("listenerIdentifier").String(*v.ListenerIdentifier); err != nil { + return err + } + } + + if v.RuleIdentifier == nil || len(*v.RuleIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ruleIdentifier must not be empty")} + } + if v.RuleIdentifier != nil { + if err := encoder.SetURI("ruleIdentifier").String(*v.RuleIdentifier); err != nil { + return err + } + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateRuleInput(v *UpdateRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("action") + if err := awsRestjson1_serializeDocumentRuleAction(v.Action, ok); err != nil { + return err + } + } + + if v.Match != nil { + ok := object.Key("match") + if err := awsRestjson1_serializeDocumentRuleMatch(v.Match, ok); err != nil { + return err + } + } + + if v.Priority != nil { + ok := object.Key("priority") + ok.Integer(*v.Priority) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateService struct { +} + +func (*awsRestjson1_serializeOpUpdateService) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateService) 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.(*UpdateServiceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/services/{serviceIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateServiceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateServiceInput(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_serializeOpHttpBindingsUpdateServiceInput(v *UpdateServiceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceIdentifier == nil || len(*v.ServiceIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceIdentifier must not be empty")} + } + if v.ServiceIdentifier != nil { + if err := encoder.SetURI("serviceIdentifier").String(*v.ServiceIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateServiceInput(v *UpdateServiceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + if v.CertificateArn != nil { + ok := object.Key("certificateArn") + ok.String(*v.CertificateArn) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateServiceNetwork struct { +} + +func (*awsRestjson1_serializeOpUpdateServiceNetwork) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateServiceNetwork) 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.(*UpdateServiceNetworkInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworks/{serviceNetworkIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateServiceNetworkInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateServiceNetworkInput(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_serializeOpHttpBindingsUpdateServiceNetworkInput(v *UpdateServiceNetworkInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkIdentifier == nil || len(*v.ServiceNetworkIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkIdentifier must not be empty")} + } + if v.ServiceNetworkIdentifier != nil { + if err := encoder.SetURI("serviceNetworkIdentifier").String(*v.ServiceNetworkIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateServiceNetworkInput(v *UpdateServiceNetworkInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateServiceNetworkVpcAssociation struct { +} + +func (*awsRestjson1_serializeOpUpdateServiceNetworkVpcAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateServiceNetworkVpcAssociation) 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.(*UpdateServiceNetworkVpcAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateServiceNetworkVpcAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateServiceNetworkVpcAssociationInput(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_serializeOpHttpBindingsUpdateServiceNetworkVpcAssociationInput(v *UpdateServiceNetworkVpcAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ServiceNetworkVpcAssociationIdentifier == nil || len(*v.ServiceNetworkVpcAssociationIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member serviceNetworkVpcAssociationIdentifier must not be empty")} + } + if v.ServiceNetworkVpcAssociationIdentifier != nil { + if err := encoder.SetURI("serviceNetworkVpcAssociationIdentifier").String(*v.ServiceNetworkVpcAssociationIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateServiceNetworkVpcAssociationInput(v *UpdateServiceNetworkVpcAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecurityGroupIds != nil { + ok := object.Key("securityGroupIds") + if err := awsRestjson1_serializeDocumentSecurityGroupList(v.SecurityGroupIds, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateTargetGroup struct { +} + +func (*awsRestjson1_serializeOpUpdateTargetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateTargetGroup) 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.(*UpdateTargetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/targetgroups/{targetGroupIdentifier}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateTargetGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateTargetGroupInput(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_serializeOpHttpBindingsUpdateTargetGroupInput(v *UpdateTargetGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.TargetGroupIdentifier == nil || len(*v.TargetGroupIdentifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member targetGroupIdentifier must not be empty")} + } + if v.TargetGroupIdentifier != nil { + if err := encoder.SetURI("targetGroupIdentifier").String(*v.TargetGroupIdentifier); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateTargetGroupInput(v *UpdateTargetGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HealthCheck != nil { + ok := object.Key("healthCheck") + if err := awsRestjson1_serializeDocumentHealthCheckConfig(v.HealthCheck, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFixedResponseAction(v *types.FixedResponseAction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StatusCode != nil { + ok := object.Key("statusCode") + ok.Integer(*v.StatusCode) + } + + return nil +} + +func awsRestjson1_serializeDocumentForwardAction(v *types.ForwardAction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TargetGroups != nil { + ok := object.Key("targetGroups") + if err := awsRestjson1_serializeDocumentWeightedTargetGroupList(v.TargetGroups, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentHeaderMatch(v *types.HeaderMatch, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CaseSensitive != nil { + ok := object.Key("caseSensitive") + ok.Boolean(*v.CaseSensitive) + } + + if v.Match != nil { + ok := object.Key("match") + if err := awsRestjson1_serializeDocumentHeaderMatchType(v.Match, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentHeaderMatchList(v []types.HeaderMatch, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentHeaderMatch(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentHeaderMatchType(v types.HeaderMatchType, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.HeaderMatchTypeMemberContains: + av := object.Key("contains") + av.String(uv.Value) + + case *types.HeaderMatchTypeMemberExact: + av := object.Key("exact") + av.String(uv.Value) + + case *types.HeaderMatchTypeMemberPrefix: + av := object.Key("prefix") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentHealthCheckConfig(v *types.HealthCheckConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Enabled != nil { + ok := object.Key("enabled") + ok.Boolean(*v.Enabled) + } + + if v.HealthCheckIntervalSeconds != nil { + ok := object.Key("healthCheckIntervalSeconds") + ok.Integer(*v.HealthCheckIntervalSeconds) + } + + if v.HealthCheckTimeoutSeconds != nil { + ok := object.Key("healthCheckTimeoutSeconds") + ok.Integer(*v.HealthCheckTimeoutSeconds) + } + + if v.HealthyThresholdCount != nil { + ok := object.Key("healthyThresholdCount") + ok.Integer(*v.HealthyThresholdCount) + } + + if v.Matcher != nil { + ok := object.Key("matcher") + if err := awsRestjson1_serializeDocumentMatcher(v.Matcher, ok); err != nil { + return err + } + } + + if v.Path != nil { + ok := object.Key("path") + ok.String(*v.Path) + } + + if v.Port != nil { + ok := object.Key("port") + ok.Integer(*v.Port) + } + + if len(v.Protocol) > 0 { + ok := object.Key("protocol") + ok.String(string(v.Protocol)) + } + + if len(v.ProtocolVersion) > 0 { + ok := object.Key("protocolVersion") + ok.String(string(v.ProtocolVersion)) + } + + if v.UnhealthyThresholdCount != nil { + ok := object.Key("unhealthyThresholdCount") + ok.Integer(*v.UnhealthyThresholdCount) + } + + return nil +} + +func awsRestjson1_serializeDocumentHttpMatch(v *types.HttpMatch, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HeaderMatches != nil { + ok := object.Key("headerMatches") + if err := awsRestjson1_serializeDocumentHeaderMatchList(v.HeaderMatches, ok); err != nil { + return err + } + } + + if v.Method != nil { + ok := object.Key("method") + ok.String(*v.Method) + } + + if v.PathMatch != nil { + ok := object.Key("pathMatch") + if err := awsRestjson1_serializeDocumentPathMatch(v.PathMatch, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentMatcher(v types.Matcher, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.MatcherMemberHttpCode: + av := object.Key("httpCode") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentPathMatch(v *types.PathMatch, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CaseSensitive != nil { + ok := object.Key("caseSensitive") + ok.Boolean(*v.CaseSensitive) + } + + if v.Match != nil { + ok := object.Key("match") + if err := awsRestjson1_serializeDocumentPathMatchType(v.Match, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPathMatchType(v types.PathMatchType, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.PathMatchTypeMemberExact: + av := object.Key("exact") + av.String(uv.Value) + + case *types.PathMatchTypeMemberPrefix: + av := object.Key("prefix") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentRuleAction(v types.RuleAction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.RuleActionMemberFixedResponse: + av := object.Key("fixedResponse") + if err := awsRestjson1_serializeDocumentFixedResponseAction(&uv.Value, av); err != nil { + return err + } + + case *types.RuleActionMemberForward: + av := object.Key("forward") + if err := awsRestjson1_serializeDocumentForwardAction(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentRuleMatch(v types.RuleMatch, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.RuleMatchMemberHttpMatch: + av := object.Key("httpMatch") + if err := awsRestjson1_serializeDocumentHttpMatch(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentRuleUpdate(v *types.RuleUpdate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("action") + if err := awsRestjson1_serializeDocumentRuleAction(v.Action, ok); err != nil { + return err + } + } + + if v.Match != nil { + ok := object.Key("match") + if err := awsRestjson1_serializeDocumentRuleMatch(v.Match, ok); err != nil { + return err + } + } + + if v.Priority != nil { + ok := object.Key("priority") + ok.Integer(*v.Priority) + } + + if v.RuleIdentifier != nil { + ok := object.Key("ruleIdentifier") + ok.String(*v.RuleIdentifier) + } + + return nil +} + +func awsRestjson1_serializeDocumentRuleUpdateList(v []types.RuleUpdate, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRuleUpdate(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSecurityGroupList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentTarget(v *types.Target, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Port != nil { + ok := object.Key("port") + ok.Integer(*v.Port) + } + + return nil +} + +func awsRestjson1_serializeDocumentTargetGroupConfig(v *types.TargetGroupConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HealthCheck != nil { + ok := object.Key("healthCheck") + if err := awsRestjson1_serializeDocumentHealthCheckConfig(v.HealthCheck, ok); err != nil { + return err + } + } + + if len(v.IpAddressType) > 0 { + ok := object.Key("ipAddressType") + ok.String(string(v.IpAddressType)) + } + + if v.Port != nil { + ok := object.Key("port") + ok.Integer(*v.Port) + } + + if len(v.Protocol) > 0 { + ok := object.Key("protocol") + ok.String(string(v.Protocol)) + } + + if len(v.ProtocolVersion) > 0 { + ok := object.Key("protocolVersion") + ok.String(string(v.ProtocolVersion)) + } + + if v.VpcIdentifier != nil { + ok := object.Key("vpcIdentifier") + ok.String(*v.VpcIdentifier) + } + + return nil +} + +func awsRestjson1_serializeDocumentTargetList(v []types.Target, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTarget(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentWeightedTargetGroup(v *types.WeightedTargetGroup, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TargetGroupIdentifier != nil { + ok := object.Key("targetGroupIdentifier") + ok.String(*v.TargetGroupIdentifier) + } + + if v.Weight != nil { + ok := object.Key("weight") + ok.Integer(*v.Weight) + } + + return nil +} + +func awsRestjson1_serializeDocumentWeightedTargetGroupList(v []types.WeightedTargetGroup, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentWeightedTargetGroup(&v[i], av); err != nil { + return err + } + } + return nil +} diff --git a/service/vpclattice/types/enums.go b/service/vpclattice/types/enums.go new file mode 100644 index 00000000000..39527a1c1f3 --- /dev/null +++ b/service/vpclattice/types/enums.go @@ -0,0 +1,346 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AuthPolicyState string + +// Enum values for AuthPolicyState +const ( + AuthPolicyStateActive AuthPolicyState = "Active" + AuthPolicyStateInactive AuthPolicyState = "Inactive" +) + +// Values returns all known values for AuthPolicyState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (AuthPolicyState) Values() []AuthPolicyState { + return []AuthPolicyState{ + "Active", + "Inactive", + } +} + +type AuthType string + +// Enum values for AuthType +const ( + AuthTypeNone AuthType = "NONE" + AuthTypeAwsIam AuthType = "AWS_IAM" +) + +// Values returns all known values for AuthType. Note that this can be expanded in +// the future, and so it is only as up to date as the client. The ordering of this +// slice is not guaranteed to be stable across updates. +func (AuthType) Values() []AuthType { + return []AuthType{ + "NONE", + "AWS_IAM", + } +} + +type HealthCheckProtocolVersion string + +// Enum values for HealthCheckProtocolVersion +const ( + // Indicates use of HTTP/1.1 to send requests to target + HealthCheckProtocolVersionHttp1 HealthCheckProtocolVersion = "HTTP1" + // Indicates use of HTTP/2 to send requests to target + HealthCheckProtocolVersionHttp2 HealthCheckProtocolVersion = "HTTP2" +) + +// Values returns all known values for HealthCheckProtocolVersion. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (HealthCheckProtocolVersion) Values() []HealthCheckProtocolVersion { + return []HealthCheckProtocolVersion{ + "HTTP1", + "HTTP2", + } +} + +type IpAddressType string + +// Enum values for IpAddressType +const ( + // Indicates IPv4 address type + IpAddressTypeIpv4 IpAddressType = "IPV4" + // Indicates IPv6 address type + IpAddressTypeIpv6 IpAddressType = "IPV6" +) + +// Values returns all known values for IpAddressType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (IpAddressType) Values() []IpAddressType { + return []IpAddressType{ + "IPV4", + "IPV6", + } +} + +type ListenerProtocol string + +// Enum values for ListenerProtocol +const ( + // Indicates HTTP protocol + ListenerProtocolHttp ListenerProtocol = "HTTP" + // Indicates HTTPS protocol + ListenerProtocolHttps ListenerProtocol = "HTTPS" +) + +// Values returns all known values for ListenerProtocol. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ListenerProtocol) Values() []ListenerProtocol { + return []ListenerProtocol{ + "HTTP", + "HTTPS", + } +} + +type ServiceNetworkServiceAssociationStatus string + +// Enum values for ServiceNetworkServiceAssociationStatus +const ( + // ServiceNetwork and Service association creation in progress + ServiceNetworkServiceAssociationStatusCreateInProgress ServiceNetworkServiceAssociationStatus = "CREATE_IN_PROGRESS" + // ServiceNetwork and Service association is active + ServiceNetworkServiceAssociationStatusActive ServiceNetworkServiceAssociationStatus = "ACTIVE" + // ServiceNetwork and Service association deletion in progress + ServiceNetworkServiceAssociationStatusDeleteInProgress ServiceNetworkServiceAssociationStatus = "DELETE_IN_PROGRESS" + // ServiceNetwork and Service association creation failed. + ServiceNetworkServiceAssociationStatusCreateFailed ServiceNetworkServiceAssociationStatus = "CREATE_FAILED" + // ServiceNetwork and Service association deletion failed + ServiceNetworkServiceAssociationStatusDeleteFailed ServiceNetworkServiceAssociationStatus = "DELETE_FAILED" +) + +// Values returns all known values for ServiceNetworkServiceAssociationStatus. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (ServiceNetworkServiceAssociationStatus) Values() []ServiceNetworkServiceAssociationStatus { + return []ServiceNetworkServiceAssociationStatus{ + "CREATE_IN_PROGRESS", + "ACTIVE", + "DELETE_IN_PROGRESS", + "CREATE_FAILED", + "DELETE_FAILED", + } +} + +type ServiceNetworkVpcAssociationStatus string + +// Enum values for ServiceNetworkVpcAssociationStatus +const ( + // ServiceNetwork and Vpc association creation in progress + ServiceNetworkVpcAssociationStatusCreateInProgress ServiceNetworkVpcAssociationStatus = "CREATE_IN_PROGRESS" + // ServiceNetwork and Vpc association is active + ServiceNetworkVpcAssociationStatusActive ServiceNetworkVpcAssociationStatus = "ACTIVE" + // ServiceNetwork and Vpc association update in progress + ServiceNetworkVpcAssociationStatusUpdateInProgress ServiceNetworkVpcAssociationStatus = "UPDATE_IN_PROGRESS" + // ServiceNetwork and Vpc association deletion in progress + ServiceNetworkVpcAssociationStatusDeleteInProgress ServiceNetworkVpcAssociationStatus = "DELETE_IN_PROGRESS" + // ServiceNetwork and Vpc association creation failed. + ServiceNetworkVpcAssociationStatusCreateFailed ServiceNetworkVpcAssociationStatus = "CREATE_FAILED" + // ServiceNetwork and Vpc association deletion failed + ServiceNetworkVpcAssociationStatusDeleteFailed ServiceNetworkVpcAssociationStatus = "DELETE_FAILED" + // ServiceNetwork and Vpc association update failed + ServiceNetworkVpcAssociationStatusUpdateFailed ServiceNetworkVpcAssociationStatus = "UPDATE_FAILED" +) + +// Values returns all known values for ServiceNetworkVpcAssociationStatus. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (ServiceNetworkVpcAssociationStatus) Values() []ServiceNetworkVpcAssociationStatus { + return []ServiceNetworkVpcAssociationStatus{ + "CREATE_IN_PROGRESS", + "ACTIVE", + "UPDATE_IN_PROGRESS", + "DELETE_IN_PROGRESS", + "CREATE_FAILED", + "DELETE_FAILED", + "UPDATE_FAILED", + } +} + +type ServiceStatus string + +// Enum values for ServiceStatus +const ( + // Service is active. + ServiceStatusActive ServiceStatus = "ACTIVE" + // Service creation in progress. + ServiceStatusCreateInProgress ServiceStatus = "CREATE_IN_PROGRESS" + // Service deletion in progress + ServiceStatusDeleteInProgress ServiceStatus = "DELETE_IN_PROGRESS" + // Service creation failed + ServiceStatusCreateFailed ServiceStatus = "CREATE_FAILED" + // Service deletion failed. + ServiceStatusDeleteFailed ServiceStatus = "DELETE_FAILED" +) + +// Values returns all known values for ServiceStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ServiceStatus) Values() []ServiceStatus { + return []ServiceStatus{ + "ACTIVE", + "CREATE_IN_PROGRESS", + "DELETE_IN_PROGRESS", + "CREATE_FAILED", + "DELETE_FAILED", + } +} + +type TargetGroupProtocol string + +// Enum values for TargetGroupProtocol +const ( + // Indicates HTTP protocol + TargetGroupProtocolHttp TargetGroupProtocol = "HTTP" + // Indicates HTTPS protocol + TargetGroupProtocolHttps TargetGroupProtocol = "HTTPS" +) + +// Values returns all known values for TargetGroupProtocol. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (TargetGroupProtocol) Values() []TargetGroupProtocol { + return []TargetGroupProtocol{ + "HTTP", + "HTTPS", + } +} + +type TargetGroupProtocolVersion string + +// Enum values for TargetGroupProtocolVersion +const ( + // Indicates use of HTTP/1.1 to send requests to target + TargetGroupProtocolVersionHttp1 TargetGroupProtocolVersion = "HTTP1" + // Indicates use of HTTP/2 to send requests to target + TargetGroupProtocolVersionHttp2 TargetGroupProtocolVersion = "HTTP2" + // Indicates use of gRPC to send requests to target + TargetGroupProtocolVersionGrpc TargetGroupProtocolVersion = "GRPC" +) + +// Values returns all known values for TargetGroupProtocolVersion. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (TargetGroupProtocolVersion) Values() []TargetGroupProtocolVersion { + return []TargetGroupProtocolVersion{ + "HTTP1", + "HTTP2", + "GRPC", + } +} + +type TargetGroupStatus string + +// Enum values for TargetGroupStatus +const ( + // TargetGroup creation in progress + TargetGroupStatusCreateInProgress TargetGroupStatus = "CREATE_IN_PROGRESS" + // TargetGroup is active + TargetGroupStatusActive TargetGroupStatus = "ACTIVE" + // TargetGroup deletion in progress + TargetGroupStatusDeleteInProgress TargetGroupStatus = "DELETE_IN_PROGRESS" + // TargetGroup creation failed. + TargetGroupStatusCreateFailed TargetGroupStatus = "CREATE_FAILED" + // TargetGroup deletion failed + TargetGroupStatusDeleteFailed TargetGroupStatus = "DELETE_FAILED" +) + +// Values returns all known values for TargetGroupStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (TargetGroupStatus) Values() []TargetGroupStatus { + return []TargetGroupStatus{ + "CREATE_IN_PROGRESS", + "ACTIVE", + "DELETE_IN_PROGRESS", + "CREATE_FAILED", + "DELETE_FAILED", + } +} + +type TargetGroupType string + +// Enum values for TargetGroupType +const ( + // Indicates targets in this target group are IP + TargetGroupTypeIp TargetGroupType = "IP" + // Indicates targets in this target group are Lambda + TargetGroupTypeLambda TargetGroupType = "LAMBDA" + // Indicates targets in this target group are EC2 instances + TargetGroupTypeInstance TargetGroupType = "INSTANCE" + // Indicates target in this target group is an ALB + TargetGroupTypeAlb TargetGroupType = "ALB" +) + +// Values returns all known values for TargetGroupType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (TargetGroupType) Values() []TargetGroupType { + return []TargetGroupType{ + "IP", + "LAMBDA", + "INSTANCE", + "ALB", + } +} + +type TargetStatus string + +// Enum values for TargetStatus +const ( + // The target is deregistering and connection draining is in process. + TargetStatusDraining TargetStatus = "DRAINING" + // Health checks are disabled. + TargetStatusUnavailable TargetStatus = "UNAVAILABLE" + // The target is healthy. + TargetStatusHealthy TargetStatus = "HEALTHY" + // The target failed the health check. + TargetStatusUnhealthy TargetStatus = "UNHEALTHY" + // The initial health check is in progress. + TargetStatusInitial TargetStatus = "INITIAL" + // The target group is not used in a listener rule. + TargetStatusUnused TargetStatus = "UNUSED" +) + +// Values returns all known values for TargetStatus. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (TargetStatus) Values() []TargetStatus { + return []TargetStatus{ + "DRAINING", + "UNAVAILABLE", + "HEALTHY", + "UNHEALTHY", + "INITIAL", + "UNUSED", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "other" +) + +// Values returns all known values for ValidationExceptionReason. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "unknownOperation", + "cannotParse", + "fieldValidationFailed", + "other", + } +} diff --git a/service/vpclattice/types/errors.go b/service/vpclattice/types/errors.go new file mode 100644 index 00000000000..f446a31195c --- /dev/null +++ b/service/vpclattice/types/errors.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The user does not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request conflicts with the current state of the resource. Updating or +// deleting a resource can cause an inconsistent state. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An unexpected error occurred while processing the request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request references a resource that does not exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would cause a service quota to be exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + ServiceCode *string + QuotaCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The limit on the number of requests per second was exceeded. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + ServiceCode *string + QuotaCode *string + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input does not satisfy the constraints specified by an Amazon Web Services +// service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/vpclattice/types/types.go b/service/vpclattice/types/types.go new file mode 100644 index 00000000000..350d8da7840 --- /dev/null +++ b/service/vpclattice/types/types.go @@ -0,0 +1,804 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Summary information about an access log subscription. +type AccessLogSubscriptionSummary struct { + + // The Amazon Resource Name (ARN) of the access log subscription + // + // This member is required. + Arn *string + + // The date and time that the access log subscription was created, specified in + // ISO-8601 format. + // + // This member is required. + CreatedAt *time.Time + + // The Amazon Resource Name (ARN) of the destination. + // + // This member is required. + DestinationArn *string + + // The ID of the access log subscription. + // + // This member is required. + Id *string + + // The date and time that the access log subscription was last updated, specified + // in ISO-8601 format. + // + // This member is required. + LastUpdatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service or service network. + // + // This member is required. + ResourceArn *string + + // The ID of the service or service network. + // + // This member is required. + ResourceId *string + + noSmithyDocumentSerde +} + +// Describes the DNS information of a service. +type DnsEntry struct { + + // The domain name of the service. + DomainName *string + + // The ID of the hosted zone. + HostedZoneId *string + + noSmithyDocumentSerde +} + +// Information about an action that returns a custom HTTP response. +type FixedResponseAction struct { + + // The HTTP response code. + // + // This member is required. + StatusCode *int32 + + noSmithyDocumentSerde +} + +// Describes a forward action. You can use forward actions to route requests to one +// or more target groups. +type ForwardAction struct { + + // The target groups. Traffic matching the rule is forwarded to the specified + // target groups. With forward actions, you can assign a weight that controls the + // prioritization and selection of each target group. This means that requests are + // distributed to individual target groups based on their weights. For example, if + // two target groups have the same weight, each target group receives half of the + // traffic. The default value is 1. This means that if only one target group is + // provided, there is no need to set the weight; 100% of traffic will go to that + // target group. + // + // This member is required. + TargetGroups []WeightedTargetGroup + + noSmithyDocumentSerde +} + +// Describes the constraints for a header match. Matches incoming requests with +// rule based on request header value before applying rule action. +type HeaderMatch struct { + + // The header match type. + // + // This member is required. + Match HeaderMatchType + + // The name of the header. + // + // This member is required. + Name *string + + // Indicates whether the match is case sensitive. Defaults to false. + CaseSensitive *bool + + noSmithyDocumentSerde +} + +// Describes a header match type. Only one can be provided. +// +// The following types satisfy this interface: +// +// HeaderMatchTypeMemberContains +// HeaderMatchTypeMemberExact +// HeaderMatchTypeMemberPrefix +type HeaderMatchType interface { + isHeaderMatchType() +} + +// Specifies a contains type match. +type HeaderMatchTypeMemberContains struct { + Value string + + noSmithyDocumentSerde +} + +func (*HeaderMatchTypeMemberContains) isHeaderMatchType() {} + +// Specifies an exact type match. +type HeaderMatchTypeMemberExact struct { + Value string + + noSmithyDocumentSerde +} + +func (*HeaderMatchTypeMemberExact) isHeaderMatchType() {} + +// Specifies a prefix type match. Matches the value with the prefix. +type HeaderMatchTypeMemberPrefix struct { + Value string + + noSmithyDocumentSerde +} + +func (*HeaderMatchTypeMemberPrefix) isHeaderMatchType() {} + +// The health check configuration of a target group. Health check configurations +// aren't used for LAMBDA and ALB target groups. +type HealthCheckConfig struct { + + // Indicates whether health checking is enabled. + Enabled *bool + + // The approximate amount of time, in seconds, between health checks of an + // individual target. The range is 5–300 seconds. The default is 30 seconds. + HealthCheckIntervalSeconds *int32 + + // The amount of time, in seconds, to wait before reporting a target as unhealthy. + // The range is 1–120 seconds. The default is 5 seconds. + HealthCheckTimeoutSeconds *int32 + + // The number of consecutive successful health checks required before considering + // an unhealthy target healthy. The range is 2–10. The default is 5. + HealthyThresholdCount *int32 + + // The codes to use when checking for a successful response from a target. These + // are called Success codes in the console. + Matcher Matcher + + // The destination for health checks on the targets. If the protocol version is + // HTTP/1.1 or HTTP/2, specify a valid URI (for example, /path?query). The default + // path is /. Health checks are not supported if the protocol version is gRPC, + // however, you can choose HTTP/1.1 or HTTP/2 and specify a valid URI. + Path *string + + // The port used when performing health checks on targets. The default setting is + // the port that a target receives traffic on. + Port *int32 + + // The protocol used when performing health checks on targets. The possible + // protocols are HTTP and HTTPS. The default is HTTP. + Protocol TargetGroupProtocol + + // The protocol version used when performing health checks on targets. The possible + // protocol versions are HTTP1 and HTTP2. + ProtocolVersion HealthCheckProtocolVersion + + // The number of consecutive failed health checks required before considering a + // target unhealthy. The range is 2–10. The default is 2. + UnhealthyThresholdCount *int32 + + noSmithyDocumentSerde +} + +// Describes criteria that can be applied to incoming requests. +type HttpMatch struct { + + // The header matches. Matches incoming requests with rule based on request header + // value before applying rule action. + HeaderMatches []HeaderMatch + + // The HTTP method type. + Method *string + + // The path match. + PathMatch *PathMatch + + noSmithyDocumentSerde +} + +// Summary information about a listener. +type ListenerSummary struct { + + // The Amazon Resource Name (ARN) of the listener. + Arn *string + + // The date and time that the listener was created, specified in ISO-8601 format. + CreatedAt *time.Time + + // The ID of the listener. + Id *string + + // The date and time that the listener was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The name of the listener. + Name *string + + // The listener port. + Port *int32 + + // The listener protocol. + Protocol ListenerProtocol + + noSmithyDocumentSerde +} + +// The codes to use when checking for a successful response from a target for +// health checks. +// +// The following types satisfy this interface: +// +// MatcherMemberHttpCode +type Matcher interface { + isMatcher() +} + +// The HTTP code to use when checking for a successful response from a target. +type MatcherMemberHttpCode struct { + Value string + + noSmithyDocumentSerde +} + +func (*MatcherMemberHttpCode) isMatcher() {} + +// Describes the conditions that can be applied when matching a path for incoming +// requests. +type PathMatch struct { + + // The type of path match. + // + // This member is required. + Match PathMatchType + + // Indicates whether the match is case sensitive. Defaults to false. + CaseSensitive *bool + + noSmithyDocumentSerde +} + +// Describes a path match type. Each rule can include only one of the following +// types of paths. +// +// The following types satisfy this interface: +// +// PathMatchTypeMemberExact +// PathMatchTypeMemberPrefix +type PathMatchType interface { + isPathMatchType() +} + +// An exact match of the path. +type PathMatchTypeMemberExact struct { + Value string + + noSmithyDocumentSerde +} + +func (*PathMatchTypeMemberExact) isPathMatchType() {} + +// A prefix match of the path. +type PathMatchTypeMemberPrefix struct { + Value string + + noSmithyDocumentSerde +} + +func (*PathMatchTypeMemberPrefix) isPathMatchType() {} + +// Describes the action for a rule. Each rule must include exactly one of the +// following types of actions: forward or fixed-response, and it must be the last +// action to be performed. +// +// The following types satisfy this interface: +// +// RuleActionMemberFixedResponse +// RuleActionMemberForward +type RuleAction interface { + isRuleAction() +} + +// Describes the rule action that returns a custom HTTP response. +type RuleActionMemberFixedResponse struct { + Value FixedResponseAction + + noSmithyDocumentSerde +} + +func (*RuleActionMemberFixedResponse) isRuleAction() {} + +// The forward action. Traffic that matches the rule is forwarded to the specified +// target groups. +type RuleActionMemberForward struct { + Value ForwardAction + + noSmithyDocumentSerde +} + +func (*RuleActionMemberForward) isRuleAction() {} + +// Describes a rule match. +// +// The following types satisfy this interface: +// +// RuleMatchMemberHttpMatch +type RuleMatch interface { + isRuleMatch() +} + +// The HTTP criteria that a rule must match. +type RuleMatchMemberHttpMatch struct { + Value HttpMatch + + noSmithyDocumentSerde +} + +func (*RuleMatchMemberHttpMatch) isRuleMatch() {} + +// Summary information about the listener rule. +type RuleSummary struct { + + // The Amazon Resource Name (ARN) of the rule. + Arn *string + + // The date and time that the listener rule was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The ID of the rule. + Id *string + + // Indicates whether this is the default rule. Listener rules are created when you + // create a listener. Each listener has a default rule for checking connection + // requests. + IsDefault *bool + + // The date and time that the listener rule was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The name of the rule. + Name *string + + // The priority of the rule. + Priority *int32 + + noSmithyDocumentSerde +} + +// Represents an object when updating a rule. +type RuleUpdate struct { + + // The ID or Amazon Resource Name (ARN) of the rule. + // + // This member is required. + RuleIdentifier *string + + // The rule action. + Action RuleAction + + // The rule match. + Match RuleMatch + + // The rule priority. A listener can't have multiple rules with the same priority. + Priority *int32 + + noSmithyDocumentSerde +} + +// Describes a rule update that failed. +type RuleUpdateFailure struct { + + // The failure code. + FailureCode *string + + // The failure message. + FailureMessage *string + + // The ID or Amazon Resource Name (ARN) of the rule. + RuleIdentifier *string + + noSmithyDocumentSerde +} + +// Describes a successful rule update. +type RuleUpdateSuccess struct { + + // The action for the default rule. + Action RuleAction + + // The Amazon Resource Name (ARN) of the listener. + Arn *string + + // The ID of the listener. + Id *string + + // Indicates whether this is the default rule. + IsDefault *bool + + // The rule match. + Match RuleMatch + + // The name of the listener. + Name *string + + // The rule priority. + Priority *int32 + + noSmithyDocumentSerde +} + +// Summary information about the association between a service network and a +// service. +type ServiceNetworkServiceAssociationSummary struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The date and time that the association was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The account that created the association. + CreatedBy *string + + // The custom domain name of the service. + CustomDomainName *string + + // DNS information about the service. + DnsEntry *DnsEntry + + // The ID of the association. + Id *string + + // The Amazon Resource Name (ARN) of the service. + ServiceArn *string + + // The ID of the service. + ServiceId *string + + // The name of the service. + ServiceName *string + + // The Amazon Resource Name (ARN) of the service network. + ServiceNetworkArn *string + + // The ID of the service network. + ServiceNetworkId *string + + // The name of the service network. + ServiceNetworkName *string + + // The status. If the deletion fails, try to delete again. + Status ServiceNetworkServiceAssociationStatus + + noSmithyDocumentSerde +} + +// Summary information about a service network. +type ServiceNetworkSummary struct { + + // The Amazon Resource Name (ARN) of the service network. + Arn *string + + // The date and time that the service network was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The ID of the service network. + Id *string + + // The date and time that the service network was last updated, specified in + // ISO-8601 format. + LastUpdatedAt *time.Time + + // The name of the service network. + Name *string + + // The number of services associated with the service network. + NumberOfAssociatedServices *int64 + + // The number of VPCs associated with the service network. + NumberOfAssociatedVPCs *int64 + + noSmithyDocumentSerde +} + +// Summary information about an association between a service network and a VPC. +type ServiceNetworkVpcAssociationSummary struct { + + // The Amazon Resource Name (ARN) of the association. + Arn *string + + // The date and time that the association was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The account that created the association. + CreatedBy *string + + // The ID of the association. + Id *string + + // The date and time that the association was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The Amazon Resource Name (ARN) of the service network. + ServiceNetworkArn *string + + // The ID of the service network. + ServiceNetworkId *string + + // The name of the service network. + ServiceNetworkName *string + + // The status. + Status ServiceNetworkVpcAssociationStatus + + // The ID of the VPC. + VpcId *string + + noSmithyDocumentSerde +} + +// Summary information about a service. +type ServiceSummary struct { + + // The Amazon Resource Name (ARN) of the service. + Arn *string + + // The date and time that the service was created, specified in ISO-8601 format. + CreatedAt *time.Time + + // The custom domain name of the service. + CustomDomainName *string + + // DNS information about the service. + DnsEntry *DnsEntry + + // The ID of the service. + Id *string + + // The date and time that the service was last updated. The format is ISO-8601. + LastUpdatedAt *time.Time + + // The name of the service. + Name *string + + // The status. + Status ServiceStatus + + noSmithyDocumentSerde +} + +// Describes a target. +type Target struct { + + // The ID of the target. If the target type of the target group is INSTANCE, this + // is an instance ID. If the target type is IP , this is an IP address. If the + // target type is LAMBDA, this is the ARN of the Lambda function. If the target + // type is ALB, this is the ARN of the Application Load Balancer. + // + // This member is required. + Id *string + + // The port on which the target is listening. For HTTP, the default is 80. For + // HTTPS, the default is 443. + Port *int32 + + noSmithyDocumentSerde +} + +// Describes a target failure. +type TargetFailure struct { + + // The failure code. + FailureCode *string + + // The failure message. + FailureMessage *string + + // The ID of the target. If the target type of the target group is INSTANCE, this + // is an instance ID. If the target type is IP , this is an IP address. If the + // target type is LAMBDA, this is the ARN of the Lambda function. If the target + // type is ALB, this is the ARN of the Application Load Balancer. + Id *string + + // The port on which the target is listening. This parameter doesn't apply if the + // target is a Lambda function. + Port *int32 + + noSmithyDocumentSerde +} + +// Describes the configuration of a target group. Lambda functions don't support +// target group configuration. +type TargetGroupConfig struct { + + // The port on which the targets are listening. For HTTP, the default is 80. For + // HTTPS, the default is 443 + // + // This member is required. + Port *int32 + + // The protocol to use for routing traffic to the targets. Default is the protocol + // of a target group. + // + // This member is required. + Protocol TargetGroupProtocol + + // The ID of the VPC. + // + // This member is required. + VpcIdentifier *string + + // The health check configuration. + HealthCheck *HealthCheckConfig + + // The type of IP address used for the target group. The possible values are ipv4 + // and ipv6. This is an optional parameter. If not specified, the IP address type + // defaults to ipv4. + IpAddressType IpAddressType + + // The protocol version. Default value is HTTP1. + ProtocolVersion TargetGroupProtocolVersion + + noSmithyDocumentSerde +} + +// Summary information about a target group. +type TargetGroupSummary struct { + + // The ARN (Amazon Resource Name) of the target group. + Arn *string + + // The date and time that the target group was created, specified in ISO-8601 + // format. + CreatedAt *time.Time + + // The ID of the target group. + Id *string + + // The type of IP address used for the target group. The possible values are ipv4 + // and ipv6. This is an optional parameter. If not specified, the IP address type + // defaults to ipv4. + IpAddressType IpAddressType + + // The date and time that the target group was last updated, specified in ISO-8601 + // format. + LastUpdatedAt *time.Time + + // The name of the target group. + Name *string + + // The port of the target group. + Port *int32 + + // The protocol of the target group. + Protocol TargetGroupProtocol + + // The list of Amazon Resource Names (ARNs) of the service. + ServiceArns []string + + // The status. + Status TargetGroupStatus + + // The target group type. + Type TargetGroupType + + // The ID of the VPC of the target group. + VpcIdentifier *string + + noSmithyDocumentSerde +} + +// Summary information about a target. +type TargetSummary struct { + + // The ID of the target. If the target type of the target group is INSTANCE, this + // is an instance ID. If the target type is IP , this is an IP address. If the + // target type is LAMBDA, this is the ARN of the Lambda function. If the target + // type is ALB, this is the ARN of the Application Load Balancer. + Id *string + + // The port on which the target is listening. + Port *int32 + + // The code for why the target status is what it is. + ReasonCode *string + + // The status of the target. + // + // * Draining: The target is being deregistered. No new + // connections will be sent to this target while current connections are being + // drained. Default draining time is 5 minutes. + // + // * Unavailable: Health checks are + // unavailable for the target group. + // + // * Healthy: The target is healthy. + // + // * + // Unhealthy: The target is unhealthy. + // + // * Initial: Initial health checks on the + // target are being performed. + // + // * Unused: Target group is not used in a service. + Status TargetStatus + + noSmithyDocumentSerde +} + +// Describes a validation failure. +type ValidationExceptionField struct { + + // Additional details about why the validation failed. + // + // This member is required. + Message *string + + // The name of the validation exception. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Describes the weight of a target group. +type WeightedTargetGroup struct { + + // The ID or Amazon Resource Name (ARN) of the target group. + // + // This member is required. + TargetGroupIdentifier *string + + // Only required if you specify multiple target groups for a forward action. The + // "weight" determines how requests are distributed to the target group. For + // example, if you specify two target groups, each with a weight of 10, each target + // group receives half the requests. If you specify two target groups, one with a + // weight of 10 and the other with a weight of 20, the target group with a weight + // of 20 receives twice as many requests as the other target group. If there's only + // one target group specified, then the default value is 100. + Weight *int32 + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isHeaderMatchType() {} +func (*UnknownUnionMember) isMatcher() {} +func (*UnknownUnionMember) isPathMatchType() {} +func (*UnknownUnionMember) isRuleAction() {} +func (*UnknownUnionMember) isRuleMatch() {} diff --git a/service/vpclattice/types/types_exported_test.go b/service/vpclattice/types/types_exported_test.go new file mode 100644 index 00000000000..04018331c7e --- /dev/null +++ b/service/vpclattice/types/types_exported_test.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" +) + +func ExampleHeaderMatchType_outputUsage() { + var union types.HeaderMatchType + // type switches can be used to check the union value + switch v := union.(type) { + case *types.HeaderMatchTypeMemberContains: + _ = v.Value // Value is string + + case *types.HeaderMatchTypeMemberExact: + _ = v.Value // Value is string + + case *types.HeaderMatchTypeMemberPrefix: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string +var _ *string +var _ *string + +func ExampleMatcher_outputUsage() { + var union types.Matcher + // type switches can be used to check the union value + switch v := union.(type) { + case *types.MatcherMemberHttpCode: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string + +func ExamplePathMatchType_outputUsage() { + var union types.PathMatchType + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PathMatchTypeMemberExact: + _ = v.Value // Value is string + + case *types.PathMatchTypeMemberPrefix: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string +var _ *string + +func ExampleRuleAction_outputUsage() { + var union types.RuleAction + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RuleActionMemberFixedResponse: + _ = v.Value // Value is types.FixedResponseAction + + case *types.RuleActionMemberForward: + _ = v.Value // Value is types.ForwardAction + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ForwardAction +var _ *types.FixedResponseAction + +func ExampleRuleMatch_outputUsage() { + var union types.RuleMatch + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RuleMatchMemberHttpMatch: + _ = v.Value // Value is types.HttpMatch + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.HttpMatch diff --git a/service/vpclattice/validators.go b/service/vpclattice/validators.go new file mode 100644 index 00000000000..ec0fb2d3adf --- /dev/null +++ b/service/vpclattice/validators.go @@ -0,0 +1,2273 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpBatchUpdateRule struct { +} + +func (*validateOpBatchUpdateRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchUpdateRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchUpdateRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchUpdateRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAccessLogSubscription struct { +} + +func (*validateOpCreateAccessLogSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAccessLogSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAccessLogSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAccessLogSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateListener struct { +} + +func (*validateOpCreateListener) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateListener) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateListenerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateListenerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateRule struct { +} + +func (*validateOpCreateRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateService struct { +} + +func (*validateOpCreateService) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateServiceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateServiceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateServiceNetwork struct { +} + +func (*validateOpCreateServiceNetwork) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateServiceNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateServiceNetworkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateServiceNetworkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateServiceNetworkServiceAssociation struct { +} + +func (*validateOpCreateServiceNetworkServiceAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateServiceNetworkServiceAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateServiceNetworkServiceAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateServiceNetworkServiceAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateServiceNetworkVpcAssociation struct { +} + +func (*validateOpCreateServiceNetworkVpcAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateServiceNetworkVpcAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateServiceNetworkVpcAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateServiceNetworkVpcAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateTargetGroup struct { +} + +func (*validateOpCreateTargetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTargetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTargetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTargetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAccessLogSubscription struct { +} + +func (*validateOpDeleteAccessLogSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccessLogSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccessLogSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccessLogSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAuthPolicy struct { +} + +func (*validateOpDeleteAuthPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAuthPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAuthPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAuthPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteListener struct { +} + +func (*validateOpDeleteListener) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteListener) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteListenerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteListenerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteResourcePolicy struct { +} + +func (*validateOpDeleteResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteRule struct { +} + +func (*validateOpDeleteRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteService struct { +} + +func (*validateOpDeleteService) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteServiceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteServiceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteServiceNetwork struct { +} + +func (*validateOpDeleteServiceNetwork) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteServiceNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteServiceNetworkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteServiceNetworkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteServiceNetworkServiceAssociation struct { +} + +func (*validateOpDeleteServiceNetworkServiceAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteServiceNetworkServiceAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteServiceNetworkServiceAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteServiceNetworkServiceAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteServiceNetworkVpcAssociation struct { +} + +func (*validateOpDeleteServiceNetworkVpcAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteServiceNetworkVpcAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteServiceNetworkVpcAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteServiceNetworkVpcAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteTargetGroup struct { +} + +func (*validateOpDeleteTargetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteTargetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteTargetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteTargetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeregisterTargets struct { +} + +func (*validateOpDeregisterTargets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterTargetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterTargetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAccessLogSubscription struct { +} + +func (*validateOpGetAccessLogSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessLogSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessLogSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessLogSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAuthPolicy struct { +} + +func (*validateOpGetAuthPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAuthPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAuthPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAuthPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetListener struct { +} + +func (*validateOpGetListener) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetListener) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetListenerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetListenerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetResourcePolicy struct { +} + +func (*validateOpGetResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRule struct { +} + +func (*validateOpGetRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetService struct { +} + +func (*validateOpGetService) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetServiceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetServiceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetServiceNetwork struct { +} + +func (*validateOpGetServiceNetwork) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetServiceNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetServiceNetworkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetServiceNetworkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetServiceNetworkServiceAssociation struct { +} + +func (*validateOpGetServiceNetworkServiceAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetServiceNetworkServiceAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetServiceNetworkServiceAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetServiceNetworkServiceAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetServiceNetworkVpcAssociation struct { +} + +func (*validateOpGetServiceNetworkVpcAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetServiceNetworkVpcAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetServiceNetworkVpcAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetServiceNetworkVpcAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTargetGroup struct { +} + +func (*validateOpGetTargetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTargetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTargetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTargetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAccessLogSubscriptions struct { +} + +func (*validateOpListAccessLogSubscriptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccessLogSubscriptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccessLogSubscriptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccessLogSubscriptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListListeners struct { +} + +func (*validateOpListListeners) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListListeners) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListListenersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListListenersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListRules struct { +} + +func (*validateOpListRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRulesInput(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 validateOpListTargets struct { +} + +func (*validateOpListTargets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTargetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTargetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutAuthPolicy struct { +} + +func (*validateOpPutAuthPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutAuthPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutAuthPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutAuthPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutResourcePolicy struct { +} + +func (*validateOpPutResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterTargets struct { +} + +func (*validateOpRegisterTargets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterTargetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterTargetsInput(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 validateOpUpdateAccessLogSubscription struct { +} + +func (*validateOpUpdateAccessLogSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAccessLogSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAccessLogSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAccessLogSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateListener struct { +} + +func (*validateOpUpdateListener) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateListener) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateListenerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateListenerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateRule struct { +} + +func (*validateOpUpdateRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateService struct { +} + +func (*validateOpUpdateService) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateServiceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateServiceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateServiceNetwork struct { +} + +func (*validateOpUpdateServiceNetwork) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateServiceNetwork) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateServiceNetworkInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateServiceNetworkInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateServiceNetworkVpcAssociation struct { +} + +func (*validateOpUpdateServiceNetworkVpcAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateServiceNetworkVpcAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateServiceNetworkVpcAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateServiceNetworkVpcAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateTargetGroup struct { +} + +func (*validateOpUpdateTargetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateTargetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateTargetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateTargetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpBatchUpdateRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchUpdateRule{}, middleware.After) +} + +func addOpCreateAccessLogSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAccessLogSubscription{}, middleware.After) +} + +func addOpCreateListenerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateListener{}, middleware.After) +} + +func addOpCreateRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRule{}, middleware.After) +} + +func addOpCreateServiceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateService{}, middleware.After) +} + +func addOpCreateServiceNetworkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateServiceNetwork{}, middleware.After) +} + +func addOpCreateServiceNetworkServiceAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateServiceNetworkServiceAssociation{}, middleware.After) +} + +func addOpCreateServiceNetworkVpcAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateServiceNetworkVpcAssociation{}, middleware.After) +} + +func addOpCreateTargetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTargetGroup{}, middleware.After) +} + +func addOpDeleteAccessLogSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccessLogSubscription{}, middleware.After) +} + +func addOpDeleteAuthPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAuthPolicy{}, middleware.After) +} + +func addOpDeleteListenerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteListener{}, middleware.After) +} + +func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) +} + +func addOpDeleteRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRule{}, middleware.After) +} + +func addOpDeleteServiceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteService{}, middleware.After) +} + +func addOpDeleteServiceNetworkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteServiceNetwork{}, middleware.After) +} + +func addOpDeleteServiceNetworkServiceAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteServiceNetworkServiceAssociation{}, middleware.After) +} + +func addOpDeleteServiceNetworkVpcAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteServiceNetworkVpcAssociation{}, middleware.After) +} + +func addOpDeleteTargetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteTargetGroup{}, middleware.After) +} + +func addOpDeregisterTargetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterTargets{}, middleware.After) +} + +func addOpGetAccessLogSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessLogSubscription{}, middleware.After) +} + +func addOpGetAuthPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAuthPolicy{}, middleware.After) +} + +func addOpGetListenerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetListener{}, middleware.After) +} + +func addOpGetResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourcePolicy{}, middleware.After) +} + +func addOpGetRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRule{}, middleware.After) +} + +func addOpGetServiceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetService{}, middleware.After) +} + +func addOpGetServiceNetworkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetServiceNetwork{}, middleware.After) +} + +func addOpGetServiceNetworkServiceAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetServiceNetworkServiceAssociation{}, middleware.After) +} + +func addOpGetServiceNetworkVpcAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetServiceNetworkVpcAssociation{}, middleware.After) +} + +func addOpGetTargetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTargetGroup{}, middleware.After) +} + +func addOpListAccessLogSubscriptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccessLogSubscriptions{}, middleware.After) +} + +func addOpListListenersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListListeners{}, middleware.After) +} + +func addOpListRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRules{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpListTargetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTargets{}, middleware.After) +} + +func addOpPutAuthPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutAuthPolicy{}, middleware.After) +} + +func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) +} + +func addOpRegisterTargetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterTargets{}, 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 addOpUpdateAccessLogSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAccessLogSubscription{}, middleware.After) +} + +func addOpUpdateListenerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateListener{}, middleware.After) +} + +func addOpUpdateRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRule{}, middleware.After) +} + +func addOpUpdateServiceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateService{}, middleware.After) +} + +func addOpUpdateServiceNetworkValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateServiceNetwork{}, middleware.After) +} + +func addOpUpdateServiceNetworkVpcAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateServiceNetworkVpcAssociation{}, middleware.After) +} + +func addOpUpdateTargetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateTargetGroup{}, middleware.After) +} + +func validateFixedResponseAction(v *types.FixedResponseAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FixedResponseAction"} + if v.StatusCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("StatusCode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateForwardAction(v *types.ForwardAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ForwardAction"} + if v.TargetGroups == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroups")) + } else if v.TargetGroups != nil { + if err := validateWeightedTargetGroupList(v.TargetGroups); err != nil { + invalidParams.AddNested("TargetGroups", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateHeaderMatch(v *types.HeaderMatch) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "HeaderMatch"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Match == nil { + invalidParams.Add(smithy.NewErrParamRequired("Match")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateHeaderMatchList(v []types.HeaderMatch) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "HeaderMatchList"} + for i := range v { + if err := validateHeaderMatch(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateHttpMatch(v *types.HttpMatch) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "HttpMatch"} + if v.PathMatch != nil { + if err := validatePathMatch(v.PathMatch); err != nil { + invalidParams.AddNested("PathMatch", err.(smithy.InvalidParamsError)) + } + } + if v.HeaderMatches != nil { + if err := validateHeaderMatchList(v.HeaderMatches); err != nil { + invalidParams.AddNested("HeaderMatches", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePathMatch(v *types.PathMatch) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PathMatch"} + if v.Match == nil { + invalidParams.Add(smithy.NewErrParamRequired("Match")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRuleAction(v types.RuleAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RuleAction"} + switch uv := v.(type) { + case *types.RuleActionMemberFixedResponse: + if err := validateFixedResponseAction(&uv.Value); err != nil { + invalidParams.AddNested("[fixedResponse]", err.(smithy.InvalidParamsError)) + } + + case *types.RuleActionMemberForward: + if err := validateForwardAction(&uv.Value); err != nil { + invalidParams.AddNested("[forward]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRuleMatch(v types.RuleMatch) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RuleMatch"} + switch uv := v.(type) { + case *types.RuleMatchMemberHttpMatch: + if err := validateHttpMatch(&uv.Value); err != nil { + invalidParams.AddNested("[httpMatch]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRuleUpdate(v *types.RuleUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RuleUpdate"} + if v.RuleIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleIdentifier")) + } + if v.Match != nil { + if err := validateRuleMatch(v.Match); err != nil { + invalidParams.AddNested("Match", err.(smithy.InvalidParamsError)) + } + } + if v.Action != nil { + if err := validateRuleAction(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRuleUpdateList(v []types.RuleUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RuleUpdateList"} + for i := range v { + if err := validateRuleUpdate(&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.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTargetGroupConfig(v *types.TargetGroupConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TargetGroupConfig"} + if v.Port == nil { + invalidParams.Add(smithy.NewErrParamRequired("Port")) + } + if len(v.Protocol) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Protocol")) + } + if v.VpcIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTargetList(v []types.Target) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TargetList"} + for i := range v { + if err := validateTarget(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWeightedTargetGroup(v *types.WeightedTargetGroup) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WeightedTargetGroup"} + if v.TargetGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWeightedTargetGroupList(v []types.WeightedTargetGroup) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WeightedTargetGroupList"} + for i := range v { + if err := validateWeightedTargetGroup(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchUpdateRuleInput(v *BatchUpdateRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchUpdateRuleInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if v.Rules == nil { + invalidParams.Add(smithy.NewErrParamRequired("Rules")) + } else if v.Rules != nil { + if err := validateRuleUpdateList(v.Rules); err != nil { + invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAccessLogSubscriptionInput(v *CreateAccessLogSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAccessLogSubscriptionInput"} + if v.ResourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceIdentifier")) + } + if v.DestinationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateListenerInput(v *CreateListenerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateListenerInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Protocol) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Protocol")) + } + if v.DefaultAction == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultAction")) + } else if v.DefaultAction != nil { + if err := validateRuleAction(v.DefaultAction); err != nil { + invalidParams.AddNested("DefaultAction", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateRuleInput(v *CreateRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRuleInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Match == nil { + invalidParams.Add(smithy.NewErrParamRequired("Match")) + } else if v.Match != nil { + if err := validateRuleMatch(v.Match); err != nil { + invalidParams.AddNested("Match", err.(smithy.InvalidParamsError)) + } + } + if v.Priority == nil { + invalidParams.Add(smithy.NewErrParamRequired("Priority")) + } + if v.Action == nil { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } else if v.Action != nil { + if err := validateRuleAction(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateServiceInput(v *CreateServiceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateServiceInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateServiceNetworkInput(v *CreateServiceNetworkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateServiceNetworkInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateServiceNetworkServiceAssociationInput(v *CreateServiceNetworkServiceAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateServiceNetworkServiceAssociationInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ServiceNetworkIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateServiceNetworkVpcAssociationInput(v *CreateServiceNetworkVpcAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateServiceNetworkVpcAssociationInput"} + if v.ServiceNetworkIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkIdentifier")) + } + if v.VpcIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateTargetGroupInput(v *CreateTargetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTargetGroupInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Config != nil { + if err := validateTargetGroupConfig(v.Config); err != nil { + invalidParams.AddNested("Config", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAccessLogSubscriptionInput(v *DeleteAccessLogSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessLogSubscriptionInput"} + if v.AccessLogSubscriptionIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessLogSubscriptionIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAuthPolicyInput(v *DeleteAuthPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAuthPolicyInput"} + if v.ResourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteListenerInput(v *DeleteListenerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteListenerInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteRuleInput(v *DeleteRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRuleInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if v.RuleIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteServiceInput(v *DeleteServiceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteServiceInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteServiceNetworkInput(v *DeleteServiceNetworkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteServiceNetworkInput"} + if v.ServiceNetworkIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteServiceNetworkServiceAssociationInput(v *DeleteServiceNetworkServiceAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteServiceNetworkServiceAssociationInput"} + if v.ServiceNetworkServiceAssociationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkServiceAssociationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteServiceNetworkVpcAssociationInput(v *DeleteServiceNetworkVpcAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteServiceNetworkVpcAssociationInput"} + if v.ServiceNetworkVpcAssociationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkVpcAssociationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteTargetGroupInput(v *DeleteTargetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteTargetGroupInput"} + if v.TargetGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeregisterTargetsInput(v *DeregisterTargetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterTargetsInput"} + if v.TargetGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupIdentifier")) + } + if v.Targets == nil { + invalidParams.Add(smithy.NewErrParamRequired("Targets")) + } else if v.Targets != nil { + if err := validateTargetList(v.Targets); err != nil { + invalidParams.AddNested("Targets", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAccessLogSubscriptionInput(v *GetAccessLogSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessLogSubscriptionInput"} + if v.AccessLogSubscriptionIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessLogSubscriptionIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAuthPolicyInput(v *GetAuthPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAuthPolicyInput"} + if v.ResourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetListenerInput(v *GetListenerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetListenerInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetResourcePolicyInput(v *GetResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRuleInput(v *GetRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRuleInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if v.RuleIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetServiceInput(v *GetServiceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetServiceInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetServiceNetworkInput(v *GetServiceNetworkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetServiceNetworkInput"} + if v.ServiceNetworkIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetServiceNetworkServiceAssociationInput(v *GetServiceNetworkServiceAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetServiceNetworkServiceAssociationInput"} + if v.ServiceNetworkServiceAssociationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkServiceAssociationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetServiceNetworkVpcAssociationInput(v *GetServiceNetworkVpcAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetServiceNetworkVpcAssociationInput"} + if v.ServiceNetworkVpcAssociationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkVpcAssociationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTargetGroupInput(v *GetTargetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTargetGroupInput"} + if v.TargetGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAccessLogSubscriptionsInput(v *ListAccessLogSubscriptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccessLogSubscriptionsInput"} + if v.ResourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListListenersInput(v *ListListenersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListListenersInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListRulesInput(v *ListRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRulesInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + 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 validateOpListTargetsInput(v *ListTargetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTargetsInput"} + if v.TargetGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupIdentifier")) + } + if v.Targets != nil { + if err := validateTargetList(v.Targets); err != nil { + invalidParams.AddNested("Targets", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutAuthPolicyInput(v *PutAuthPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutAuthPolicyInput"} + if v.ResourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceIdentifier")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterTargetsInput(v *RegisterTargetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterTargetsInput"} + if v.TargetGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupIdentifier")) + } + if v.Targets == nil { + invalidParams.Add(smithy.NewErrParamRequired("Targets")) + } else if v.Targets != nil { + if err := validateTargetList(v.Targets); err != nil { + invalidParams.AddNested("Targets", err.(smithy.InvalidParamsError)) + } + } + 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")) + } + 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 validateOpUpdateAccessLogSubscriptionInput(v *UpdateAccessLogSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAccessLogSubscriptionInput"} + if v.AccessLogSubscriptionIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessLogSubscriptionIdentifier")) + } + if v.DestinationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateListenerInput(v *UpdateListenerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateListenerInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if v.DefaultAction == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultAction")) + } else if v.DefaultAction != nil { + if err := validateRuleAction(v.DefaultAction); err != nil { + invalidParams.AddNested("DefaultAction", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateRuleInput(v *UpdateRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRuleInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if v.ListenerIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ListenerIdentifier")) + } + if v.RuleIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("RuleIdentifier")) + } + if v.Match != nil { + if err := validateRuleMatch(v.Match); err != nil { + invalidParams.AddNested("Match", err.(smithy.InvalidParamsError)) + } + } + if v.Action != nil { + if err := validateRuleAction(v.Action); err != nil { + invalidParams.AddNested("Action", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateServiceInput(v *UpdateServiceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateServiceInput"} + if v.ServiceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateServiceNetworkInput(v *UpdateServiceNetworkInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateServiceNetworkInput"} + if v.ServiceNetworkIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkIdentifier")) + } + if len(v.AuthType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AuthType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateServiceNetworkVpcAssociationInput(v *UpdateServiceNetworkVpcAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateServiceNetworkVpcAssociationInput"} + if v.ServiceNetworkVpcAssociationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNetworkVpcAssociationIdentifier")) + } + if v.SecurityGroupIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateTargetGroupInput(v *UpdateTargetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateTargetGroupInput"} + if v.TargetGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupIdentifier")) + } + if v.HealthCheck == nil { + invalidParams.Add(smithy.NewErrParamRequired("HealthCheck")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/wafregional/internal/endpoints/endpoints.go b/service/wafregional/internal/endpoints/endpoints.go index db25ed0fbeb..e0a339ed19c 100644 --- a/service/wafregional/internal/endpoints/endpoints.go +++ b/service/wafregional/internal/endpoints/endpoints.go @@ -237,6 +237,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "ap-south-1", }, }, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{ + Hostname: "waf-regional.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "waf-regional-fips.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{ @@ -288,6 +305,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "ap-southeast-3", }, }, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{ + Hostname: "waf-regional.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "waf-regional-fips.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{ @@ -322,6 +356,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-central-1", }, }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "waf-regional.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "waf-regional-fips.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{ @@ -356,6 +407,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-south-1", }, }, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{ + Hostname: "waf-regional.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "waf-regional-fips.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{ @@ -461,6 +529,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-ap-south-2", + }: endpoints.Endpoint{ + Hostname: "waf-regional-fips.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-ap-southeast-1", }: endpoints.Endpoint{ @@ -488,6 +565,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-ap-southeast-4", + }: endpoints.Endpoint{ + Hostname: "waf-regional-fips.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-ca-central-1", }: endpoints.Endpoint{ @@ -506,6 +592,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-eu-central-2", + }: endpoints.Endpoint{ + Hostname: "waf-regional-fips.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-eu-north-1", }: endpoints.Endpoint{ @@ -524,6 +619,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-eu-south-2", + }: endpoints.Endpoint{ + Hostname: "waf-regional-fips.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-eu-west-1", }: endpoints.Endpoint{ diff --git a/service/wafv2/internal/endpoints/endpoints.go b/service/wafv2/internal/endpoints/endpoints.go index 83c7c7f10c0..fda997168a3 100644 --- a/service/wafv2/internal/endpoints/endpoints.go +++ b/service/wafv2/internal/endpoints/endpoints.go @@ -237,6 +237,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "ap-south-1", }, }, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{ @@ -288,6 +305,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "ap-southeast-3", }, }, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{ @@ -322,6 +356,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-central-1", }, }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{ @@ -356,6 +407,23 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-south-1", }, }, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{ @@ -461,6 +529,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-ap-south-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-ap-southeast-1", }: endpoints.Endpoint{ @@ -488,6 +565,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-ap-southeast-4", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-ca-central-1", }: endpoints.Endpoint{ @@ -506,6 +592,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-eu-central-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-eu-north-1", }: endpoints.Endpoint{ @@ -524,6 +619,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-eu-south-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-eu-west-1", }: endpoints.Endpoint{ diff --git a/service/wellarchitected/api_op_CreateLensShare.go b/service/wellarchitected/api_op_CreateLensShare.go index e0e63b6c091..ac35aad6e3d 100644 --- a/service/wellarchitected/api_op_CreateLensShare.go +++ b/service/wellarchitected/api_op_CreateLensShare.go @@ -12,10 +12,15 @@ import ( ) // Create a lens share. The owner of a lens can share it with other Amazon Web -// Services accounts, IAM users, an organization, and organizational units (OUs) in -// the same Amazon Web Services Region. Shared access to a lens is not removed -// until the lens invitation is deleted. Disclaimer By sharing your custom lenses -// with other Amazon Web Services accounts, you acknowledge that Amazon Web +// Services accounts, users, an organization, and organizational units (OUs) in the +// same Amazon Web Services Region. Lenses provided by Amazon Web Services (Amazon +// Web Services Official Content) cannot be shared. Shared access to a lens is not +// removed until the lens invitation is deleted. If you share a lens with an +// organization or OU, all accounts in the organization or OU are granted access to +// the lens. For more information, see Sharing a custom lens +// (https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-sharing.html) +// in the Well-Architected Tool User Guide. Disclaimer By sharing your custom +// lenses with other Amazon Web Services accounts, you acknowledge that Amazon Web // Services will make your custom lenses available to those other accounts. Those // other accounts may continue to access and use your shared custom lenses even if // you delete the custom lenses from your own Amazon Web Services account or @@ -40,21 +45,22 @@ type CreateLensShareInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_CreateLensVersion.go b/service/wellarchitected/api_op_CreateLensVersion.go index 4cbdd1cb0c9..1fc64f1362b 100644 --- a/service/wellarchitected/api_op_CreateLensVersion.go +++ b/service/wellarchitected/api_op_CreateLensVersion.go @@ -11,9 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Create a new lens version. A lens can have up to 100 versions. After a lens has -// been imported, create a new lens version to publish it. The owner of a lens can -// share the lens with other Amazon Web Services accounts and IAM users in the same +// Create a new lens version. A lens can have up to 100 versions. Use this +// operation to publish a new lens version after you have imported a lens. The +// LensAlias is used to identify the lens to be published. The owner of a lens can +// share the lens with other Amazon Web Services accounts and users in the same // Amazon Web Services Region. Only the owner of a lens can delete it. func (c *Client) CreateLensVersion(ctx context.Context, params *CreateLensVersionInput, optFns ...func(*Options)) (*CreateLensVersionOutput, error) { if params == nil { @@ -35,21 +36,22 @@ type CreateLensVersionInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_CreateMilestone.go b/service/wellarchitected/api_op_CreateMilestone.go index 88506cee7b8..7caa79c9736 100644 --- a/service/wellarchitected/api_op_CreateMilestone.go +++ b/service/wellarchitected/api_op_CreateMilestone.go @@ -33,11 +33,11 @@ type CreateMilestoneInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string diff --git a/service/wellarchitected/api_op_CreateWorkload.go b/service/wellarchitected/api_op_CreateWorkload.go index 5e792d5924e..246da1456f5 100644 --- a/service/wellarchitected/api_op_CreateWorkload.go +++ b/service/wellarchitected/api_op_CreateWorkload.go @@ -13,11 +13,14 @@ import ( ) // Create a new workload. The owner of a workload can share the workload with other -// Amazon Web Services accounts, IAM users, an organization, and organizational -// units (OUs) in the same Amazon Web Services Region. Only the owner of a workload -// can delete it. For more information, see Defining a Workload +// Amazon Web Services accounts, users, an organization, and organizational units +// (OUs) in the same Amazon Web Services Region. Only the owner of a workload can +// delete it. For more information, see Defining a Workload // (https://docs.aws.amazon.com/wellarchitected/latest/userguide/define-workload.html) -// in the Well-Architected Tool User Guide. +// in the Well-Architected Tool User Guide. Either AwsRegions, NonAwsRegions, or +// both must be specified when creating a workload. You also must specify +// ReviewOwner, even though the parameter is listed as not being required in the +// following section. func (c *Client) CreateWorkload(ctx context.Context, params *CreateWorkloadInput, optFns ...func(*Options)) (*CreateWorkloadOutput, error) { if params == nil { params = &CreateWorkloadInput{} @@ -39,11 +42,11 @@ type CreateWorkloadInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string diff --git a/service/wellarchitected/api_op_CreateWorkloadShare.go b/service/wellarchitected/api_op_CreateWorkloadShare.go index 2e32c300697..207927dff09 100644 --- a/service/wellarchitected/api_op_CreateWorkloadShare.go +++ b/service/wellarchitected/api_op_CreateWorkloadShare.go @@ -13,9 +13,11 @@ import ( ) // Create a workload share. The owner of a workload can share it with other Amazon -// Web Services accounts and IAM users in the same Amazon Web Services Region. -// Shared access to a workload is not removed until the workload invitation is -// deleted. For more information, see Sharing a Workload +// Web Services accounts and users in the same Amazon Web Services Region. Shared +// access to a workload is not removed until the workload invitation is deleted. If +// you share a workload with an organization or OU, all accounts in the +// organization or OU are granted access to the workload. For more information, see +// Sharing a workload // (https://docs.aws.amazon.com/wellarchitected/latest/userguide/workloads-sharing.html) // in the Well-Architected Tool User Guide. func (c *Client) CreateWorkloadShare(ctx context.Context, params *CreateWorkloadShareInput, optFns ...func(*Options)) (*CreateWorkloadShareOutput, error) { @@ -39,11 +41,11 @@ type CreateWorkloadShareInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string diff --git a/service/wellarchitected/api_op_DeleteLens.go b/service/wellarchitected/api_op_DeleteLens.go index 66986644256..5c70c6c235c 100644 --- a/service/wellarchitected/api_op_DeleteLens.go +++ b/service/wellarchitected/api_op_DeleteLens.go @@ -13,8 +13,8 @@ import ( ) // Delete an existing lens. Only the owner of a lens can delete it. After the lens -// is deleted, Amazon Web Services accounts and IAM users that you shared the lens -// with can continue to use it, but they will no longer be able to apply it to new +// is deleted, Amazon Web Services accounts and users that you shared the lens with +// can continue to use it, but they will no longer be able to apply it to new // workloads. Disclaimer By sharing your custom lenses with other Amazon Web // Services accounts, you acknowledge that Amazon Web Services will make your // custom lenses available to those other accounts. Those other accounts may @@ -41,21 +41,22 @@ type DeleteLensInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_DeleteLensShare.go b/service/wellarchitected/api_op_DeleteLensShare.go index c1293b05436..4f4ae7e40d5 100644 --- a/service/wellarchitected/api_op_DeleteLensShare.go +++ b/service/wellarchitected/api_op_DeleteLensShare.go @@ -12,11 +12,11 @@ import ( ) // Delete a lens share. After the lens share is deleted, Amazon Web Services -// accounts, IAM users, organizations, and organizational units (OUs) that you -// shared the lens with can continue to use it, but they will no longer be able to -// apply it to new workloads. Disclaimer By sharing your custom lenses with other -// Amazon Web Services accounts, you acknowledge that Amazon Web Services will make -// your custom lenses available to those other accounts. Those other accounts may +// accounts, users, organizations, and organizational units (OUs) that you shared +// the lens with can continue to use it, but they will no longer be able to apply +// it to new workloads. Disclaimer By sharing your custom lenses with other Amazon +// Web Services accounts, you acknowledge that Amazon Web Services will make your +// custom lenses available to those other accounts. Those other accounts may // continue to access and use your shared custom lenses even if you delete the // custom lenses from your own Amazon Web Services account or terminate your Amazon // Web Services account. @@ -40,21 +40,22 @@ type DeleteLensShareInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_DeleteWorkload.go b/service/wellarchitected/api_op_DeleteWorkload.go index f8a0344a4af..53afa8c0327 100644 --- a/service/wellarchitected/api_op_DeleteWorkload.go +++ b/service/wellarchitected/api_op_DeleteWorkload.go @@ -33,11 +33,11 @@ type DeleteWorkloadInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string diff --git a/service/wellarchitected/api_op_DeleteWorkloadShare.go b/service/wellarchitected/api_op_DeleteWorkloadShare.go index 6e38c9b8725..c9df610da5e 100644 --- a/service/wellarchitected/api_op_DeleteWorkloadShare.go +++ b/service/wellarchitected/api_op_DeleteWorkloadShare.go @@ -33,11 +33,11 @@ type DeleteWorkloadShareInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string diff --git a/service/wellarchitected/api_op_ExportLens.go b/service/wellarchitected/api_op_ExportLens.go index 9d6bc92e114..c8073f48058 100644 --- a/service/wellarchitected/api_op_ExportLens.go +++ b/service/wellarchitected/api_op_ExportLens.go @@ -10,16 +10,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Export an existing lens. Lenses are defined in JSON. For more information, see -// JSON format specification +// Export an existing lens. Only the owner of a lens can export it. Lenses provided +// by Amazon Web Services (Amazon Web Services Official Content) cannot be +// exported. Lenses are defined in JSON. For more information, see JSON format +// specification // (https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-format-specification.html) -// in the Well-Architected Tool User Guide. Only the owner of a lens can export it. -// Disclaimer Do not include or gather personal identifiable information (PII) of -// end users or other identifiable individuals in or via your custom lenses. If -// your custom lens or those shared with you and used in your account do include or -// collect PII you are responsible for: ensuring that the included PII is processed -// in accordance with applicable law, providing adequate privacy notices, and -// obtaining necessary consents for processing such data. +// in the Well-Architected Tool User Guide. Disclaimer Do not include or gather +// personal identifiable information (PII) of end users or other identifiable +// individuals in or via your custom lenses. If your custom lens or those shared +// with you and used in your account do include or collect PII you are responsible +// for: ensuring that the included PII is processed in accordance with applicable +// law, providing adequate privacy notices, and obtaining necessary consents for +// processing such data. func (c *Client) ExportLens(ctx context.Context, params *ExportLensInput, optFns ...func(*Options)) (*ExportLensOutput, error) { if params == nil { params = &ExportLensInput{} @@ -39,10 +41,11 @@ type ExportLensInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string @@ -55,7 +58,7 @@ type ExportLensInput struct { type ExportLensOutput struct { - // The JSON for the lens. + // The JSON representation of a lens. LensJSON *string // Metadata pertaining to the operation's result. diff --git a/service/wellarchitected/api_op_GetAnswer.go b/service/wellarchitected/api_op_GetAnswer.go index 59a75d2b3d6..6446f4fbea1 100644 --- a/service/wellarchitected/api_op_GetAnswer.go +++ b/service/wellarchitected/api_op_GetAnswer.go @@ -32,10 +32,11 @@ type GetAnswerInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string @@ -65,10 +66,11 @@ type GetAnswerOutput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. diff --git a/service/wellarchitected/api_op_GetConsolidatedReport.go b/service/wellarchitected/api_op_GetConsolidatedReport.go new file mode 100644 index 00000000000..dfd2e2c40f1 --- /dev/null +++ b/service/wellarchitected/api_op_GetConsolidatedReport.go @@ -0,0 +1,229 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get a consolidated report of your workloads. You can optionally choose to +// include workloads that have been shared with you. +func (c *Client) GetConsolidatedReport(ctx context.Context, params *GetConsolidatedReportInput, optFns ...func(*Options)) (*GetConsolidatedReportOutput, error) { + if params == nil { + params = &GetConsolidatedReportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetConsolidatedReport", params, optFns, c.addOperationGetConsolidatedReportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetConsolidatedReportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetConsolidatedReportInput struct { + + // The format of the consolidated report. For PDF, Base64String is returned. For + // JSON, Metrics is returned. + // + // This member is required. + Format types.ReportFormat + + // Set to true to have shared resources included in the report. + IncludeSharedResources bool + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type GetConsolidatedReportOutput struct { + + // The Base64-encoded string representation of a lens review report. This data can + // be used to create a PDF file. Only returned by GetConsolidatedReport when PDF + // format is requested. + Base64String *string + + // The metrics that make up the consolidated report. Only returned when JSON format + // is requested. + Metrics []types.ConsolidatedReportMetric + + // The token to use to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetConsolidatedReportMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetConsolidatedReport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetConsolidatedReport{}, 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 = addOpGetConsolidatedReportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConsolidatedReport(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 +} + +// GetConsolidatedReportAPIClient is a client that implements the +// GetConsolidatedReport operation. +type GetConsolidatedReportAPIClient interface { + GetConsolidatedReport(context.Context, *GetConsolidatedReportInput, ...func(*Options)) (*GetConsolidatedReportOutput, error) +} + +var _ GetConsolidatedReportAPIClient = (*Client)(nil) + +// GetConsolidatedReportPaginatorOptions is the paginator options for +// GetConsolidatedReport +type GetConsolidatedReportPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetConsolidatedReportPaginator is a paginator for GetConsolidatedReport +type GetConsolidatedReportPaginator struct { + options GetConsolidatedReportPaginatorOptions + client GetConsolidatedReportAPIClient + params *GetConsolidatedReportInput + nextToken *string + firstPage bool +} + +// NewGetConsolidatedReportPaginator returns a new GetConsolidatedReportPaginator +func NewGetConsolidatedReportPaginator(client GetConsolidatedReportAPIClient, params *GetConsolidatedReportInput, optFns ...func(*GetConsolidatedReportPaginatorOptions)) *GetConsolidatedReportPaginator { + if params == nil { + params = &GetConsolidatedReportInput{} + } + + options := GetConsolidatedReportPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetConsolidatedReportPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetConsolidatedReportPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetConsolidatedReport page. +func (p *GetConsolidatedReportPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetConsolidatedReportOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.GetConsolidatedReport(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_opGetConsolidatedReport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetConsolidatedReport", + } +} diff --git a/service/wellarchitected/api_op_GetLens.go b/service/wellarchitected/api_op_GetLens.go index d2ca5120be5..88a7483410b 100644 --- a/service/wellarchitected/api_op_GetLens.go +++ b/service/wellarchitected/api_op_GetLens.go @@ -31,10 +31,11 @@ type GetLensInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_GetLensReview.go b/service/wellarchitected/api_op_GetLensReview.go index 60feeb97ad5..5ef666f16bd 100644 --- a/service/wellarchitected/api_op_GetLensReview.go +++ b/service/wellarchitected/api_op_GetLensReview.go @@ -32,10 +32,11 @@ type GetLensReviewInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_GetLensReviewReport.go b/service/wellarchitected/api_op_GetLensReviewReport.go index 089fd5a8f31..7fa09b6509f 100644 --- a/service/wellarchitected/api_op_GetLensReviewReport.go +++ b/service/wellarchitected/api_op_GetLensReviewReport.go @@ -32,10 +32,11 @@ type GetLensReviewReportInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_GetLensVersionDifference.go b/service/wellarchitected/api_op_GetLensVersionDifference.go index b6f86f0432e..618054bcb5f 100644 --- a/service/wellarchitected/api_op_GetLensVersionDifference.go +++ b/service/wellarchitected/api_op_GetLensVersionDifference.go @@ -31,10 +31,11 @@ type GetLensVersionDifferenceInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string @@ -58,10 +59,11 @@ type GetLensVersionDifferenceOutput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. diff --git a/service/wellarchitected/api_op_ImportLens.go b/service/wellarchitected/api_op_ImportLens.go index bedaf7df51f..b5d297df2c7 100644 --- a/service/wellarchitected/api_op_ImportLens.go +++ b/service/wellarchitected/api_op_ImportLens.go @@ -12,9 +12,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Import a new lens. The lens cannot be applied to workloads or shared with other -// Amazon Web Services accounts until it's published with CreateLensVersion Lenses -// are defined in JSON. For more information, see JSON format specification +// Import a new custom lens or update an existing custom lens. To update an +// existing custom lens, specify its ARN as the LensAlias. If no ARN is specified, +// a new custom lens is created. The new or updated lens will have a status of +// DRAFT. The lens cannot be applied to workloads or shared with other Amazon Web +// Services accounts until it's published with CreateLensVersion. Lenses are +// defined in JSON. For more information, see JSON format specification // (https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-format-specification.html) // in the Well-Architected Tool User Guide. A custom lens cannot exceed 500 KB in // size. Disclaimer Do not include or gather personal identifiable information @@ -43,11 +46,11 @@ type ImportLensInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. // // This member is required. ClientRequestToken *string @@ -59,10 +62,11 @@ type ImportLensInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // Tags to associate to a lens. @@ -73,7 +77,7 @@ type ImportLensInput struct { type ImportLensOutput struct { - // The ARN for the lens. + // The ARN for the lens that was created or updated. LensArn *string // The status of the imported lens. diff --git a/service/wellarchitected/api_op_ListAnswers.go b/service/wellarchitected/api_op_ListAnswers.go index 1e83a4c3b17..43dd8027cd2 100644 --- a/service/wellarchitected/api_op_ListAnswers.go +++ b/service/wellarchitected/api_op_ListAnswers.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List of answers. +// List of answers for a particular workload and lens. func (c *Client) ListAnswers(ctx context.Context, params *ListAnswersInput, optFns ...func(*Options)) (*ListAnswersOutput, error) { if params == nil { params = &ListAnswersInput{} @@ -33,10 +33,11 @@ type ListAnswersInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string @@ -71,10 +72,11 @@ type ListAnswersOutput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. diff --git a/service/wellarchitected/api_op_ListLensReviewImprovements.go b/service/wellarchitected/api_op_ListLensReviewImprovements.go index 523b7cda80b..1f9641eb2d4 100644 --- a/service/wellarchitected/api_op_ListLensReviewImprovements.go +++ b/service/wellarchitected/api_op_ListLensReviewImprovements.go @@ -33,10 +33,11 @@ type ListLensReviewImprovementsInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string @@ -71,10 +72,11 @@ type ListLensReviewImprovementsOutput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. diff --git a/service/wellarchitected/api_op_ListLensReviews.go b/service/wellarchitected/api_op_ListLensReviews.go index 5df0426cd35..d51a250980d 100644 --- a/service/wellarchitected/api_op_ListLensReviews.go +++ b/service/wellarchitected/api_op_ListLensReviews.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List lens reviews. +// List lens reviews for a particular workload. func (c *Client) ListLensReviews(ctx context.Context, params *ListLensReviewsInput, optFns ...func(*Options)) (*ListLensReviewsOutput, error) { if params == nil { params = &ListLensReviewsInput{} diff --git a/service/wellarchitected/api_op_ListLensShares.go b/service/wellarchitected/api_op_ListLensShares.go index 81d4a9b932c..08e4c9a1b7e 100644 --- a/service/wellarchitected/api_op_ListLensShares.go +++ b/service/wellarchitected/api_op_ListLensShares.go @@ -32,10 +32,11 @@ type ListLensSharesInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_ListWorkloads.go b/service/wellarchitected/api_op_ListWorkloads.go index 8e3eca870f1..7faeb59af71 100644 --- a/service/wellarchitected/api_op_ListWorkloads.go +++ b/service/wellarchitected/api_op_ListWorkloads.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List workloads. Paginated. +// Paginated list of workloads. func (c *Client) ListWorkloads(ctx context.Context, params *ListWorkloadsInput, optFns ...func(*Options)) (*ListWorkloadsOutput, error) { if params == nil { params = &ListWorkloadsInput{} diff --git a/service/wellarchitected/api_op_UpdateAnswer.go b/service/wellarchitected/api_op_UpdateAnswer.go index 7f5e127483c..0ad41267e89 100644 --- a/service/wellarchitected/api_op_UpdateAnswer.go +++ b/service/wellarchitected/api_op_UpdateAnswer.go @@ -32,10 +32,11 @@ type UpdateAnswerInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string @@ -79,10 +80,11 @@ type UpdateAnswerOutput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. diff --git a/service/wellarchitected/api_op_UpdateLensReview.go b/service/wellarchitected/api_op_UpdateLensReview.go index de83fc739ad..cdb9ca92620 100644 --- a/service/wellarchitected/api_op_UpdateLensReview.go +++ b/service/wellarchitected/api_op_UpdateLensReview.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Update lens review. +// Update lens review for a particular workload. func (c *Client) UpdateLensReview(ctx context.Context, params *UpdateLensReviewInput, optFns ...func(*Options)) (*UpdateLensReviewOutput, error) { if params == nil { params = &UpdateLensReviewInput{} @@ -32,10 +32,11 @@ type UpdateLensReviewInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string diff --git a/service/wellarchitected/api_op_UpgradeLensReview.go b/service/wellarchitected/api_op_UpgradeLensReview.go index 59fad8ada3b..e194bd97f3e 100644 --- a/service/wellarchitected/api_op_UpgradeLensReview.go +++ b/service/wellarchitected/api_op_UpgradeLensReview.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Upgrade lens review. +// Upgrade lens review for a particular workload. func (c *Client) UpgradeLensReview(ctx context.Context, params *UpgradeLensReviewInput, optFns ...func(*Options)) (*UpgradeLensReviewOutput, error) { if params == nil { params = &UpgradeLensReviewInput{} @@ -30,10 +30,11 @@ type UpgradeLensReviewInput struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. // // This member is required. LensAlias *string @@ -53,11 +54,11 @@ type UpgradeLensReviewInput struct { // A unique case-sensitive string used to ensure that this request is idempotent // (executes only once). You should not reuse the same token for other requests. If // you retry a request with the same client request token and the same parameters - // after it has completed successfully, the result of the original request is - // returned. This token is listed as required, however, if you do not specify it, - // the Amazon Web Services SDKs automatically generate one for you. If you are not - // using the Amazon Web Services SDK or the CLI, you must provide this token or the - // request will fail. + // after the original request has completed successfully, the result of the + // original request is returned. This token is listed as required, however, if you + // do not specify it, the Amazon Web Services SDKs automatically generate one for + // you. If you are not using the Amazon Web Services SDK or the CLI, you must + // provide this token or the request will fail. ClientRequestToken *string noSmithyDocumentSerde diff --git a/service/wellarchitected/deserializers.go b/service/wellarchitected/deserializers.go index 76a479a83f0..0562b334a39 100644 --- a/service/wellarchitected/deserializers.go +++ b/service/wellarchitected/deserializers.go @@ -760,6 +760,9 @@ func awsRestjson1_deserializeOpErrorCreateWorkload(response *smithyhttp.Response 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) @@ -1888,6 +1891,183 @@ func awsRestjson1_deserializeOpDocumentGetAnswerOutput(v **GetAnswerOutput, valu return nil } +type awsRestjson1_deserializeOpGetConsolidatedReport struct { +} + +func (*awsRestjson1_deserializeOpGetConsolidatedReport) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetConsolidatedReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next 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_deserializeOpErrorGetConsolidatedReport(response, &metadata) + } + output := &GetConsolidatedReportOutput{} + 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_deserializeOpDocumentGetConsolidatedReportOutput(&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_deserializeOpErrorGetConsolidatedReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetConsolidatedReportOutput(v **GetConsolidatedReportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetConsolidatedReportOutput + if *v == nil { + sv = &GetConsolidatedReportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Base64String": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Base64String to be of type string, got %T instead", value) + } + sv.Base64String = ptr.String(jtv) + } + + case "Metrics": + if err := awsRestjson1_deserializeDocumentConsolidatedReportMetrics(&sv.Metrics, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpGetLens struct { } @@ -7314,6 +7494,89 @@ func awsRestjson1_deserializeDocumentAnswerSummary(v **types.AnswerSummary, valu return nil } +func awsRestjson1_deserializeDocumentBestPractice(v **types.BestPractice, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.BestPractice + if *v == nil { + sv = &types.BestPractice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChoiceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + } + sv.ChoiceId = ptr.String(jtv) + } + + case "ChoiceTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) + } + sv.ChoiceTitle = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBestPractices(v *[]types.BestPractice, 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.BestPractice + if *v == nil { + cv = []types.BestPractice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BestPractice + destAddr := &col + if err := awsRestjson1_deserializeDocumentBestPractice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCheckDetail(v **types.CheckDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8173,7 +8436,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.ImprovementSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentConsolidatedReportMetric(v **types.ConsolidatedReportMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8181,26 +8444,166 @@ func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.Improvement return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ImprovementSummary + var sv *types.ConsolidatedReportMetric if *v == nil { - cv = []types.ImprovementSummary{} + sv = &types.ConsolidatedReportMetric{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ImprovementSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentImprovementSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "Lenses": + if err := awsRestjson1_deserializeDocumentLensMetrics(&sv.Lenses, value); err != nil { + return err + } + + case "LensesAppliedCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LensesAppliedCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LensesAppliedCount = int32(i64) + } + + case "MetricType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricType to be of type string, got %T instead", value) + } + sv.MetricType = types.MetricType(jtv) + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "WorkloadArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) + } + sv.WorkloadArn = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConsolidatedReportMetrics(v *[]types.ConsolidatedReportMetric, 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.ConsolidatedReportMetric + if *v == nil { + cv = []types.ConsolidatedReportMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConsolidatedReportMetric + destAddr := &col + if err := awsRestjson1_deserializeDocumentConsolidatedReportMetric(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.ImprovementSummary, 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.ImprovementSummary + if *v == nil { + cv = []types.ImprovementSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ImprovementSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentImprovementSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) } *v = cv @@ -8418,6 +8821,90 @@ func awsRestjson1_deserializeDocumentLens(v **types.Lens, value interface{}) err return nil } +func awsRestjson1_deserializeDocumentLensMetric(v **types.LensMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.LensMetric + if *v == nil { + sv = &types.LensMetric{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensArn to be of type string, got %T instead", value) + } + sv.LensArn = ptr.String(jtv) + } + + case "Pillars": + if err := awsRestjson1_deserializeDocumentPillarMetrics(&sv.Pillars, value); err != nil { + return err + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLensMetrics(v *[]types.LensMetric, 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.LensMetric + if *v == nil { + cv = []types.LensMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LensMetric + destAddr := &col + if err := awsRestjson1_deserializeDocumentLensMetric(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9440,6 +9927,90 @@ func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifferen return nil } +func awsRestjson1_deserializeDocumentPillarMetric(v **types.PillarMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PillarMetric + if *v == nil { + sv = &types.PillarMetric{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "Questions": + if err := awsRestjson1_deserializeDocumentQuestionMetrics(&sv.Questions, value); err != nil { + return err + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPillarMetrics(v *[]types.PillarMetric, 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.PillarMetric + if *v == nil { + cv = []types.PillarMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PillarMetric + destAddr := &col + if err := awsRestjson1_deserializeDocumentPillarMetric(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarReviewSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9629,6 +10200,94 @@ func awsRestjson1_deserializeDocumentQuestionDifferences(v *[]types.QuestionDiff return nil } +func awsRestjson1_deserializeDocumentQuestionMetric(v **types.QuestionMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.QuestionMetric + if *v == nil { + sv = &types.QuestionMetric{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BestPractices": + if err := awsRestjson1_deserializeDocumentBestPractices(&sv.BestPractices, value); err != nil { + return err + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "Risk": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + } + sv.Risk = types.Risk(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQuestionMetrics(v *[]types.QuestionMetric, 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.QuestionMetric + if *v == nil { + cv = []types.QuestionMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QuestionMetric + destAddr := &col + if err := awsRestjson1_deserializeDocumentQuestionMetric(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/wellarchitected/generated.json b/service/wellarchitected/generated.json index 8429491d230..11d05774f2b 100644 --- a/service/wellarchitected/generated.json +++ b/service/wellarchitected/generated.json @@ -21,6 +21,7 @@ "api_op_DisassociateLenses.go", "api_op_ExportLens.go", "api_op_GetAnswer.go", + "api_op_GetConsolidatedReport.go", "api_op_GetLens.go", "api_op_GetLensReview.go", "api_op_GetLensReviewReport.go", diff --git a/service/wellarchitected/serializers.go b/service/wellarchitected/serializers.go index 80f3cec660b..5bd502dcae6 100644 --- a/service/wellarchitected/serializers.go +++ b/service/wellarchitected/serializers.go @@ -1110,6 +1110,71 @@ func awsRestjson1_serializeOpHttpBindingsGetAnswerInput(v *GetAnswerInput, encod return nil } +type awsRestjson1_serializeOpGetConsolidatedReport struct { +} + +func (*awsRestjson1_serializeOpGetConsolidatedReport) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetConsolidatedReport) 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.(*GetConsolidatedReportInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/consolidatedReport") + 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_serializeOpHttpBindingsGetConsolidatedReportInput(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_serializeOpHttpBindingsGetConsolidatedReportInput(v *GetConsolidatedReportInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.Format) > 0 { + encoder.SetQuery("Format").String(string(v.Format)) + } + + if v.IncludeSharedResources { + encoder.SetQuery("IncludeSharedResources").Boolean(v.IncludeSharedResources) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpGetLens struct { } diff --git a/service/wellarchitected/types/enums.go b/service/wellarchitected/types/enums.go index 6eebdcd9e34..b4ab68b59d5 100644 --- a/service/wellarchitected/types/enums.go +++ b/service/wellarchitected/types/enums.go @@ -254,6 +254,22 @@ func (LensType) Values() []LensType { } } +type MetricType string + +// Enum values for MetricType +const ( + MetricTypeWorkload MetricType = "WORKLOAD" +) + +// Values returns all known values for MetricType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (MetricType) Values() []MetricType { + return []MetricType{ + "WORKLOAD", + } +} + type NotificationType string // Enum values for NotificationType @@ -308,6 +324,24 @@ func (PermissionType) Values() []PermissionType { } } +type ReportFormat string + +// Enum values for ReportFormat +const ( + ReportFormatPdf ReportFormat = "PDF" + ReportFormatJson ReportFormat = "JSON" +) + +// Values returns all known values for ReportFormat. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (ReportFormat) Values() []ReportFormat { + return []ReportFormat{ + "PDF", + "JSON", + } +} + type Risk string // Enum values for Risk diff --git a/service/wellarchitected/types/errors.go b/service/wellarchitected/types/errors.go index 02392ffc230..313ced8084c 100644 --- a/service/wellarchitected/types/errors.go +++ b/service/wellarchitected/types/errors.go @@ -33,7 +33,7 @@ func (e *AccessDeniedException) ErrorCode() string { } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The resource already exists. +// The resource has already been processed, was deleted, or is too large. type ConflictException struct { Message *string diff --git a/service/wellarchitected/types/types.go b/service/wellarchitected/types/types.go index b3a3d8415c5..678da5d4eb3 100644 --- a/service/wellarchitected/types/types.go +++ b/service/wellarchitected/types/types.go @@ -7,14 +7,15 @@ import ( "time" ) -// The choice level additional resources. +// The choice level additional resources for a custom lens. This field does not +// apply to Amazon Web Services official lenses. type AdditionalResources struct { // The URLs for additional resources, either helpful resources or improvement - // plans. Up to five additional URLs can be specified. + // plans, for a custom lens. Up to five additional URLs can be specified. Content []ChoiceContent - // Type of additional resource. + // Type of additional resource for a custom lens. Type AdditionalResourceType noSmithyDocumentSerde @@ -29,14 +30,19 @@ type Answer struct { // List of choices available for a question. Choices []Choice - // The helpful resource text to be displayed. + // The helpful resource text to be displayed for a custom lens. This field does not + // apply to Amazon Web Services official lenses. HelpfulResourceDisplayText *string - // The helpful resource URL for a question. + // The helpful resource URL. For Amazon Web Services official lenses, this is the + // helpful resource URL for a question or choice. For custom lenses, this is the + // helpful resource URL for a question and is only provided if + // HelpfulResourceDisplayText was specified for the question. HelpfulResourceUrl *string - // The improvement plan URL for a question. This value is only available if the - // question has been answered. + // The improvement plan URL for a question in an Amazon Web Services official + // lenses. This value is only available if the question has been answered. This + // value does not apply to custom lenses. ImprovementPlanUrl *string // Defines whether this question is applicable to a lens review. @@ -106,6 +112,19 @@ type AnswerSummary struct { noSmithyDocumentSerde } +// A best practice, or question choice, that has been identified as a risk in this +// question. +type BestPractice struct { + + // The ID of a choice. + ChoiceId *string + + // The title of a choice. + ChoiceTitle *string + + noSmithyDocumentSerde +} + // Account details for a Well-Architected best practice in relation to Trusted // Advisor checks. type CheckDetail struct { @@ -196,8 +215,9 @@ type CheckSummary struct { // A choice available to answer question. type Choice struct { - // The additional resources for a choice. A choice can have up to two additional - // resources: one of type HELPFUL_RESOURCE, one of type IMPROVEMENT_PLAN, or both. + // The additional resources for a choice in a custom lens. A choice can have up to + // two additional resources: one of type HELPFUL_RESOURCE, one of type + // IMPROVEMENT_PLAN, or both. AdditionalResources []AdditionalResources // The ID of a choice. @@ -206,10 +226,12 @@ type Choice struct { // The description of a choice. Description *string - // The choice level helpful resource. + // The helpful resource (both text and URL) for a particular choice. This field + // only applies to custom lenses. Each choice can have only one helpful resource. HelpfulResource *ChoiceContent - // The choice level improvement plan. + // The improvement plan (both text and URL) for a particular choice. This field + // only applies to custom lenses. Each choice can have only one improvement plan. ImprovementPlan *ChoiceContent // The title of a choice. @@ -272,8 +294,9 @@ type ChoiceImprovementPlan struct { // The display text for the improvement plan. DisplayText *string - // The improvement plan URL for a question. This value is only available if the - // question has been answered. + // The improvement plan URL for a question in an Amazon Web Services official + // lenses. This value is only available if the question has been answered. This + // value does not apply to custom lenses. ImprovementPlanUrl *string noSmithyDocumentSerde @@ -296,11 +319,46 @@ type ChoiceUpdate struct { noSmithyDocumentSerde } +// A metric that contributes to the consolidated report. +type ConsolidatedReportMetric struct { + + // The metrics for the lenses in the workload. + Lenses []LensMetric + + // The total number of lenses applied to the workload. + LensesAppliedCount int32 + + // The metric type of a metric in the consolidated report. Currently only WORKLOAD + // metric types are supported. + MetricType MetricType + + // A map from risk names to the count of how many questions have that rating. + RiskCounts map[string]int32 + + // The date and time recorded. + UpdatedAt *time.Time + + // The ARN for the workload. + WorkloadArn *string + + // The ID assigned to the workload. This ID is unique within an Amazon Web Services + // Region. + WorkloadId *string + + // The name of the workload. The name must be unique within an account within an + // Amazon Web Services Region. Spaces and capitalization are ignored when checking + // for uniqueness. + WorkloadName *string + + noSmithyDocumentSerde +} + // An improvement summary of a lens review in a workload. type ImprovementSummary struct { - // The improvement plan URL for a question. This value is only available if the - // question has been answered. + // The improvement plan URL for a question in an Amazon Web Services official + // lenses. This value is only available if the question has been answered. This + // value does not apply to custom lenses. ImprovementPlanUrl *string // The improvement plan details. @@ -349,15 +407,31 @@ type Lens struct { noSmithyDocumentSerde } +// A metric for a particular lens in a workload. +type LensMetric struct { + + // The lens ARN. + LensArn *string + + // The metrics for the pillars in a lens. + Pillars []PillarMetric + + // A map from risk names to the count of how many questions have that rating. + RiskCounts map[string]int32 + + noSmithyDocumentSerde +} + // A lens review of a question. type LensReview struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. @@ -381,7 +455,7 @@ type LensReview struct { // List of pillar review summaries of lens review in a workload. PillarReviewSummaries []PillarReviewSummary - // A map from risk names to the count of how questions have that rating. + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 // The date and time recorded. @@ -394,15 +468,17 @@ type LensReview struct { type LensReviewReport struct { // The Base64-encoded string representation of a lens review report. This data can - // be used to create a PDF file. + // be used to create a PDF file. Only returned by GetConsolidatedReport when PDF + // format is requested. Base64String *string // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. @@ -416,10 +492,11 @@ type LensReviewSummary struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. @@ -434,7 +511,7 @@ type LensReviewSummary struct { // The version of the lens. LensVersion *string - // A map from risk names to the count of how questions have that rating. + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 // The date and time recorded. @@ -473,10 +550,11 @@ type LensSummary struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN of the lens. @@ -514,10 +592,11 @@ type LensUpgradeSummary struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. @@ -604,6 +683,22 @@ type PillarDifference struct { noSmithyDocumentSerde } +// A metric for a particular pillar in a lens. +type PillarMetric struct { + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string + + // The questions that have been identified as risks in the pillar. + Questions []QuestionMetric + + // A map from risk names to the count of how many questions have that rating. + RiskCounts map[string]int32 + + noSmithyDocumentSerde +} + // A pillar review summary of a lens review. type PillarReviewSummary struct { @@ -617,7 +712,7 @@ type PillarReviewSummary struct { // The name of the pillar. PillarName *string - // A map from risk names to the count of how questions have that rating. + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 noSmithyDocumentSerde @@ -638,15 +733,32 @@ type QuestionDifference struct { noSmithyDocumentSerde } +// A metric for a particular question in the pillar. +type QuestionMetric struct { + + // The best practices, or choices, that have been identified as contributing to + // risk in a question. + BestPractices []BestPractice + + // The ID of the question. + QuestionId *string + + // The risk for a given workload, lens review, pillar, or question. + Risk Risk + + noSmithyDocumentSerde +} + // The share invitation. type ShareInvitation struct { // The alias of the lens. For Amazon Web Services official lenses, this is either // the lens alias, such as serverless, or the lens ARN, such as - // arn:aws:wellarchitected:us-west-2::lens/serverless. For custom lenses, this is - // the lens ARN, such as - // arn:aws:wellarchitected:us-east-1:123456789012:lens/my-lens. Each lens is - // identified by its LensSummary$LensAlias. + // arn:aws:wellarchitected:us-east-1::lens/serverless. Note that some operations + // (such as ExportLens and CreateLensShare) are not permitted on Amazon Web + // Services official lenses. For custom lenses, this is the lens ARN, such as + // arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef. + // Each lens is identified by its LensSummary$LensAlias. LensAlias *string // The ARN for the lens. @@ -854,7 +966,7 @@ type Workload struct { // The date and time recorded. ReviewRestrictionDate *time.Time - // A map from risk names to the count of how questions have that rating. + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 // The ID assigned to the share invitation. @@ -956,7 +1068,7 @@ type WorkloadSummary struct { // An Amazon Web Services account ID. Owner *string - // A map from risk names to the count of how questions have that rating. + // A map from risk names to the count of how many questions have that rating. RiskCounts map[string]int32 // The date and time recorded. diff --git a/service/wellarchitected/validators.go b/service/wellarchitected/validators.go index a083660df29..2eeabe0c393 100644 --- a/service/wellarchitected/validators.go +++ b/service/wellarchitected/validators.go @@ -270,6 +270,26 @@ func (m *validateOpGetAnswer) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpGetConsolidatedReport struct { +} + +func (*validateOpGetConsolidatedReport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetConsolidatedReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetConsolidatedReportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetConsolidatedReportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetLens struct { } @@ -802,6 +822,10 @@ func addOpGetAnswerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAnswer{}, middleware.After) } +func addOpGetConsolidatedReportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetConsolidatedReport{}, middleware.After) +} + func addOpGetLensValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLens{}, middleware.After) } @@ -1198,6 +1222,21 @@ func validateOpGetAnswerInput(v *GetAnswerInput) error { } } +func validateOpGetConsolidatedReportInput(v *GetConsolidatedReportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetConsolidatedReportInput"} + if len(v.Format) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Format")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetLensInput(v *GetLensInput) error { if v == nil { return nil