diff --git a/cmd/cloud-controller-manager-aws-tests-ext/e2e/helper.go b/cmd/cloud-controller-manager-aws-tests-ext/e2e/helper.go index b1bd409e2..84965b455 100644 --- a/cmd/cloud-controller-manager-aws-tests-ext/e2e/helper.go +++ b/cmd/cloud-controller-manager-aws-tests-ext/e2e/helper.go @@ -4,62 +4,20 @@ import ( "context" "fmt" "strings" + "time" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/aws/retry" ec2 "github.com/aws/aws-sdk-go-v2/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" - elbv2types "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" configv1client "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" + clientset "k8s.io/client-go/kubernetes" "k8s.io/kubernetes/test/e2e/framework" ) -// AWS helpers - -// createAWSClientLoadBalancer creates an AWS ELBv2 client using default credentials configured in the environment. -func createAWSClientLoadBalancer(ctx context.Context) (*elbv2.Client, error) { - cfg, err := config.LoadDefaultConfig(ctx) - if err != nil { - return nil, fmt.Errorf("unable to load AWS config: %v", err) - } - return elbv2.NewFromConfig(cfg), nil -} - -// getAWSLoadBalancerFromDNSName finds a load balancer by DNS name using the AWS ELBv2 client. -func getAWSLoadBalancerFromDNSName(ctx context.Context, elbClient *elbv2.Client, lbDNSName string) (*elbv2types.LoadBalancer, error) { - var foundLB *elbv2types.LoadBalancer - framework.Logf("describing load balancers with DNS %s", lbDNSName) - - paginator := elbv2.NewDescribeLoadBalancersPaginator(elbClient, &elbv2.DescribeLoadBalancersInput{}) - for paginator.HasMorePages() { - page, err := paginator.NextPage(ctx) - if err != nil { - return nil, fmt.Errorf("failed to describe load balancers: %v", err) - } - - framework.Logf("found %d load balancers in page", len(page.LoadBalancers)) - // Search for the load balancer with matching DNS name in this page - for i := range page.LoadBalancers { - if aws.ToString(page.LoadBalancers[i].DNSName) == lbDNSName { - foundLB = &page.LoadBalancers[i] - framework.Logf("found load balancer with DNS %s", aws.ToString(foundLB.DNSName)) - break - } - } - if foundLB != nil { - break - } - } - - if foundLB == nil { - return nil, fmt.Errorf("no load balancer found with DNS name: %s", lbDNSName) - } - - return foundLB, nil -} - // isFeatureEnabled checks if an OpenShift feature gate is enabled by querying the // FeatureGate resource named "cluster" using the typed OpenShift config API. // @@ -120,15 +78,6 @@ func isFeatureEnabled(ctx context.Context, featureName string) (bool, error) { return false, nil } -// getAWSClientEC2 creates an AWS EC2 client using default credentials configured in the environment. -func createAWSClientEC2(ctx context.Context) (*ec2.Client, error) { - cfg, err := config.LoadDefaultConfig(ctx) - if err != nil { - return nil, fmt.Errorf("unable to load AWS config: %v", err) - } - return ec2.NewFromConfig(cfg), nil -} - // getAWSSecurityGroup retrieves a security group by ID using the AWS EC2 client. func getAWSSecurityGroup(ctx context.Context, ec2Client *ec2.Client, sgID string) (*ec2types.SecurityGroup, error) { framework.Logf("describing security group %s", sgID) @@ -194,3 +143,268 @@ func ec2IsNotFoundError(err error) bool { strings.Contains(errMsg, "InvalidGroupId.NotFound") || strings.Contains(errMsg, "InvalidGroup.Malformed") } + +// isAWSRetryableError checks if an error is retryable using AWS SDK's standard retry logic. +func isAWSRetryableError(err error) bool { + if err == nil { + return false + } + result := retry.IsErrorRetryables(retry.DefaultRetryables).IsErrorRetryable(err) + return result == aws.TrueTernary +} + +// createAWSSecurityGroup creates a test security group. +func createAWSSecurityGroup(ctx context.Context, ec2Client *ec2.Client, name, description, vpcID string) (string, error) { + framework.Logf("creating security group %s in VPC %s", name, vpcID) + + result, err := ec2Client.CreateSecurityGroup(ctx, &ec2.CreateSecurityGroupInput{ + GroupName: &name, + Description: &description, + VpcId: &vpcID, + TagSpecifications: []ec2types.TagSpecification{ + { + ResourceType: ec2types.ResourceTypeSecurityGroup, + Tags: []ec2types.Tag{ + { + Key: aws.String("Name"), + Value: &name, + }, + }, + }, + }, + }) + if err != nil { + return "", fmt.Errorf("failed to create security group %s: %v", name, err) + } + + sgID := aws.ToString(result.GroupId) + framework.Logf("created security group %s with ID %s", name, sgID) + return sgID, nil +} + +// isSecurityGroupManaged checks if a security group is managed by the controller. +// It checks for the cluster ownership tag to determine if the controller owns this security group. +// Managed SGs have tag kubernetes.io/cluster/ = "owned" +func isSecurityGroupManaged(ctx context.Context, ec2Client *ec2.Client, sgID, clusterName string) (bool, error) { + sg, err := getAWSSecurityGroup(ctx, ec2Client, sgID) + if err != nil { + return false, err + } + + // Check for cluster ownership tag + clusterTagKey := fmt.Sprintf("kubernetes.io/cluster/%s", clusterName) + for _, tag := range sg.Tags { + if aws.ToString(tag.Key) == clusterTagKey && aws.ToString(tag.Value) == "owned" { + return true, nil + } + } + return false, nil +} + +// authorizeSecurityGroupIngress adds ingress rules to a security group for the given service ports. +func authorizeSecurityGroupIngress(ctx context.Context, ec2Client *ec2.Client, sgID string, ports []v1.ServicePort) error { + if len(ports) == 0 { + return nil + } + + framework.Logf("authorizing ingress rules for security group %s", sgID) + + ingressRules := make([]ec2types.IpPermission, 0, len(ports)) + for _, port := range ports { + protocol := strings.ToLower(string(port.Protocol)) + rule := ec2types.IpPermission{ + FromPort: aws.Int32(port.Port), + ToPort: aws.Int32(port.Port), + IpProtocol: &protocol, + IpRanges: []ec2types.IpRange{ + { + CidrIp: aws.String("0.0.0.0/0"), + Description: aws.String(fmt.Sprintf("E2E test access for port %d", port.Port)), + }, + }, + } + ingressRules = append(ingressRules, rule) + } + + _, err := ec2Client.AuthorizeSecurityGroupIngress(ctx, &ec2.AuthorizeSecurityGroupIngressInput{ + GroupId: &sgID, + IpPermissions: ingressRules, + }) + if err != nil { + // Check if error is due to duplicate rules (which is acceptable) + if strings.Contains(err.Error(), "InvalidPermission.Duplicate") { + framework.Logf("some rules already exist in security group %s (this is okay)", sgID) + return nil + } + return fmt.Errorf("failed to authorize ingress for security group %s: %v", sgID, err) + } + + framework.Logf("successfully authorized %d ingress rule(s) for security group %s", len(ingressRules), sgID) + return nil +} + +// deleteAWSSecurityGroup deletes a security group. +func deleteAWSSecurityGroup(ctx context.Context, ec2Client *ec2.Client, sgID string) error { + framework.Logf("deleting security group %s", sgID) + + _, err := ec2Client.DeleteSecurityGroup(ctx, &ec2.DeleteSecurityGroupInput{ + GroupId: &sgID, + }) + if err != nil { + // If already deleted, that's okay + if ec2IsNotFoundError(err) { + framework.Logf("security group %s already deleted", sgID) + return nil + } + return fmt.Errorf("failed to delete security group %s: %v", sgID, err) + } + + framework.Logf("successfully deleted security group %s", sgID) + return nil +} + +// waitForSecurityGroupDeletion attempts to delete a security group and waits for it to be deleted. +// It handles dependency violations when the SG is still attached to resources like load balancers. +func waitForSecurityGroupDeletion(ctx context.Context, ec2Client *ec2.Client, sgID string, timeout time.Duration) error { + framework.Logf("waiting for security group %s deletion (timeout: %v)", sgID, timeout) + + return wait.PollUntilContextTimeout(ctx, 5*time.Second, timeout, true, func(pollCtx context.Context) (bool, error) { + // First check if SG still exists + exists, err := securityGroupExists(pollCtx, ec2Client, sgID) + if err != nil { + // Handle throttling errors by continuing to poll + if isAWSRetryableError(err) { + framework.Logf("AWS throttling encountered while checking security group %s, retrying...", sgID) + return false, nil + } + return false, fmt.Errorf("error checking if security group exists: %v", err) + } + + if !exists { + framework.Logf("security group %s successfully deleted", sgID) + return true, nil + } + + // Try to delete it + err = deleteAWSSecurityGroup(pollCtx, ec2Client, sgID) + if err != nil { + // Handle throttling errors by continuing to poll + if isAWSRetryableError(err) { + framework.Logf("AWS throttling encountered while deleting security group %s, retrying...", sgID) + return false, nil + } + + // Check for dependency violation errors - keep retrying + if strings.Contains(err.Error(), "DependencyViolation") || + strings.Contains(err.Error(), "InvalidGroup.InUse") || + strings.Contains(err.Error(), "resource has a dependent object") { + framework.Logf("security group %s still has dependencies, retrying...", sgID) + return false, nil // Keep waiting + } + + // Check if it's already deleted + if ec2IsNotFoundError(err) { + framework.Logf("security group %s deleted", sgID) + return true, nil + } + + // For other errors, return the error + return false, err + } + + // Deletion succeeded + return true, nil + }) +} + +// getClusterInstanceID extracts an EC2 instance ID from a cluster node's provider ID. +func getClusterInstanceID(ctx context.Context, cs clientset.Interface) (string, error) { + nodes, err := cs.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) + if err != nil { + return "", fmt.Errorf("failed to list nodes: %v", err) + } + + if len(nodes.Items) == 0 { + return "", fmt.Errorf("no nodes found in cluster") + } + + // Get instance ID from first node + for _, node := range nodes.Items { + providerID := node.Spec.ProviderID + if providerID == "" { + continue + } + // providerID format: aws:///us-east-1a/i-1234567890abcdef0 + providerID = strings.Replace(providerID, "aws:///", "", 1) + parts := strings.Split(providerID, "/") + if len(parts) < 2 { + continue + } + instanceID := parts[1] + if strings.HasPrefix(instanceID, "i-") { + return instanceID, nil + } + } + + return "", fmt.Errorf("could not find valid instance ID from cluster nodes") +} + +// getClusterVPCID discovers the VPC ID from a cluster node's network interface. +func getClusterVPCID(ctx context.Context, cs clientset.Interface, ec2Client *ec2.Client) (string, error) { + instanceID, err := getClusterInstanceID(ctx, cs) + if err != nil { + return "", err + } + + // Describe instance to get VPC ID + result, err := ec2Client.DescribeInstances(ctx, &ec2.DescribeInstancesInput{ + InstanceIds: []string{instanceID}, + }) + if err != nil { + return "", fmt.Errorf("failed to describe instance %s: %v", instanceID, err) + } + + if len(result.Reservations) == 0 || len(result.Reservations[0].Instances) == 0 { + return "", fmt.Errorf("instance %s not found", instanceID) + } + + vpcID := aws.ToString(result.Reservations[0].Instances[0].VpcId) + if vpcID == "" { + return "", fmt.Errorf("VPC ID not found for instance %s", instanceID) + } + + framework.Logf("discovered cluster VPC ID: %s", vpcID) + return vpcID, nil +} + +// getClusterName discovers the cluster name from a cluster node's tags. +func getClusterName(ctx context.Context, cs clientset.Interface, ec2Client *ec2.Client) (string, error) { + instanceID, err := getClusterInstanceID(ctx, cs) + if err != nil { + return "", err + } + + // Describe instance to get cluster tag + result, err := ec2Client.DescribeInstances(ctx, &ec2.DescribeInstancesInput{ + InstanceIds: []string{instanceID}, + }) + if err != nil { + return "", fmt.Errorf("failed to describe instance %s: %v", instanceID, err) + } + + if len(result.Reservations) == 0 || len(result.Reservations[0].Instances) == 0 { + return "", fmt.Errorf("instance %s not found", instanceID) + } + + // Find cluster tag (kubernetes.io/cluster/) + for _, tag := range result.Reservations[0].Instances[0].Tags { + key := aws.ToString(tag.Key) + if after, ok := strings.CutPrefix(key, "kubernetes.io/cluster/"); ok { + clusterName := after + framework.Logf("discovered cluster name: %s", clusterName) + return clusterName, nil + } + } + + return "", fmt.Errorf("cluster tag not found on instance %s", instanceID) +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go index 0bdfc8120..bc3011d73 100644 --- a/cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go +++ b/cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go @@ -3,10 +3,11 @@ package e2e import ( "context" "fmt" + "slices" "strings" "time" - elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" + "github.com/aws/aws-sdk-go-v2/aws" elbv2types "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -18,6 +19,8 @@ import ( "k8s.io/kubernetes/test/e2e/framework" e2eservice "k8s.io/kubernetes/test/e2e/framework/service" admissionapi "k8s.io/pod-security-admission/api" + + ccme2e "k8s.io/cloud-provider-aws/tests/e2e" ) const ( @@ -30,7 +33,8 @@ const ( // when available: features.FeatureGateAWSServiceLBNetworkSecurityGroup featureGateAWSServiceLBNetworkSecurityGroup = "AWSServiceLBNetworkSecurityGroup" - annotationLBType = "service.beta.kubernetes.io/aws-load-balancer-type" + annotationLBType = "service.beta.kubernetes.io/aws-load-balancer-type" + annotationLBSecurityGroups = "service.beta.kubernetes.io/aws-load-balancer-security-groups" cloudConfigNamespace = "openshift-cloud-controller-manager" cloudConfigName = "cloud-conf" @@ -118,21 +122,21 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala It("should create NLB service with security group attached", func(ctx context.Context) { isNLBFeatureEnabled(ctx) - By("creatomg required AWS clients") - elbClient, err := createAWSClientLoadBalancer(ctx) - framework.ExpectNoError(err, "failed to create AWS ELB client") + By("creating E2E test helper") + e2e, err := ccme2e.NewE2ETestHelper(ctx, cs) + framework.ExpectNoError(err, "failed to create E2E test helper") By("creating test service and deployment configuration") serviceName := "nlb-sg-crt" _, jig, err := createServiceNLB(ctx, cs, ns, serviceName, map[int32]int32{80: 8080}) framework.ExpectNoError(err, "failed to create NLB service load balancer") - foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, elbClient) + foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, e2e) framework.ExpectNoError(err, "failed to get NLB metadata") Expect(foundLB).NotTo(BeNil(), "found load balancer is nil") - DeferCleanup(func(cleanupCtx context.Context) { - err := deleteServiceAndWaitForLoadBalancerDeletion(cleanupCtx, jig, lbDNS) + DeferCleanup(func() { + err := deleteServiceAndWaitForLoadBalancerDeletion(e2e, jig, lbDNS) framework.ExpectNoError(err, "failed to delete service and wait for load balancer deletion") }) @@ -165,9 +169,9 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala It("should have security groups attached to default ingress controller NLB", func(ctx context.Context) { isNLBFeatureEnabled(ctx) - By("creatomg required AWS clients") - elbClient, err := createAWSClientLoadBalancer(ctx) - framework.ExpectNoError(err, "failed to create AWS ELB client") + By("creating E2E test helper") + e2e, err := ccme2e.NewE2ETestHelper(ctx, cs) + framework.ExpectNoError(err, "failed to create E2E test helper") By("getting default ingress controller service") ingressNamespace := "openshift-ingress" @@ -206,7 +210,7 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala var foundLB *elbv2types.LoadBalancer err = wait.PollUntilContextTimeout(ctx, 10*time.Second, 3*time.Minute, true, func(pollCtx context.Context) (bool, error) { - lb, err := getAWSLoadBalancerFromDNSName(pollCtx, elbClient, lbDNS) + lb, err := e2e.GetAWSHelper().GetLoadBalancerFromDNSNameWithRetry(lbDNS, 10*time.Minute) if err != nil { framework.Logf("Failed to find load balancer with DNS %s: %v", lbDNS, err) return false, nil @@ -253,24 +257,21 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala It("should update security group rules when service is updated", func(ctx context.Context) { isNLBFeatureEnabled(ctx) - By("creatomg required AWS clients") - ec2Client, err := createAWSClientEC2(ctx) - framework.ExpectNoError(err, "failed to create AWS EC2 client") - - elbClient, err := createAWSClientLoadBalancer(ctx) - framework.ExpectNoError(err, "failed to create AWS ELB client") + By("creating E2E test helper") + e2e, err := ccme2e.NewE2ETestHelper(ctx, cs) + framework.ExpectNoError(err, "failed to create E2E test helper") By("creating test service and deployment configuration") serviceName := "nlb-sg-upd" _, jig, err := createServiceNLB(ctx, cs, ns, serviceName, map[int32]int32{80: 8080}) framework.ExpectNoError(err, "failed to create NLB service load balancer") - foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, elbClient) + foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, e2e) framework.ExpectNoError(err, "failed to get NLB metadata") Expect(foundLB).NotTo(BeNil(), "found load balancer is nil") - DeferCleanup(func(cleanupCtx context.Context) { - err := deleteServiceAndWaitForLoadBalancerDeletion(cleanupCtx, jig, lbDNS) + DeferCleanup(func() { + err := deleteServiceAndWaitForLoadBalancerDeletion(e2e, jig, lbDNS) framework.ExpectNoError(err, "failed to delete service and wait for load balancer deletion") }) @@ -280,7 +281,7 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala framework.Logf("Load balancer has %d security group(s) attached before update", len(foundLB.SecurityGroups)) By("getting security group rules") - originalSGRules, err := getAWSSecurityGroupRules(ctx, ec2Client, foundLB.SecurityGroups) + originalSGRules, err := getAWSSecurityGroupRules(ctx, e2e.GetAWSHelper().GetEC2Client(), foundLB.SecurityGroups) framework.ExpectNoError(err, "failed to get security group rules") By("updating service: adding a new port") @@ -297,7 +298,7 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala By("waiting for security group rules to include the new port 443") Eventually(ctx, func(ctx context.Context) ([]int32, error) { - foundLB, err = getAWSLoadBalancerFromDNSName(ctx, elbClient, lbDNS) + foundLB, err = e2e.GetAWSHelper().GetLoadBalancerFromDNSNameWithRetry(lbDNS, 10*time.Minute) if err != nil { framework.Logf("Error finding load balancer: %v", err) return nil, err @@ -311,7 +312,7 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala return nil, fmt.Errorf("load balancer has no security groups attached") } - currentSGRules, err := getAWSSecurityGroupRules(ctx, ec2Client, foundLB.SecurityGroups) + currentSGRules, err := getAWSSecurityGroupRules(ctx, e2e.GetAWSHelper().GetEC2Client(), foundLB.SecurityGroups) if err != nil { framework.Logf("failed to get security group rules to calculate the diff: %v", err) return nil, err @@ -364,12 +365,9 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala It("should cleanup security groups when service is deleted", func(ctx context.Context) { isNLBFeatureEnabled(ctx) - By("creatomg required AWS clients") - ec2Client, err := createAWSClientEC2(ctx) - framework.ExpectNoError(err, "failed to create AWS EC2 client") - - elbClient, err := createAWSClientLoadBalancer(ctx) - framework.ExpectNoError(err, "failed to create AWS ELB client") + By("creating E2E test helper") + e2e, err := ccme2e.NewE2ETestHelper(ctx, cs) + framework.ExpectNoError(err, "failed to create E2E test helper") By("creating test service and deployment configuration") serviceName := "nlb-sg-cleanup-test" @@ -377,7 +375,7 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala _, jig, err := createServiceNLB(ctx, cs, ns, serviceName, map[int32]int32{80: 8080}) framework.ExpectNoError(err, "failed to create NLB service load balancer") - foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, elbClient) + foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, e2e) framework.ExpectNoError(err, "failed to get NLB metadata") Expect(foundLB).NotTo(BeNil(), "found load balancer is nil") @@ -393,12 +391,12 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala By("verifying security groups exist before deletion") for _, sgID := range securityGroupIDs { - exists, err := securityGroupExists(ctx, ec2Client, sgID) + exists, err := securityGroupExists(ctx, e2e.GetAWSHelper().GetEC2Client(), sgID) framework.ExpectNoError(err, "failed to check security group %s", sgID) Expect(exists).To(BeTrue(), "security group %s should exist before deletion", sgID) } - err = deleteServiceAndWaitForLoadBalancerDeletion(ctx, jig, lbDNS) + err = deleteServiceAndWaitForLoadBalancerDeletion(e2e, jig, lbDNS) framework.ExpectNoError(err, "failed to delete service and wait for load balancer deletion") By("verifying managed security groups are cleaned up") @@ -406,7 +404,7 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala err = wait.PollUntilContextTimeout(ctx, 10*time.Second, 3*time.Minute, true, func(ctx context.Context) (bool, error) { allDeleted := true for _, sgID := range securityGroupIDs { - exists, err := securityGroupExists(ctx, ec2Client, sgID) + exists, err := securityGroupExists(ctx, e2e.GetAWSHelper().GetEC2Client(), sgID) if err != nil { framework.Logf("Error checking security group %s: %v", sgID, err) return false, err @@ -447,12 +445,9 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala It("should have correct security group rules for service ports", func(ctx context.Context) { isNLBFeatureEnabled(ctx) - By("creatomg required AWS clients") - ec2Client, err := createAWSClientEC2(ctx) - framework.ExpectNoError(err, "failed to create AWS EC2 client") - - elbClient, err := createAWSClientLoadBalancer(ctx) - framework.ExpectNoError(err, "failed to create AWS ELB client") + By("creating E2E test helper") + e2e, err := ccme2e.NewE2ETestHelper(ctx, cs) + framework.ExpectNoError(err, "failed to create E2E test helper") By("creating test service and deployment configuration") serviceName := "nlb-sg-rules-test" @@ -465,12 +460,12 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala lbDNS := svc.Status.LoadBalancer.Ingress[0].Hostname framework.Logf("Load balancer DNS: %s", lbDNS) - foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, elbClient) + foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, e2e) framework.ExpectNoError(err, "failed to get NLB metadata") Expect(foundLB).NotTo(BeNil(), "found load balancer is nil") - DeferCleanup(func(cleanupCtx context.Context) { - err := deleteServiceAndWaitForLoadBalancerDeletion(cleanupCtx, jig, lbDNS) + DeferCleanup(func() { + err := deleteServiceAndWaitForLoadBalancerDeletion(e2e, jig, lbDNS) framework.ExpectNoError(err, "failed to delete service and wait for load balancer deletion") }) @@ -480,7 +475,7 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala framework.Logf("Load balancer has %d security group(s) attached", len(foundLB.SecurityGroups)) By("inspecting security group rules") - currentSGRules, err := getAWSSecurityGroupRules(ctx, ec2Client, foundLB.SecurityGroups) + currentSGRules, err := getAWSSecurityGroupRules(ctx, e2e.GetAWSHelper().GetEC2Client(), foundLB.SecurityGroups) framework.ExpectNoError(err, "failed to get security group rules to calculate the diff") Expect(len(currentSGRules)).To(BeNumerically(">", 0), "security group rules should not be empty") @@ -496,6 +491,434 @@ var _ = Describe(fmt.Sprintf("%s NLB [OCPFeatureGate:%s]", e2eTestPrefixLoadBala Expect(expectedPorts).To(ContainElements(int32(80), int32(443)), "security groups should include rules for ports 80 and 443") }) + + // Test: [cloud-provider-aws-e2e-openshift] loadbalancer NLB [OCPFeatureGate:AWSServiceLBNetworkSecurityGroup] should create NLB service with BYO security group and preserve it after deletion + // + // Creates a new Service type loadBalancer Network Load Balancer (NLB) with a user-provided (BYO) + // security group annotation, validates that the specified security group is attached to the NLB, + // then deletes the service and validates that the BYO security group is preserved (not deleted). + // + // Prerequisites: + // - AWSServiceLBNetworkSecurityGroup feature gate is enabled + // + // Expected Results: + // - BYO security group is created successfully + // - Service type loadBalancer Network Load Balancer (NLB) is created with BYO SG annotation + // - Backend pods start and become ready + // - Load balancer has the BYO security group attached (not managed SG) + // - BYO security group has no cluster tag (not "owned") + // - Service and load balancer are deleted successfully + // - BYO security group is NOT deleted (user retains ownership) + // - BYO security group still exists in AWS after service deletion + // - The test must fail if BYO security group is not attached or is deleted + // - The test must skip if the feature gate is not enabled + It("should create NLB with BYO SG and preserve it after deletion", func(ctx context.Context) { + isNLBFeatureEnabled(ctx) + + By("creating E2E test helper") + e2e, err := ccme2e.NewE2ETestHelper(ctx, cs) + framework.ExpectNoError(err, "failed to create E2E test helper") + + ec2Client := e2e.GetAWSHelper().GetEC2Client() + + By("discovering cluster VPC and name for BYO security group creation") + vpcID, err := getClusterVPCID(ctx, cs, ec2Client) + framework.ExpectNoError(err, "failed to get cluster VPC ID") + + clusterName, err := getClusterName(ctx, cs, ec2Client) + framework.ExpectNoError(err, "failed to get cluster name") + + By("creating BYO security group for testing") + sgName := fmt.Sprintf("e2e-nlb-byo-sg-create-%s", ns.Name) + sgDescription := fmt.Sprintf("BYO Security Group for e2e test %s", ns.Name) + byoSGID, err := createAWSSecurityGroup(ctx, ec2Client, sgName, sgDescription, vpcID) + framework.ExpectNoError(err, "failed to create BYO security group") + framework.Logf("created BYO security group: %s", byoSGID) + + // Add cleanup for BYO security group + DeferCleanup(func(cleanupCtx context.Context) { + By("cleaning up BYO security group") + // Create fresh e2e helper with cleanupCtx to avoid context cancellation issues + cleanupE2E, err := ccme2e.NewE2ETestHelper(cleanupCtx, cs) + if err != nil { + framework.Logf("warning: failed to create cleanup E2E helper: %v", err) + return + } + cleanupEC2Client := cleanupE2E.GetAWSHelper().GetEC2Client() + err = waitForSecurityGroupDeletion(cleanupCtx, cleanupEC2Client, byoSGID, 5*time.Minute) + if err != nil { + framework.Logf("warning: failed to delete BYO security group %s: %v", byoSGID, err) + } + }) + + By("adding ingress rules to BYO security group") + ports := []v1.ServicePort{{Port: 80, Protocol: v1.ProtocolTCP}} + err = authorizeSecurityGroupIngress(ctx, ec2Client, byoSGID, ports) + framework.ExpectNoError(err, "failed to authorize ingress for BYO security group") + + By("creating test service with BYO security group annotation") + serviceName := "nlb-byo-sg-create" + jig := e2eservice.NewTestJig(cs, ns.Name, serviceName) + + svc := &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: jig.Namespace, + Name: jig.Name, + Labels: jig.Labels, + Annotations: map[string]string{ + annotationLBType: "nlb", + annotationLBSecurityGroups: byoSGID, + }, + }, + Spec: v1.ServiceSpec{ + Type: v1.ServiceTypeLoadBalancer, + SessionAffinity: v1.ServiceAffinityNone, + Selector: jig.Labels, + Ports: []v1.ServicePort{ + { + Name: "http", + Protocol: v1.ProtocolTCP, + Port: 80, + TargetPort: intstr.FromInt(8080), + }, + }, + }, + } + + _, err = jig.Client.CoreV1().Services(jig.Namespace).Create(ctx, svc, metav1.CreateOptions{}) + framework.ExpectNoError(err, "failed to create LoadBalancer Service") + + By("waiting for AWS load balancer provisioning") + loadBalancerCreateTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs) + svc, err = jig.WaitForLoadBalancer(ctx, loadBalancerCreateTimeout) + framework.ExpectNoError(err, "LoadBalancer provisioning failed") + + By("extracting load balancer DNS name") + Expect(svc.Status.LoadBalancer.Ingress).NotTo(BeEmpty(), + "no ingress entry found in LoadBalancer status") + lbDNS := svc.Status.LoadBalancer.Ingress[0].Hostname + framework.Logf("load balancer DNS: %s", lbDNS) + + By("getting NLB from AWS API") + foundLB, err := e2e.GetAWSHelper().GetLoadBalancerFromDNSNameWithRetry(lbDNS, 10*time.Minute) + framework.ExpectNoError(err, "failed to find load balancer with DNS name %s", lbDNS) + Expect(foundLB).NotTo(BeNil(), "found load balancer is nil") + + By("verifying BYO security group is attached to the NLB") + Expect(foundLB.SecurityGroups).NotTo(BeEmpty(), + "load balancer should have security groups attached") + + foundBYOSG := slices.Contains(foundLB.SecurityGroups, byoSGID) + Expect(foundBYOSG).To(BeTrue(), + "load balancer should have the BYO security group %s attached, but found: %v", byoSGID, foundLB.SecurityGroups) + + By("verifying BYO security group is not cluster owned") + isManaged, err := isSecurityGroupManaged(ctx, ec2Client, byoSGID, clusterName) + framework.ExpectNoError(err, "failed to check if BYO security group is managed") + Expect(isManaged).To(BeFalse(), + "BYO security group should NOT be managed by the controller (should not have 'owned' tag)") + + framework.Logf("successfully validated NLB with BYO security group %s", byoSGID) + + By("verifying BYO security group exists before service deletion") + exists, err := securityGroupExists(ctx, ec2Client, byoSGID) + framework.ExpectNoError(err, "failed to check if BYO security group exists") + Expect(exists).To(BeTrue(), "BYO security group %s should exist before service deletion", byoSGID) + + By("deleting the service") + err = deleteServiceAndWaitForLoadBalancerDeletion(e2e, jig, lbDNS) + framework.ExpectNoError(err, "failed to delete service and wait for load balancer deletion") + framework.Logf("service and load balancer deleted successfully") + + By("verifying BYO security group STILL EXISTS after service deletion") + exists, err = securityGroupExists(ctx, ec2Client, byoSGID) + framework.ExpectNoError(err, "failed to check if BYO security group exists after deletion") + Expect(exists).To(BeTrue(), + "BYO security group %s should NOT be deleted by the controller (user retains ownership)", byoSGID) + + By("verifying BYO security group properties are unchanged") + sg, err := getAWSSecurityGroup(ctx, ec2Client, byoSGID) + framework.ExpectNoError(err, "failed to get BYO security group after service deletion") + Expect(sg).NotTo(BeNil(), "BYO security group should be retrievable after service deletion") + Expect(aws.ToString(sg.GroupName)).To(Equal(sgName), + "BYO security group name should be unchanged") + + // Verify it's still marked as not cluster owned + isManaged, err = isSecurityGroupManaged(ctx, ec2Client, byoSGID, clusterName) + framework.ExpectNoError(err, "failed to check if BYO security group is managed") + Expect(isManaged).To(BeFalse(), + "BYO security group should still be user-managed (not controller-owned) after service deletion") + + framework.Logf("successfully validated BYO security group %s was preserved after service deletion", byoSGID) + }) + + // Test: [cloud-provider-aws-e2e-openshift] loadbalancer NLB [OCPFeatureGate:AWSServiceLBNetworkSecurityGroup] should transition NLB between managed and BYO security groups + // + // Creates a Service type loadBalancer Network Load Balancer (NLB) with managed security groups, + // transitions to a user-provided (BYO) security group, then transitions back to managed security groups, + // validating the full round-trip and verifying BYO security group preservation. + // + // Prerequisites: + // - AWSServiceLBNetworkSecurityGroup feature gate is enabled + // + // Expected Results: + // - Service type loadBalancer Network Load Balancer (NLB) is created with managed SG initially + // - Managed security group is attached and has cluster ownership tag ("owned") + // - Service is updated with BYO security group annotation + // - Controller transitions from managed SG to BYO SG + // - Load balancer has BYO security group attached after first transition + // - Old managed security groups are deleted by the controller + // - Service is updated to remove BYO security group annotation + // - Controller transitions back from BYO SG to managed SG + // - Load balancer has new managed security group attached after second transition + // - BYO security group is preserved (not deleted) throughout + // - The test must fail if any transition doesn't occur correctly + // - The test must skip if the feature gate is not enabled + It("should transition NLB between managed and BYO security groups", func(ctx context.Context) { + isNLBFeatureEnabled(ctx) + + By("creating E2E test helper") + e2e, err := ccme2e.NewE2ETestHelper(ctx, cs) + framework.ExpectNoError(err, "failed to create E2E test helper") + + ec2Client := e2e.GetAWSHelper().GetEC2Client() + + By("discovering cluster name for security group management") + clusterName, err := getClusterName(ctx, cs, ec2Client) + framework.ExpectNoError(err, "failed to get cluster name") + + By("creating test service with managed security groups (no BYO annotation)") + serviceName := "nlb-sg-update" + _, jig, err := createServiceNLB(ctx, cs, ns, serviceName, map[int32]int32{80: 8080}) + framework.ExpectNoError(err, "failed to create NLB service load balancer") + + foundLB, lbDNS, err := getNLBMetaFromName(ctx, cs, ns, serviceName, e2e) + framework.ExpectNoError(err, "failed to get NLB metadata") + Expect(foundLB).NotTo(BeNil(), "found load balancer is nil") + + DeferCleanup(func(cleanupCtx context.Context) { + // Create fresh e2e helper with cleanupCtx to avoid context cancellation issues + cleanupE2E, err := ccme2e.NewE2ETestHelper(cleanupCtx, cs) + if err != nil { + framework.Logf("warning: failed to create cleanup E2E helper: %v", err) + return + } + err = deleteServiceAndWaitForLoadBalancerDeletion(cleanupE2E, jig, lbDNS) + framework.ExpectNoError(err, "failed to delete service and wait for load balancer deletion") + }) + + By("verifying managed security groups are attached initially") + Expect(foundLB.SecurityGroups).NotTo(BeEmpty(), + "load balancer should have managed security groups attached initially") + initialManagedSGs := foundLB.SecurityGroups + framework.Logf("initial managed security groups: %v", initialManagedSGs) + + By("verifying initial security groups are managed by the controller") + for _, sgID := range initialManagedSGs { + isManaged, err := isSecurityGroupManaged(ctx, ec2Client, sgID, clusterName) + framework.ExpectNoError(err, "failed to check if security group %s is managed", sgID) + Expect(isManaged).To(BeTrue(), + "initial security group %s should be managed by the controller", sgID) + } + + By("discovering cluster VPC for BYO security group creation") + vpcID, err := getClusterVPCID(ctx, cs, ec2Client) + framework.ExpectNoError(err, "failed to get cluster VPC ID") + + By("creating BYO security group for transition") + sgName := fmt.Sprintf("e2e-nlb-byo-sg-update-%s", ns.Name) + sgDescription := fmt.Sprintf("BYO Security Group for e2e test %s", ns.Name) + byoSGID, err := createAWSSecurityGroup(ctx, ec2Client, sgName, sgDescription, vpcID) + framework.ExpectNoError(err, "failed to create BYO security group") + framework.Logf("created BYO security group: %s", byoSGID) + + // Add cleanup for BYO security group + DeferCleanup(func(cleanupCtx context.Context) { + By("cleaning up BYO security group") + // Create fresh e2e helper with cleanupCtx to avoid context cancellation issues + cleanupE2E, err := ccme2e.NewE2ETestHelper(cleanupCtx, cs) + if err != nil { + framework.Logf("warning: failed to create cleanup E2E helper: %v", err) + return + } + cleanupEC2Client := cleanupE2E.GetAWSHelper().GetEC2Client() + err = waitForSecurityGroupDeletion(cleanupCtx, cleanupEC2Client, byoSGID, 5*time.Minute) + if err != nil { + framework.Logf("warning: failed to delete BYO security group %s: %v", byoSGID, err) + } + }) + + By("adding ingress rules to BYO security group") + ports := []v1.ServicePort{{Port: 80, Protocol: v1.ProtocolTCP}} + err = authorizeSecurityGroupIngress(ctx, ec2Client, byoSGID, ports) + framework.ExpectNoError(err, "failed to authorize ingress for BYO security group") + + // Phase 1: Transition from managed SG to BYO SG + By("updating service with BYO security group annotation") + _, err = jig.UpdateService(ctx, func(s *v1.Service) { + if s.Annotations == nil { + s.Annotations = make(map[string]string) + } + s.Annotations[annotationLBSecurityGroups] = byoSGID + }) + framework.ExpectNoError(err, "failed to update service with BYO security group annotation") + framework.Logf("service updated with BYO security group annotation: %s", byoSGID) + + By("waiting for controller to reconcile and attach BYO security group") + var updatedLB *elbv2types.LoadBalancer + err = wait.PollUntilContextTimeout(ctx, 10*time.Second, 3*time.Minute, true, func(pollCtx context.Context) (bool, error) { + select { + case <-pollCtx.Done(): + return false, pollCtx.Err() + default: + } + + lb, err := e2e.GetAWSHelper().GetLoadBalancerFromDNSName(lbDNS) + if err != nil { + framework.Logf("error getting load balancer: %v", err) + return false, nil + } + if lb == nil { + framework.Logf("load balancer not found yet") + return false, nil + } + + // Check if BYO SG is attached + if slices.Contains(lb.SecurityGroups, byoSGID) { + updatedLB = lb + framework.Logf("BYO security group %s is now attached to load balancer", byoSGID) + return true, nil + } + + framework.Logf("BYO security group not yet attached, current SGs: %v", lb.SecurityGroups) + return false, nil + }) + framework.ExpectNoError(err, "BYO security group should be attached to load balancer after service update") + Expect(updatedLB).NotTo(BeNil(), "updated load balancer should not be nil") + + By("verifying BYO security group is attached to the NLB") + foundBYOSG := slices.Contains(updatedLB.SecurityGroups, byoSGID) + Expect(foundBYOSG).To(BeTrue(), + "load balancer should have BYO security group %s attached after update", byoSGID) + + By("verifying old managed security groups are deleted") + err = wait.PollUntilContextTimeout(ctx, 10*time.Second, 3*time.Minute, true, func(pollCtx context.Context) (bool, error) { + select { + case <-pollCtx.Done(): + return false, pollCtx.Err() + default: + } + + allDeleted := true + for _, sgID := range initialManagedSGs { + exists, err := securityGroupExists(pollCtx, ec2Client, sgID) + if err != nil { + framework.Logf("error checking if managed SG %s exists: %v", sgID, err) + return false, nil + } + if exists { + framework.Logf("managed security group %s still exists, waiting for cleanup...", sgID) + allDeleted = false + } else { + framework.Logf("managed security group %s was successfully cleaned up", sgID) + } + } + return allDeleted, nil + }) + framework.ExpectNoError(err, "old managed security groups should be deleted after BYO SG is attached") + + framework.Logf("successfully validated transition from managed SG to BYO SG %s", byoSGID) + + // Round-trip: Transition back from BYO to managed + By("updating service to remove BYO security group annotation (transition back to managed)") + _, err = jig.UpdateService(ctx, func(s *v1.Service) { + delete(s.Annotations, annotationLBSecurityGroups) + }) + framework.ExpectNoError(err, "failed to update service to remove BYO security group annotation") + framework.Logf("service updated to remove BYO security group annotation") + + By("waiting for controller to reconcile and attach new managed security group") + var finalLB *elbv2types.LoadBalancer + var newManagedSGIDs []string + err = wait.PollUntilContextTimeout(ctx, 10*time.Second, 3*time.Minute, true, func(pollCtx context.Context) (bool, error) { + select { + case <-pollCtx.Done(): + return false, pollCtx.Err() + default: + } + + lb, err := e2e.GetAWSHelper().GetLoadBalancerFromDNSName(lbDNS) + if err != nil { + framework.Logf("error getting load balancer: %v", err) + return false, nil + } + if lb == nil { + framework.Logf("load balancer not found yet") + return false, nil + } + + // Check if BYO SG is removed + hasBYO := slices.Contains(lb.SecurityGroups, byoSGID) + if hasBYO { + framework.Logf("BYO security group still attached, waiting for transition back to managed...") + return false, nil + } + + // Must have at least one security group + if len(lb.SecurityGroups) == 0 { + framework.Logf("no security groups attached yet") + return false, nil + } + + // Check if the new SG is managed + for _, sgID := range lb.SecurityGroups { + managed, err := isSecurityGroupManaged(pollCtx, ec2Client, sgID, clusterName) + if err != nil { + framework.Logf("error checking if SG %s is managed: %v", sgID, err) + return false, nil + } + if managed { + finalLB = lb + newManagedSGIDs = lb.SecurityGroups + framework.Logf("new managed security groups attached: %v", newManagedSGIDs) + return true, nil + } + } + + framework.Logf("waiting for managed security groups to be created and attached") + return false, nil + }) + framework.ExpectNoError(err, "new managed security group should be created and attached after removing BYO annotation") + Expect(finalLB).NotTo(BeNil(), "final load balancer should not be nil") + Expect(newManagedSGIDs).NotTo(BeEmpty(), "should have new managed security groups attached") + + By("verifying BYO security group is no longer attached after transition to managed") + hasBYO := slices.Contains(finalLB.SecurityGroups, byoSGID) + Expect(hasBYO).To(BeFalse(), + "BYO security group %s should no longer be attached to load balancer after transition", byoSGID) + + By("verifying new security groups are managed by the controller") + for _, sgID := range newManagedSGIDs { + isManaged, err := isSecurityGroupManaged(ctx, ec2Client, sgID, clusterName) + framework.ExpectNoError(err, "failed to check if security group %s is managed", sgID) + Expect(isManaged).To(BeTrue(), + "new security group %s should be managed by the controller after transition back from BYO", sgID) + } + + By("verifying BYO security group STILL EXISTS after round-trip") + exists, err := securityGroupExists(ctx, ec2Client, byoSGID) + framework.ExpectNoError(err, "failed to check if BYO security group exists") + Expect(exists).To(BeTrue(), + "BYO security group %s should be preserved throughout round-trip transitions", byoSGID) + + By("verifying BYO security group is still not managed") + isManaged, err := isSecurityGroupManaged(ctx, ec2Client, byoSGID, clusterName) + framework.ExpectNoError(err, "failed to check if BYO security group is managed") + Expect(isManaged).To(BeFalse(), + "BYO security group should remain user-managed after round-trip") + + framework.Logf("successfully validated round-trip transition: managed -> BYO -> managed with BYO preserved") + }) }) // createServiceNLB creates a Service type loadBalancer Network Load Balancer (NLB) with the given port mapping. @@ -543,7 +966,7 @@ func createServiceNLB(ctx context.Context, cs clientset.Interface, ns *v1.Namesp } // getNLBMetaFromName gets the NLB metadata (AWS API object) from the service/loadbalancer name. -func getNLBMetaFromName(ctx context.Context, cs clientset.Interface, ns *v1.Namespace, serviceName string, elbc *elbv2.Client) (*elbv2types.LoadBalancer, string, error) { +func getNLBMetaFromName(ctx context.Context, cs clientset.Interface, ns *v1.Namespace, serviceName string, e2e *ccme2e.E2ETestHelper) (*elbv2types.LoadBalancer, string, error) { By("getting service to extract load balancer DNS name") svc, err := cs.CoreV1().Services(ns.Name).Get(ctx, serviceName, metav1.GetOptions{}) framework.ExpectNoError(err, "failed to get service %s", serviceName) @@ -556,16 +979,29 @@ func getNLBMetaFromName(ctx context.Context, cs clientset.Interface, ns *v1.Name Expect(lbDNS).NotTo(BeEmpty(), "Ingress Hostname must not be empty") framework.Logf("Load balancer DNS: %s", lbDNS) - foundLB, err := getAWSLoadBalancerFromDNSName(ctx, elbc, lbDNS) - framework.ExpectNoError(err, "failed to find load balancer with DNS name %s", lbDNS) + // Use Eventually to handle AWS API eventual consistency - the Kubernetes service + // may show the LB DNS before AWS API has fully propagated the resource. + // Based on observed CI failures, this can take 30s-2min in high-load environments. + var foundLB *elbv2types.LoadBalancer + Eventually(ctx, func(ctx context.Context) error { + lb, err := e2e.GetAWSHelper().GetLoadBalancerFromDNSNameWithRetry(lbDNS, 10*time.Minute) + if err != nil { + e2e.GatherServiceInfo() + return fmt.Errorf("failed to find load balancer with DNS name %s: %v", lbDNS, err) + } + foundLB = lb + return nil + }, 5*time.Minute, 5*time.Second).Should(Succeed(), "failed to find load balancer with DNS name %s", lbDNS) Expect(foundLB).NotTo(BeNil(), "found load balancer is nil") return foundLB, lbDNS, nil } // deleteServiceAndWaitForLoadBalancerDeletion deletes the service and waits for the load balancer to be deleted. -func deleteServiceAndWaitForLoadBalancerDeletion(ctx context.Context, jig *e2eservice.TestJig, lbDNS string) error { +func deleteServiceAndWaitForLoadBalancerDeletion(e2e *ccme2e.E2ETestHelper, jig *e2eservice.TestJig, lbDNS string) error { By("deleting the service") + // using deletion context to avoid leaking resources + ctx := context.TODO() err := jig.Client.CoreV1().Services(jig.Namespace).Delete(ctx, jig.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete service") @@ -573,12 +1009,9 @@ func deleteServiceAndWaitForLoadBalancerDeletion(ctx context.Context, jig *e2ese loadBalancerCreateTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, jig.Client) // Get ELB client once before polling - elbClient, err := createAWSClientLoadBalancer(ctx) - framework.ExpectNoError(err, "failed to create AWS ELB client") - // Poll for load balancer deletion err = wait.PollUntilContextTimeout(ctx, 5*time.Second, loadBalancerCreateTimeout, true, func(ctx context.Context) (bool, error) { - foundLB, err := getAWSLoadBalancerFromDNSName(ctx, elbClient, lbDNS) + foundLB, err := e2e.GetAWSHelper().GetLoadBalancerFromDNSName(lbDNS) if err != nil { // Check if the error indicates the load balancer was not found (i.e., successfully deleted) if strings.Contains(err.Error(), "no load balancer found with DNS name") { diff --git a/cmd/cloud-controller-manager-aws-tests-ext/go.mod b/cmd/cloud-controller-manager-aws-tests-ext/go.mod index bdf63933b..99100223f 100644 --- a/cmd/cloud-controller-manager-aws-tests-ext/go.mod +++ b/cmd/cloud-controller-manager-aws-tests-ext/go.mod @@ -3,8 +3,6 @@ module github.com/openshift/cluster-cloud-controller-manager-operator/cmd/cloud- go 1.25.0 require ( - github.com/aws/aws-sdk-go-v2 v1.41.2 - github.com/aws/aws-sdk-go-v2/config v1.29.14 github.com/aws/aws-sdk-go-v2/service/ec2 v1.291.0 github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.2 github.com/onsi/ginkgo/v2 v2.27.2 @@ -21,6 +19,11 @@ require ( k8s.io/pod-security-admission v0.35.0 ) +// Use development branch @mtulio e2e-lb-export +replace k8s.io/cloud-provider-aws/tests/e2e => github.com/mtulio/openshift-cloud-provider-aws/tests/e2e v0.0.0-20260415131057-8fd9d13a9d84 + +//replace k8s.io/cloud-provider-aws/tests/e2e => /home/mtulio/openshift/OCPSTRAT-1553/cloud-provider-aws/tests/e2e + // Mandatory: replace ( github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20260303184444-1cc650aa0565 @@ -44,11 +47,14 @@ require ( cel.dev/expr v0.24.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.41.2 // indirect + github.com/aws/aws-sdk-go-v2/config v1.29.14 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.17.67 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.31 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.18 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.18 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.30.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.5 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.18 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect diff --git a/cmd/cloud-controller-manager-aws-tests-ext/go.sum b/cmd/cloud-controller-manager-aws-tests-ext/go.sum index 334c23526..48d28e6b9 100644 --- a/cmd/cloud-controller-manager-aws-tests-ext/go.sum +++ b/cmd/cloud-controller-manager-aws-tests-ext/go.sum @@ -22,6 +22,8 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo= github.com/aws/aws-sdk-go-v2/service/ec2 v1.291.0 h1:E0/zdPeHKCpXVRAImhnHJYgpfZnTCjnr6i75gZIhwHs= github.com/aws/aws-sdk-go-v2/service/ec2 v1.291.0/go.mod h1:2dMnUs1QzlGzsm46i9oBHAxVHQp7b6qF7PljWcgVEVE= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.30.1 h1:ZZeI9bCwIbqoKu5hll1dmisMJ4ZeBEhdsszV/gOFm1s= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.30.1/go.mod h1:fcC73gpU/J/SmRut8/CmwM5oJO3bSpW7wgufVdtWSbg= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.2 h1:vX70Z4lNSr7XsioU0uJq5yvxgI50sB66MvD+V/3buS4= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.2/go.mod h1:xnCC3vFBfOKpU6PcsCKL2ktgBTZfOwTGxj6V8/X3IS4= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.5 h1:CeY9LUdur+Dxoeldqoun6y4WtJ3RQtzk0JMP2gfUay0= @@ -133,6 +135,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mtulio/openshift-cloud-provider-aws/tests/e2e v0.0.0-20260415131057-8fd9d13a9d84 h1:5AqFczfA4rGNOrPTE/tyZ5XSJzou3ka6nyBFux2arzA= +github.com/mtulio/openshift-cloud-provider-aws/tests/e2e v0.0.0-20260415131057-8fd9d13a9d84/go.mod h1:22QAhWLqKQT8QiaKlEgSm8QyFAkj1hX73GFtbkqk5hQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= @@ -281,8 +285,6 @@ k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE= k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o= k8s.io/cloud-provider v0.34.0 h1:OgrNE+WSgfvDBQf6WS9qFM7Xr37bc0Og5kkL4hyWDmU= k8s.io/cloud-provider v0.34.0/go.mod h1:JbMa0t6JIGDMLI7Py6bdp9TN6cfuHrWGq+E/X+Ljkmo= -k8s.io/cloud-provider-aws/tests/e2e v0.0.0-20260227223131-ea961d6fafc4 h1:P2kEeJ9pxw1o/zMuotP+GSMHI0sKMyvsbM6+OTG6DfY= -k8s.io/cloud-provider-aws/tests/e2e v0.0.0-20260227223131-ea961d6fafc4/go.mod h1:6q0Y7+Tbsr4ResiMxyA5t4yyiNRw+doPG2SiBeAwdpM= k8s.io/component-base v0.35.0 h1:+yBrOhzri2S1BVqyVSvcM3PtPyx5GUxCK2tinZz1G94= k8s.io/component-base v0.35.0/go.mod h1:85SCX4UCa6SCFt6p3IKAPej7jSnF3L8EbfSyMZayJR0= k8s.io/component-helpers v0.35.0 h1:wcXv7HJRksgVjM4VlXJ1CNFBpyDHruRI99RrBtrJceA= diff --git a/cmd/cloud-controller-manager-aws-tests-ext/main.go b/cmd/cloud-controller-manager-aws-tests-ext/main.go index 5fd588f94..42e91b86e 100644 --- a/cmd/cloud-controller-manager-aws-tests-ext/main.go +++ b/cmd/cloud-controller-manager-aws-tests-ext/main.go @@ -61,6 +61,7 @@ func main() { if err != nil { panic(fmt.Errorf("failed to select specs: %w", err)) } + // TODO: Exclude specs when the environment variable is set. // Skip set of tests when topology is SingleReplica. singleReplicaSkips := []string{ diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/CHANGELOG.md b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/CHANGELOG.md new file mode 100644 index 000000000..145fe7510 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/CHANGELOG.md @@ -0,0 +1,624 @@ +# v1.30.1 (2025-07-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.0 (2025-07-28) + +* **Feature**: Add support for HTTP interceptors. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.29.7 (2025-07-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.29.6 (2025-06-17) + +* **Dependency Update**: Update to smithy-go v1.22.4. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.29.5 (2025-06-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.29.4 (2025-06-06) + +* No change notes available for this release. + +# v1.29.3 (2025-04-10) + +* No change notes available for this release. + +# v1.29.2 (2025-04-03) + +* No change notes available for this release. + +# v1.29.1 (2025-03-04.2) + +* **Bug Fix**: Add assurance test for operation order. + +# v1.29.0 (2025-02-27) + +* **Feature**: Track credential providers via User-Agent Feature ids +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.18 (2025-02-18) + +* **Bug Fix**: Bump go version to 1.22 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.17 (2025-02-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.16 (2025-02-04) + +* No change notes available for this release. + +# v1.28.15 (2025-01-31) + +* **Dependency Update**: Switch to code-generated waiter matchers, removing the dependency on go-jmespath. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.14 (2025-01-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.13 (2025-01-24) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.22.2. + +# v1.28.12 (2025-01-17) + +* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. + +# v1.28.11 (2025-01-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.10 (2025-01-14) + +* **Bug Fix**: Fix issue where waiters were not failing on unmatched errors as they should. This may have breaking behavioral changes for users in fringe cases. See [this announcement](https://github.com/aws/aws-sdk-go-v2/discussions/2954) for more information. + +# v1.28.9 (2025-01-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.8 (2025-01-08) + +* No change notes available for this release. + +# v1.28.7 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.6 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.5 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.4 (2024-10-03) + +* No change notes available for this release. + +# v1.27.3 (2024-09-27) + +* No change notes available for this release. + +# v1.27.2 (2024-09-25) + +* No change notes available for this release. + +# v1.27.1 (2024-09-23) + +* No change notes available for this release. + +# v1.27.0 (2024-09-20) + +* **Feature**: Add tracing and metrics support to service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.8 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + +# v1.26.7 (2024-09-04) + +* No change notes available for this release. + +# v1.26.6 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.5 (2024-08-22) + +* No change notes available for this release. + +# v1.26.4 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.3 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.2 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.1 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2024-06-26) + +* **Feature**: Support list-of-string endpoint parameter. + +# v1.25.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2024-06-18) + +* **Feature**: Track usage of various AWS SDK features in user-agent string. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.11 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.10 (2024-06-07) + +* **Bug Fix**: Add clock skew correction on all service clients +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.9 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.8 (2024-05-23) + +* No change notes available for this release. + +# v1.24.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.5 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.24.4 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.3 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.2 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.1 (2024-02-23) + +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.23.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.23.0 (2024-02-16) + +* **Feature**: Add new ClientOptions field to waiter config which allows you to extend the config for operation calls made by waiters. + +# v1.22.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.7 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.6 (2023-12-20) + +* No change notes available for this release. + +# v1.21.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.21.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.21.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.4 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.20.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-10-24) + +* **Feature**: **BREAKFIX**: Correct nullability and default value representation of various input fields across a large number of services. Calling code that references one or more of the affected fields will need to update usage accordingly. See [2162](https://github.com/aws/aws-sdk-go-v2/issues/2162). + +# v1.17.2 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.16.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2023-08-01) + +* No change notes available for this release. + +# v1.16.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.14 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.13 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.12 (2023-06-15) + +* No change notes available for this release. + +# v1.15.11 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.10 (2023-05-04) + +* No change notes available for this release. + +# v1.15.9 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.8 (2023-04-10) + +* No change notes available for this release. + +# v1.15.7 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.6 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.5 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.4 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.15.3 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization. + +# v1.15.1 (2023-01-23) + +* No change notes available for this release. + +# v1.15.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.14.25 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.24 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.23 (2022-11-22) + +* No change notes available for this release. + +# v1.14.22 (2022-11-16) + +* No change notes available for this release. + +# v1.14.21 (2022-11-10) + +* No change notes available for this release. + +# v1.14.20 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.19 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.18 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.17 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.16 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.15 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.14 (2022-08-30) + +* No change notes available for this release. + +# v1.14.13 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.12 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.11 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.10 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.9 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.8 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.7 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. +* **Feature**: Updated to latest service endpoints + +# v1.9.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. +* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature. + +# v1.8.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-21) + +* **Feature**: API client updated +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.2 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-07-15) + +* **Feature**: The ErrorCode method on generated service error types has been corrected to match the API model. +* **Documentation**: Updated service model to latest revision. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-06-25) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/LICENSE b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/LICENSE.txt similarity index 100% rename from cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/LICENSE rename to cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/LICENSE.txt diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_client.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_client.go new file mode 100644 index 000000000..b149d2126 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_client.go @@ -0,0 +1,1012 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "Elastic Load Balancing" +const ServiceAPIVersion = "2012-06-01" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing") +} + +// Client provides the API client to make operations call for Elastic Load +// Balancing. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveInterceptors(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func resolveInterceptors(cfg aws.Config, o *Options) { + o.Interceptors = cfg.Interceptors.Copy() +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "elasticloadbalancing", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing") + }) + if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +type setCredentialSourceMiddleware struct { + ua *awsmiddleware.RequestUserAgent + options Options +} + +func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } + +func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( + out middleware.BuildOutput, metadata middleware.Metadata, err error, +) { + asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) + if !ok { + return next.HandleBuild(ctx, in) + } + providerSources := asProviderSource.ProviderSources() + for _, source := range providerSources { + m.ua.AddCredentialsSource(source) + } + return next.HandleBuild(ctx, in) +} + +func addCredentialSource(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + mw := setCredentialSourceMiddleware{ua: ua, options: options} + return stack.Build.Insert(&mw, "UserAgent", middleware.Before) +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { + return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ + Interceptors: opts.Interceptors.BeforeRetryLoop, + }, "Retry", middleware.Before) +} + +func addInterceptAttempt(stack *middleware.Stack, opts Options) error { + return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ + BeforeAttempt: opts.Interceptors.BeforeAttempt, + AfterAttempt: opts.Interceptors.AfterAttempt, + }, "Retry", middleware.After) +} + +func addInterceptExecution(stack *middleware.Stack, opts Options) error { + return stack.Initialize.Add(&smithyhttp.InterceptExecution{ + BeforeExecution: opts.Interceptors.BeforeExecution, + AfterExecution: opts.Interceptors.AfterExecution, + }, middleware.Before) +} + +func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { + return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ + Interceptors: opts.Interceptors.BeforeSerialization, + }, "OperationSerializer", middleware.Before) +} + +func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { + return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ + Interceptors: opts.Interceptors.AfterSerialization, + }, "OperationSerializer", middleware.After) +} + +func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { + return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ + Interceptors: opts.Interceptors.BeforeSigning, + }, "Signing", middleware.Before) +} + +func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { + return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ + Interceptors: opts.Interceptors.AfterSigning, + }, "Signing", middleware.After) +} + +func addInterceptTransmit(stack *middleware.Stack, opts Options) error { + return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ + BeforeTransmit: opts.Interceptors.BeforeTransmit, + AfterTransmit: opts.Interceptors.AfterTransmit, + }, middleware.After) +} + +func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { + return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ + Interceptors: opts.Interceptors.BeforeDeserialization, + }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) +} + +func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { + return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ + Interceptors: opts.Interceptors.AfterDeserialization, + }, "OperationDeserializer", middleware.Before) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_AddTags.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_AddTags.go new file mode 100644 index 000000000..5d06652a0 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_AddTags.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds the specified tags to the specified load balancer. Each load balancer can +// have a maximum of 10 tags. +// +// Each tag consists of a key and an optional value. If a tag with the same key is +// already associated with the load balancer, AddTags updates its value. +// +// For more information, see [Tag Your Classic Load Balancer] in the Classic Load Balancers Guide. +// +// [Tag Your Classic Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html +func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...func(*Options)) (*AddTagsOutput, error) { + if params == nil { + params = &AddTagsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddTags", params, optFns, c.addOperationAddTagsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddTagsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for AddTags. +type AddTagsInput struct { + + // The name of the load balancer. You can specify one load balancer only. + // + // This member is required. + LoadBalancerNames []string + + // The tags. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +// Contains the output of AddTags. +type AddTagsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAddTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAddTags{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddTags{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AddTags"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpAddTagsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTags(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAddTags(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AddTags", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ApplySecurityGroupsToLoadBalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ApplySecurityGroupsToLoadBalancer.go new file mode 100644 index 000000000..c57f6f31d --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ApplySecurityGroupsToLoadBalancer.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates one or more security groups with your load balancer in a virtual +// private cloud (VPC). The specified security groups override the previously +// associated security groups. +// +// For more information, see [Security Groups for Load Balancers in a VPC] in the Classic Load Balancers Guide. +// +// [Security Groups for Load Balancers in a VPC]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups +func (c *Client) ApplySecurityGroupsToLoadBalancer(ctx context.Context, params *ApplySecurityGroupsToLoadBalancerInput, optFns ...func(*Options)) (*ApplySecurityGroupsToLoadBalancerOutput, error) { + if params == nil { + params = &ApplySecurityGroupsToLoadBalancerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ApplySecurityGroupsToLoadBalancer", params, optFns, c.addOperationApplySecurityGroupsToLoadBalancerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ApplySecurityGroupsToLoadBalancerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for ApplySecurityGroupsToLoadBalancer. +type ApplySecurityGroupsToLoadBalancerInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The IDs of the security groups to associate with the load balancer. Note that + // you cannot specify the name of the security group. + // + // This member is required. + SecurityGroups []string + + noSmithyDocumentSerde +} + +// Contains the output of ApplySecurityGroupsToLoadBalancer. +type ApplySecurityGroupsToLoadBalancerOutput struct { + + // The IDs of the security groups associated with the load balancer. + SecurityGroups []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationApplySecurityGroupsToLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpApplySecurityGroupsToLoadBalancer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpApplySecurityGroupsToLoadBalancer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ApplySecurityGroupsToLoadBalancer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpApplySecurityGroupsToLoadBalancerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opApplySecurityGroupsToLoadBalancer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opApplySecurityGroupsToLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ApplySecurityGroupsToLoadBalancer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_AttachLoadBalancerToSubnets.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_AttachLoadBalancerToSubnets.go new file mode 100644 index 000000000..0540aa35a --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_AttachLoadBalancerToSubnets.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds one or more subnets to the set of configured subnets for the specified +// load balancer. +// +// The load balancer evenly distributes requests across all registered subnets. +// For more information, see [Add or Remove Subnets for Your Load Balancer in a VPC]in the Classic Load Balancers Guide. +// +// [Add or Remove Subnets for Your Load Balancer in a VPC]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-manage-subnets.html +func (c *Client) AttachLoadBalancerToSubnets(ctx context.Context, params *AttachLoadBalancerToSubnetsInput, optFns ...func(*Options)) (*AttachLoadBalancerToSubnetsOutput, error) { + if params == nil { + params = &AttachLoadBalancerToSubnetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AttachLoadBalancerToSubnets", params, optFns, c.addOperationAttachLoadBalancerToSubnetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AttachLoadBalancerToSubnetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for AttachLoaBalancerToSubnets. +type AttachLoadBalancerToSubnetsInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The IDs of the subnets to add. You can add only one subnet per Availability + // Zone. + // + // This member is required. + Subnets []string + + noSmithyDocumentSerde +} + +// Contains the output of AttachLoadBalancerToSubnets. +type AttachLoadBalancerToSubnetsOutput struct { + + // The IDs of the subnets attached to the load balancer. + Subnets []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAttachLoadBalancerToSubnetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAttachLoadBalancerToSubnets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAttachLoadBalancerToSubnets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AttachLoadBalancerToSubnets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpAttachLoadBalancerToSubnetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachLoadBalancerToSubnets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAttachLoadBalancerToSubnets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AttachLoadBalancerToSubnets", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ConfigureHealthCheck.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ConfigureHealthCheck.go new file mode 100644 index 000000000..fbc8dd640 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ConfigureHealthCheck.go @@ -0,0 +1,202 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the health check settings to use when evaluating the health state of +// your EC2 instances. +// +// For more information, see [Configure Health Checks for Your Load Balancer] in the Classic Load Balancers Guide. +// +// [Configure Health Checks for Your Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html +func (c *Client) ConfigureHealthCheck(ctx context.Context, params *ConfigureHealthCheckInput, optFns ...func(*Options)) (*ConfigureHealthCheckOutput, error) { + if params == nil { + params = &ConfigureHealthCheckInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ConfigureHealthCheck", params, optFns, c.addOperationConfigureHealthCheckMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ConfigureHealthCheckOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for ConfigureHealthCheck. +type ConfigureHealthCheckInput struct { + + // The configuration information. + // + // This member is required. + HealthCheck *types.HealthCheck + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output of ConfigureHealthCheck. +type ConfigureHealthCheckOutput struct { + + // The updated health check. + HealthCheck *types.HealthCheck + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationConfigureHealthCheckMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpConfigureHealthCheck{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpConfigureHealthCheck{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ConfigureHealthCheck"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpConfigureHealthCheckValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opConfigureHealthCheck(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opConfigureHealthCheck(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ConfigureHealthCheck", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateAppCookieStickinessPolicy.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateAppCookieStickinessPolicy.go new file mode 100644 index 000000000..e917e2bd2 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateAppCookieStickinessPolicy.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Generates a stickiness policy with sticky session lifetimes that follow that of +// an application-generated cookie. This policy can be associated only with +// HTTP/HTTPS listeners. +// +// This policy is similar to the policy created by CreateLBCookieStickinessPolicy, except that the lifetime of +// the special Elastic Load Balancing cookie, AWSELB , follows the lifetime of the +// application-generated cookie specified in the policy configuration. The load +// balancer only inserts a new stickiness cookie when the application response +// includes a new application cookie. +// +// If the application cookie is explicitly removed or expires, the session stops +// being sticky until a new application cookie is issued. +// +// For more information, see [Application-Controlled Session Stickiness] in the Classic Load Balancers Guide. +// +// [Application-Controlled Session Stickiness]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application +func (c *Client) CreateAppCookieStickinessPolicy(ctx context.Context, params *CreateAppCookieStickinessPolicyInput, optFns ...func(*Options)) (*CreateAppCookieStickinessPolicyOutput, error) { + if params == nil { + params = &CreateAppCookieStickinessPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAppCookieStickinessPolicy", params, optFns, c.addOperationCreateAppCookieStickinessPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAppCookieStickinessPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for CreateAppCookieStickinessPolicy. +type CreateAppCookieStickinessPolicyInput struct { + + // The name of the application cookie used for stickiness. + // + // This member is required. + CookieName *string + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The name of the policy being created. Policy names must consist of alphanumeric + // characters and dashes (-). This name must be unique within the set of policies + // for this load balancer. + // + // This member is required. + PolicyName *string + + noSmithyDocumentSerde +} + +// Contains the output for CreateAppCookieStickinessPolicy. +type CreateAppCookieStickinessPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAppCookieStickinessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateAppCookieStickinessPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateAppCookieStickinessPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAppCookieStickinessPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpCreateAppCookieStickinessPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAppCookieStickinessPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateAppCookieStickinessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateAppCookieStickinessPolicy", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLBCookieStickinessPolicy.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLBCookieStickinessPolicy.go new file mode 100644 index 000000000..b41389d7f --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLBCookieStickinessPolicy.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Generates a stickiness policy with sticky session lifetimes controlled by the +// lifetime of the browser (user-agent) or a specified expiration period. This +// policy can be associated only with HTTP/HTTPS listeners. +// +// When a load balancer implements this policy, the load balancer uses a special +// cookie to track the instance for each request. When the load balancer receives a +// request, it first checks to see if this cookie is present in the request. If so, +// the load balancer sends the request to the application server specified in the +// cookie. If not, the load balancer sends the request to a server that is chosen +// based on the existing load-balancing algorithm. +// +// A cookie is inserted into the response for binding subsequent requests from the +// same user to that server. The validity of the cookie is based on the cookie +// expiration time, which is specified in the policy configuration. +// +// For more information, see [Duration-Based Session Stickiness] in the Classic Load Balancers Guide. +// +// [Duration-Based Session Stickiness]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration +func (c *Client) CreateLBCookieStickinessPolicy(ctx context.Context, params *CreateLBCookieStickinessPolicyInput, optFns ...func(*Options)) (*CreateLBCookieStickinessPolicyOutput, error) { + if params == nil { + params = &CreateLBCookieStickinessPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLBCookieStickinessPolicy", params, optFns, c.addOperationCreateLBCookieStickinessPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLBCookieStickinessPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for CreateLBCookieStickinessPolicy. +type CreateLBCookieStickinessPolicyInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The name of the policy being created. Policy names must consist of alphanumeric + // characters and dashes (-). This name must be unique within the set of policies + // for this load balancer. + // + // This member is required. + PolicyName *string + + // The time period, in seconds, after which the cookie should be considered stale. + // If you do not specify this parameter, the default value is 0, which indicates + // that the sticky session should last for the duration of the browser session. + CookieExpirationPeriod *int64 + + noSmithyDocumentSerde +} + +// Contains the output for CreateLBCookieStickinessPolicy. +type CreateLBCookieStickinessPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLBCookieStickinessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateLBCookieStickinessPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateLBCookieStickinessPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLBCookieStickinessPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpCreateLBCookieStickinessPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLBCookieStickinessPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateLBCookieStickinessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLBCookieStickinessPolicy", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancer.go new file mode 100644 index 000000000..a205dd54d --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancer.go @@ -0,0 +1,252 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a Classic Load Balancer. +// +// You can add listeners, security groups, subnets, and tags when you create your +// load balancer, or you can add them later using CreateLoadBalancerListeners, ApplySecurityGroupsToLoadBalancer, AttachLoadBalancerToSubnets, and AddTags. +// +// To describe your current load balancers, see DescribeLoadBalancers. When you are finished with a +// load balancer, you can delete it using DeleteLoadBalancer. +// +// You can create up to 20 load balancers per region per account. You can request +// an increase for the number of load balancers for your account. For more +// information, see [Limits for Your Classic Load Balancer]in the Classic Load Balancers Guide. +// +// [Limits for Your Classic Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html +func (c *Client) CreateLoadBalancer(ctx context.Context, params *CreateLoadBalancerInput, optFns ...func(*Options)) (*CreateLoadBalancerOutput, error) { + if params == nil { + params = &CreateLoadBalancerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLoadBalancer", params, optFns, c.addOperationCreateLoadBalancerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLoadBalancerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for CreateLoadBalancer. +type CreateLoadBalancerInput struct { + + // The listeners. + // + // For more information, see [Listeners for Your Classic Load Balancer] in the Classic Load Balancers Guide. + // + // [Listeners for Your Classic Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html + // + // This member is required. + Listeners []types.Listener + + // The name of the load balancer. + // + // This name must be unique within your set of load balancers for the region, must + // have a maximum of 32 characters, must contain only alphanumeric characters or + // hyphens, and cannot begin or end with a hyphen. + // + // This member is required. + LoadBalancerName *string + + // One or more Availability Zones from the same region as the load balancer. + // + // You must specify at least one Availability Zone. + // + // You can add more Availability Zones after you create the load balancer using EnableAvailabilityZonesForLoadBalancer. + AvailabilityZones []string + + // The type of a load balancer. Valid only for load balancers in a VPC. + // + // By default, Elastic Load Balancing creates an Internet-facing load balancer + // with a DNS name that resolves to public IP addresses. For more information about + // Internet-facing and Internal load balancers, see [Load Balancer Scheme]in the Elastic Load Balancing + // User Guide. + // + // Specify internal to create a load balancer with a DNS name that resolves to + // private IP addresses. + // + // [Load Balancer Scheme]: https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#load-balancer-scheme + Scheme *string + + // The IDs of the security groups to assign to the load balancer. + SecurityGroups []string + + // The IDs of the subnets in your VPC to attach to the load balancer. Specify one + // subnet per Availability Zone specified in AvailabilityZones . + Subnets []string + + // A list of tags to assign to the load balancer. + // + // For more information about tagging your load balancer, see [Tag Your Classic Load Balancer] in the Classic Load + // Balancers Guide. + // + // [Tag Your Classic Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +// Contains the output for CreateLoadBalancer. +type CreateLoadBalancerOutput struct { + + // The DNS name of the load balancer. + DNSName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateLoadBalancer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateLoadBalancer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLoadBalancer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpCreateLoadBalancerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLoadBalancer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLoadBalancer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancerListeners.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancerListeners.go new file mode 100644 index 000000000..9edef478b --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancerListeners.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates one or more listeners for the specified load balancer. If a listener +// with the specified port does not already exist, it is created; otherwise, the +// properties of the new listener must match the properties of the existing +// listener. +// +// For more information, see [Listeners for Your Classic Load Balancer] in the Classic Load Balancers Guide. +// +// [Listeners for Your Classic Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html +func (c *Client) CreateLoadBalancerListeners(ctx context.Context, params *CreateLoadBalancerListenersInput, optFns ...func(*Options)) (*CreateLoadBalancerListenersOutput, error) { + if params == nil { + params = &CreateLoadBalancerListenersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLoadBalancerListeners", params, optFns, c.addOperationCreateLoadBalancerListenersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLoadBalancerListenersOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for CreateLoadBalancerListeners. +type CreateLoadBalancerListenersInput struct { + + // The listeners. + // + // This member is required. + Listeners []types.Listener + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the parameters for CreateLoadBalancerListener. +type CreateLoadBalancerListenersOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLoadBalancerListenersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateLoadBalancerListeners{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateLoadBalancerListeners{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLoadBalancerListeners"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpCreateLoadBalancerListenersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLoadBalancerListeners(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateLoadBalancerListeners(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLoadBalancerListeners", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancerPolicy.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancerPolicy.go new file mode 100644 index 000000000..7ee8a6ff5 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_CreateLoadBalancerPolicy.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a policy with the specified attributes for the specified load balancer. +// +// Policies are settings that are saved for your load balancer and that can be +// applied to the listener or the application server, depending on the policy type. +func (c *Client) CreateLoadBalancerPolicy(ctx context.Context, params *CreateLoadBalancerPolicyInput, optFns ...func(*Options)) (*CreateLoadBalancerPolicyOutput, error) { + if params == nil { + params = &CreateLoadBalancerPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLoadBalancerPolicy", params, optFns, c.addOperationCreateLoadBalancerPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLoadBalancerPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for CreateLoadBalancerPolicy. +type CreateLoadBalancerPolicyInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The name of the load balancer policy to be created. This name must be unique + // within the set of policies for this load balancer. + // + // This member is required. + PolicyName *string + + // The name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes. + // + // This member is required. + PolicyTypeName *string + + // The policy attributes. + PolicyAttributes []types.PolicyAttribute + + noSmithyDocumentSerde +} + +// Contains the output of CreateLoadBalancerPolicy. +type CreateLoadBalancerPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLoadBalancerPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateLoadBalancerPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateLoadBalancerPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLoadBalancerPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpCreateLoadBalancerPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLoadBalancerPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateLoadBalancerPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLoadBalancerPolicy", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancer.go new file mode 100644 index 000000000..a9612fec9 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancer.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified load balancer. +// +// If you are attempting to recreate a load balancer, you must reconfigure all +// settings. The DNS name associated with a deleted load balancer are no longer +// usable. The name and associated DNS record of the deleted load balancer no +// longer exist and traffic sent to any of its IP addresses is no longer delivered +// to your instances. +// +// If the load balancer does not exist or has already been deleted, the call to +// DeleteLoadBalancer still succeeds. +func (c *Client) DeleteLoadBalancer(ctx context.Context, params *DeleteLoadBalancerInput, optFns ...func(*Options)) (*DeleteLoadBalancerOutput, error) { + if params == nil { + params = &DeleteLoadBalancerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLoadBalancer", params, optFns, c.addOperationDeleteLoadBalancerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLoadBalancerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DeleteLoadBalancer. +type DeleteLoadBalancerInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output of DeleteLoadBalancer. +type DeleteLoadBalancerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteLoadBalancer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteLoadBalancer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLoadBalancer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDeleteLoadBalancerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLoadBalancer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteLoadBalancer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancerListeners.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancerListeners.go new file mode 100644 index 000000000..e7e566577 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancerListeners.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified listeners from the specified load balancer. +func (c *Client) DeleteLoadBalancerListeners(ctx context.Context, params *DeleteLoadBalancerListenersInput, optFns ...func(*Options)) (*DeleteLoadBalancerListenersOutput, error) { + if params == nil { + params = &DeleteLoadBalancerListenersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLoadBalancerListeners", params, optFns, c.addOperationDeleteLoadBalancerListenersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLoadBalancerListenersOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DeleteLoadBalancerListeners. +type DeleteLoadBalancerListenersInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The client port numbers of the listeners. + // + // This member is required. + LoadBalancerPorts []int32 + + noSmithyDocumentSerde +} + +// Contains the output of DeleteLoadBalancerListeners. +type DeleteLoadBalancerListenersOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLoadBalancerListenersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteLoadBalancerListeners{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteLoadBalancerListeners{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLoadBalancerListeners"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDeleteLoadBalancerListenersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLoadBalancerListeners(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteLoadBalancerListeners(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteLoadBalancerListeners", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancerPolicy.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancerPolicy.go new file mode 100644 index 000000000..be7245b40 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeleteLoadBalancerPolicy.go @@ -0,0 +1,193 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified policy from the specified load balancer. This policy must +// not be enabled for any listeners. +func (c *Client) DeleteLoadBalancerPolicy(ctx context.Context, params *DeleteLoadBalancerPolicyInput, optFns ...func(*Options)) (*DeleteLoadBalancerPolicyOutput, error) { + if params == nil { + params = &DeleteLoadBalancerPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLoadBalancerPolicy", params, optFns, c.addOperationDeleteLoadBalancerPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLoadBalancerPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DeleteLoadBalancerPolicy. +type DeleteLoadBalancerPolicyInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The name of the policy. + // + // This member is required. + PolicyName *string + + noSmithyDocumentSerde +} + +// Contains the output of DeleteLoadBalancerPolicy. +type DeleteLoadBalancerPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLoadBalancerPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteLoadBalancerPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteLoadBalancerPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLoadBalancerPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDeleteLoadBalancerPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLoadBalancerPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteLoadBalancerPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteLoadBalancerPolicy", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeregisterInstancesFromLoadBalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeregisterInstancesFromLoadBalancer.go new file mode 100644 index 000000000..0fe2cfcef --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DeregisterInstancesFromLoadBalancer.go @@ -0,0 +1,204 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deregisters the specified instances from the specified load balancer. After the +// instance is deregistered, it no longer receives traffic from the load balancer. +// +// You can use DescribeLoadBalancers to verify that the instance is deregistered from the load balancer. +// +// For more information, see [Register or De-Register EC2 Instances] in the Classic Load Balancers Guide. +// +// [Register or De-Register EC2 Instances]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html +func (c *Client) DeregisterInstancesFromLoadBalancer(ctx context.Context, params *DeregisterInstancesFromLoadBalancerInput, optFns ...func(*Options)) (*DeregisterInstancesFromLoadBalancerOutput, error) { + if params == nil { + params = &DeregisterInstancesFromLoadBalancerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterInstancesFromLoadBalancer", params, optFns, c.addOperationDeregisterInstancesFromLoadBalancerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterInstancesFromLoadBalancerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DeregisterInstancesFromLoadBalancer. +type DeregisterInstancesFromLoadBalancerInput struct { + + // The IDs of the instances. + // + // This member is required. + Instances []types.Instance + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output of DeregisterInstancesFromLoadBalancer. +type DeregisterInstancesFromLoadBalancerOutput struct { + + // The remaining instances registered with the load balancer. + Instances []types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterInstancesFromLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeregisterInstancesFromLoadBalancer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeregisterInstancesFromLoadBalancer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterInstancesFromLoadBalancer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDeregisterInstancesFromLoadBalancerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterInstancesFromLoadBalancer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeregisterInstancesFromLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeregisterInstancesFromLoadBalancer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeAccountLimits.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeAccountLimits.go new file mode 100644 index 000000000..6fcd395fe --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeAccountLimits.go @@ -0,0 +1,198 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the current Elastic Load Balancing resource limits for your AWS +// account. +// +// For more information, see [Limits for Your Classic Load Balancer] in the Classic Load Balancers Guide. +// +// [Limits for Your Classic Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html +func (c *Client) DescribeAccountLimits(ctx context.Context, params *DescribeAccountLimitsInput, optFns ...func(*Options)) (*DescribeAccountLimitsOutput, error) { + if params == nil { + params = &DescribeAccountLimitsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAccountLimits", params, optFns, c.addOperationDescribeAccountLimitsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAccountLimitsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeAccountLimitsInput struct { + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string + + // The maximum number of results to return with this call. + PageSize *int32 + + noSmithyDocumentSerde +} + +type DescribeAccountLimitsOutput struct { + + // Information about the limits. + Limits []types.Limit + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAccountLimitsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeAccountLimits{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeAccountLimits{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAccountLimits"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccountLimits(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeAccountLimits(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeAccountLimits", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeInstanceHealth.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeInstanceHealth.go new file mode 100644 index 000000000..b91873660 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeInstanceHealth.go @@ -0,0 +1,804 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "errors" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "time" +) + +// Describes the state of the specified instances with respect to the specified +// load balancer. If no instances are specified, the call describes the state of +// all instances that are currently registered with the load balancer. If instances +// are specified, their state is returned even if they are no longer registered +// with the load balancer. The state of terminated instances is not returned. +func (c *Client) DescribeInstanceHealth(ctx context.Context, params *DescribeInstanceHealthInput, optFns ...func(*Options)) (*DescribeInstanceHealthOutput, error) { + if params == nil { + params = &DescribeInstanceHealthInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceHealth", params, optFns, c.addOperationDescribeInstanceHealthMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeInstanceHealthOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DescribeInstanceHealth. +type DescribeInstanceHealthInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The IDs of the instances. + Instances []types.Instance + + noSmithyDocumentSerde +} + +// Contains the output for DescribeInstanceHealth. +type DescribeInstanceHealthOutput struct { + + // Information about the health of the instances. + InstanceStates []types.InstanceState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeInstanceHealthMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeInstanceHealth{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeInstanceHealth{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceHealth"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDescribeInstanceHealthValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceHealth(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// AnyInstanceInServiceWaiterOptions are waiter options for +// AnyInstanceInServiceWaiter +type AnyInstanceInServiceWaiterOptions 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. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // AnyInstanceInServiceWaiter will use default minimum delay of 15 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, AnyInstanceInServiceWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeInstanceHealthInput, *DescribeInstanceHealthOutput, error) (bool, error) +} + +// AnyInstanceInServiceWaiter defines the waiters for AnyInstanceInService +type AnyInstanceInServiceWaiter struct { + client DescribeInstanceHealthAPIClient + + options AnyInstanceInServiceWaiterOptions +} + +// NewAnyInstanceInServiceWaiter constructs a AnyInstanceInServiceWaiter. +func NewAnyInstanceInServiceWaiter(client DescribeInstanceHealthAPIClient, optFns ...func(*AnyInstanceInServiceWaiterOptions)) *AnyInstanceInServiceWaiter { + options := AnyInstanceInServiceWaiterOptions{} + options.MinDelay = 15 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = anyInstanceInServiceStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &AnyInstanceInServiceWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for AnyInstanceInService waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *AnyInstanceInServiceWaiter) Wait(ctx context.Context, params *DescribeInstanceHealthInput, maxWaitDur time.Duration, optFns ...func(*AnyInstanceInServiceWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for AnyInstanceInService waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *AnyInstanceInServiceWaiter) WaitForOutput(ctx context.Context, params *DescribeInstanceHealthInput, maxWaitDur time.Duration, optFns ...func(*AnyInstanceInServiceWaiterOptions)) (*DescribeInstanceHealthOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeInstanceHealth(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for AnyInstanceInService waiter") +} + +func anyInstanceInServiceStateRetryable(ctx context.Context, input *DescribeInstanceHealthInput, output *DescribeInstanceHealthOutput, err error) (bool, error) { + + if err == nil { + v1 := output.InstanceStates + var v2 []string + for _, v := range v1 { + v3 := v.State + if v3 != nil { + v2 = append(v2, *v3) + } + } + expectedValue := "InService" + var match bool + for _, v := range v2 { + if string(v) == expectedValue { + match = true + break + } + } + + if match { + return false, nil + } + } + + if err != nil { + return false, err + } + return true, nil +} + +// InstanceDeregisteredWaiterOptions are waiter options for +// InstanceDeregisteredWaiter +type InstanceDeregisteredWaiterOptions 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. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // InstanceDeregisteredWaiter will use default minimum delay of 15 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, InstanceDeregisteredWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeInstanceHealthInput, *DescribeInstanceHealthOutput, error) (bool, error) +} + +// InstanceDeregisteredWaiter defines the waiters for InstanceDeregistered +type InstanceDeregisteredWaiter struct { + client DescribeInstanceHealthAPIClient + + options InstanceDeregisteredWaiterOptions +} + +// NewInstanceDeregisteredWaiter constructs a InstanceDeregisteredWaiter. +func NewInstanceDeregisteredWaiter(client DescribeInstanceHealthAPIClient, optFns ...func(*InstanceDeregisteredWaiterOptions)) *InstanceDeregisteredWaiter { + options := InstanceDeregisteredWaiterOptions{} + options.MinDelay = 15 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = instanceDeregisteredStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &InstanceDeregisteredWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for InstanceDeregistered waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *InstanceDeregisteredWaiter) Wait(ctx context.Context, params *DescribeInstanceHealthInput, maxWaitDur time.Duration, optFns ...func(*InstanceDeregisteredWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for InstanceDeregistered waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *InstanceDeregisteredWaiter) WaitForOutput(ctx context.Context, params *DescribeInstanceHealthInput, maxWaitDur time.Duration, optFns ...func(*InstanceDeregisteredWaiterOptions)) (*DescribeInstanceHealthOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeInstanceHealth(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for InstanceDeregistered waiter") +} + +func instanceDeregisteredStateRetryable(ctx context.Context, input *DescribeInstanceHealthInput, output *DescribeInstanceHealthOutput, err error) (bool, error) { + + if err == nil { + v1 := output.InstanceStates + var v2 []string + for _, v := range v1 { + v3 := v.State + if v3 != nil { + v2 = append(v2, *v3) + } + } + expectedValue := "OutOfService" + match := len(v2) > 0 + for _, v := range v2 { + if string(v) != expectedValue { + match = false + break + } + } + + if match { + return false, nil + } + } + + if err != nil { + var apiErr smithy.APIError + ok := errors.As(err, &apiErr) + if !ok { + return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) + } + + if "InvalidInstance" == apiErr.ErrorCode() { + return false, nil + } + } + + if err != nil { + return false, err + } + return true, nil +} + +// InstanceInServiceWaiterOptions are waiter options for InstanceInServiceWaiter +type InstanceInServiceWaiterOptions 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. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // InstanceInServiceWaiter will use default minimum delay of 15 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, InstanceInServiceWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeInstanceHealthInput, *DescribeInstanceHealthOutput, error) (bool, error) +} + +// InstanceInServiceWaiter defines the waiters for InstanceInService +type InstanceInServiceWaiter struct { + client DescribeInstanceHealthAPIClient + + options InstanceInServiceWaiterOptions +} + +// NewInstanceInServiceWaiter constructs a InstanceInServiceWaiter. +func NewInstanceInServiceWaiter(client DescribeInstanceHealthAPIClient, optFns ...func(*InstanceInServiceWaiterOptions)) *InstanceInServiceWaiter { + options := InstanceInServiceWaiterOptions{} + options.MinDelay = 15 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = instanceInServiceStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &InstanceInServiceWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for InstanceInService waiter. The maxWaitDur is +// the maximum wait duration the waiter will wait. The maxWaitDur is required and +// must be greater than zero. +func (w *InstanceInServiceWaiter) Wait(ctx context.Context, params *DescribeInstanceHealthInput, maxWaitDur time.Duration, optFns ...func(*InstanceInServiceWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for InstanceInService waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *InstanceInServiceWaiter) WaitForOutput(ctx context.Context, params *DescribeInstanceHealthInput, maxWaitDur time.Duration, optFns ...func(*InstanceInServiceWaiterOptions)) (*DescribeInstanceHealthOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeInstanceHealth(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for InstanceInService waiter") +} + +func instanceInServiceStateRetryable(ctx context.Context, input *DescribeInstanceHealthInput, output *DescribeInstanceHealthOutput, err error) (bool, error) { + + if err == nil { + v1 := output.InstanceStates + var v2 []string + for _, v := range v1 { + v3 := v.State + if v3 != nil { + v2 = append(v2, *v3) + } + } + expectedValue := "InService" + match := len(v2) > 0 + for _, v := range v2 { + if string(v) != expectedValue { + match = false + break + } + } + + if match { + return false, nil + } + } + + if err != nil { + var apiErr smithy.APIError + ok := errors.As(err, &apiErr) + if !ok { + return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) + } + + if "InvalidInstance" == apiErr.ErrorCode() { + return true, nil + } + } + + if err != nil { + return false, err + } + return true, nil +} + +// DescribeInstanceHealthAPIClient is a client that implements the +// DescribeInstanceHealth operation. +type DescribeInstanceHealthAPIClient interface { + DescribeInstanceHealth(context.Context, *DescribeInstanceHealthInput, ...func(*Options)) (*DescribeInstanceHealthOutput, error) +} + +var _ DescribeInstanceHealthAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeInstanceHealth(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeInstanceHealth", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerAttributes.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerAttributes.go new file mode 100644 index 000000000..ac230b419 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerAttributes.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the attributes for the specified load balancer. +func (c *Client) DescribeLoadBalancerAttributes(ctx context.Context, params *DescribeLoadBalancerAttributesInput, optFns ...func(*Options)) (*DescribeLoadBalancerAttributesOutput, error) { + if params == nil { + params = &DescribeLoadBalancerAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeLoadBalancerAttributes", params, optFns, c.addOperationDescribeLoadBalancerAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeLoadBalancerAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DescribeLoadBalancerAttributes. +type DescribeLoadBalancerAttributesInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output of DescribeLoadBalancerAttributes. +type DescribeLoadBalancerAttributesOutput struct { + + // Information about the load balancer attributes. + LoadBalancerAttributes *types.LoadBalancerAttributes + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeLoadBalancerAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeLoadBalancerAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeLoadBalancerAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLoadBalancerAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDescribeLoadBalancerAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLoadBalancerAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeLoadBalancerAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeLoadBalancerAttributes", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerPolicies.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerPolicies.go new file mode 100644 index 000000000..0ef0dc988 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerPolicies.go @@ -0,0 +1,197 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified policies. +// +// If you specify a load balancer name, the action returns the descriptions of all +// policies created for the load balancer. If you specify a policy name associated +// with your load balancer, the action returns the description of that policy. If +// you don't specify a load balancer name, the action returns descriptions of the +// specified sample policies, or descriptions of all sample policies. The names of +// the sample policies have the ELBSample- prefix. +func (c *Client) DescribeLoadBalancerPolicies(ctx context.Context, params *DescribeLoadBalancerPoliciesInput, optFns ...func(*Options)) (*DescribeLoadBalancerPoliciesOutput, error) { + if params == nil { + params = &DescribeLoadBalancerPoliciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeLoadBalancerPolicies", params, optFns, c.addOperationDescribeLoadBalancerPoliciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeLoadBalancerPoliciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DescribeLoadBalancerPolicies. +type DescribeLoadBalancerPoliciesInput struct { + + // The name of the load balancer. + LoadBalancerName *string + + // The names of the policies. + PolicyNames []string + + noSmithyDocumentSerde +} + +// Contains the output of DescribeLoadBalancerPolicies. +type DescribeLoadBalancerPoliciesOutput struct { + + // Information about the policies. + PolicyDescriptions []types.PolicyDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeLoadBalancerPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeLoadBalancerPolicies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeLoadBalancerPolicies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLoadBalancerPolicies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLoadBalancerPolicies(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeLoadBalancerPolicies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeLoadBalancerPolicies", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerPolicyTypes.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerPolicyTypes.go new file mode 100644 index 000000000..1729d8191 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancerPolicyTypes.go @@ -0,0 +1,197 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified load balancer policy types or all load balancer policy +// types. +// +// The description of each type indicates how it can be used. For example, some +// policies can be used only with layer 7 listeners, some policies can be used only +// with layer 4 listeners, and some policies can be used only with your EC2 +// instances. +// +// You can use CreateLoadBalancerPolicy to create a policy configuration for any of these policy types. +// Then, depending on the policy type, use either SetLoadBalancerPoliciesOfListeneror SetLoadBalancerPoliciesForBackendServer to set the policy. +func (c *Client) DescribeLoadBalancerPolicyTypes(ctx context.Context, params *DescribeLoadBalancerPolicyTypesInput, optFns ...func(*Options)) (*DescribeLoadBalancerPolicyTypesOutput, error) { + if params == nil { + params = &DescribeLoadBalancerPolicyTypesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeLoadBalancerPolicyTypes", params, optFns, c.addOperationDescribeLoadBalancerPolicyTypesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeLoadBalancerPolicyTypesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DescribeLoadBalancerPolicyTypes. +type DescribeLoadBalancerPolicyTypesInput struct { + + // The names of the policy types. If no names are specified, describes all policy + // types defined by Elastic Load Balancing. + PolicyTypeNames []string + + noSmithyDocumentSerde +} + +// Contains the output of DescribeLoadBalancerPolicyTypes. +type DescribeLoadBalancerPolicyTypesOutput struct { + + // Information about the policy types. + PolicyTypeDescriptions []types.PolicyTypeDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeLoadBalancerPolicyTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeLoadBalancerPolicyTypes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeLoadBalancerPolicyTypes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLoadBalancerPolicyTypes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLoadBalancerPolicyTypes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeLoadBalancerPolicyTypes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeLoadBalancerPolicyTypes", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go new file mode 100644 index 000000000..3003ae02d --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go @@ -0,0 +1,282 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the specified the load balancers. If no load balancers are specified, +// the call describes all of your load balancers. +func (c *Client) DescribeLoadBalancers(ctx context.Context, params *DescribeLoadBalancersInput, optFns ...func(*Options)) (*DescribeLoadBalancersOutput, error) { + if params == nil { + params = &DescribeLoadBalancersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeLoadBalancers", params, optFns, c.addOperationDescribeLoadBalancersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeLoadBalancersOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DescribeLoadBalancers. +type DescribeLoadBalancersInput struct { + + // The names of the load balancers. + LoadBalancerNames []string + + // The marker for the next set of results. (You received this marker from a + // previous call.) + Marker *string + + // The maximum number of results to return with this call (a number from 1 to + // 400). The default is 400. + PageSize *int32 + + noSmithyDocumentSerde +} + +// Contains the parameters for DescribeLoadBalancers. +type DescribeLoadBalancersOutput struct { + + // Information about the load balancers. + LoadBalancerDescriptions []types.LoadBalancerDescription + + // The marker to use when requesting the next set of results. If there are no + // additional results, the string is empty. + NextMarker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeLoadBalancersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeLoadBalancers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeLoadBalancers{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeLoadBalancers"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLoadBalancers(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeLoadBalancersPaginatorOptions is the paginator options for +// DescribeLoadBalancers +type DescribeLoadBalancersPaginatorOptions 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 +} + +// DescribeLoadBalancersPaginator is a paginator for DescribeLoadBalancers +type DescribeLoadBalancersPaginator struct { + options DescribeLoadBalancersPaginatorOptions + client DescribeLoadBalancersAPIClient + params *DescribeLoadBalancersInput + nextToken *string + firstPage bool +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + if params == nil { + params = &DescribeLoadBalancersInput{} + } + + options := DescribeLoadBalancersPaginatorOptions{} + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeLoadBalancersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLoadBalancersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeLoadBalancers page. +func (p *DescribeLoadBalancersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLoadBalancersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeLoadBalancers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeLoadBalancersAPIClient is a client that implements the +// DescribeLoadBalancers operation. +type DescribeLoadBalancersAPIClient interface { + DescribeLoadBalancers(context.Context, *DescribeLoadBalancersInput, ...func(*Options)) (*DescribeLoadBalancersOutput, error) +} + +var _ DescribeLoadBalancersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeLoadBalancers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeLoadBalancers", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeTags.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeTags.go new file mode 100644 index 000000000..8c91f1fec --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DescribeTags.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the tags associated with the specified load balancers. +func (c *Client) DescribeTags(ctx context.Context, params *DescribeTagsInput, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if params == nil { + params = &DescribeTagsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeTags", params, optFns, c.addOperationDescribeTagsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeTagsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DescribeTags. +type DescribeTagsInput struct { + + // The names of the load balancers. + // + // This member is required. + LoadBalancerNames []string + + noSmithyDocumentSerde +} + +// Contains the output for DescribeTags. +type DescribeTagsOutput struct { + + // Information about the tags. + TagDescriptions []types.TagDescription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeTags{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeTags{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTags"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDescribeTagsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTags(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeTags", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DetachLoadBalancerFromSubnets.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DetachLoadBalancerFromSubnets.go new file mode 100644 index 000000000..eae18a147 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DetachLoadBalancerFromSubnets.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the specified subnets from the set of configured subnets for the load +// balancer. +// +// After a subnet is removed, all EC2 instances registered with the load balancer +// in the removed subnet go into the OutOfService state. Then, the load balancer +// balances the traffic among the remaining routable subnets. +func (c *Client) DetachLoadBalancerFromSubnets(ctx context.Context, params *DetachLoadBalancerFromSubnetsInput, optFns ...func(*Options)) (*DetachLoadBalancerFromSubnetsOutput, error) { + if params == nil { + params = &DetachLoadBalancerFromSubnetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DetachLoadBalancerFromSubnets", params, optFns, c.addOperationDetachLoadBalancerFromSubnetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DetachLoadBalancerFromSubnetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DetachLoadBalancerFromSubnets. +type DetachLoadBalancerFromSubnetsInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The IDs of the subnets. + // + // This member is required. + Subnets []string + + noSmithyDocumentSerde +} + +// Contains the output of DetachLoadBalancerFromSubnets. +type DetachLoadBalancerFromSubnetsOutput struct { + + // The IDs of the remaining subnets for the load balancer. + Subnets []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDetachLoadBalancerFromSubnetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDetachLoadBalancerFromSubnets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDetachLoadBalancerFromSubnets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DetachLoadBalancerFromSubnets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDetachLoadBalancerFromSubnetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachLoadBalancerFromSubnets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDetachLoadBalancerFromSubnets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DetachLoadBalancerFromSubnets", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DisableAvailabilityZonesForLoadBalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DisableAvailabilityZonesForLoadBalancer.go new file mode 100644 index 000000000..6a2026eaf --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_DisableAvailabilityZonesForLoadBalancer.go @@ -0,0 +1,209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the specified Availability Zones from the set of Availability Zones for +// the specified load balancer in EC2-Classic or a default VPC. +// +// For load balancers in a non-default VPC, use DetachLoadBalancerFromSubnets. +// +// There must be at least one Availability Zone registered with a load balancer at +// all times. After an Availability Zone is removed, all instances registered with +// the load balancer that are in the removed Availability Zone go into the +// OutOfService state. Then, the load balancer attempts to equally balance the +// traffic among its remaining Availability Zones. +// +// For more information, see [Add or Remove Availability Zones] in the Classic Load Balancers Guide. +// +// [Add or Remove Availability Zones]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html +func (c *Client) DisableAvailabilityZonesForLoadBalancer(ctx context.Context, params *DisableAvailabilityZonesForLoadBalancerInput, optFns ...func(*Options)) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { + if params == nil { + params = &DisableAvailabilityZonesForLoadBalancerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisableAvailabilityZonesForLoadBalancer", params, optFns, c.addOperationDisableAvailabilityZonesForLoadBalancerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisableAvailabilityZonesForLoadBalancerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for DisableAvailabilityZonesForLoadBalancer. +type DisableAvailabilityZonesForLoadBalancerInput struct { + + // The Availability Zones. + // + // This member is required. + AvailabilityZones []string + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output for DisableAvailabilityZonesForLoadBalancer. +type DisableAvailabilityZonesForLoadBalancerOutput struct { + + // The remaining Availability Zones for the load balancer. + AvailabilityZones []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisableAvailabilityZonesForLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDisableAvailabilityZonesForLoadBalancer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDisableAvailabilityZonesForLoadBalancer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisableAvailabilityZonesForLoadBalancer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpDisableAvailabilityZonesForLoadBalancerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableAvailabilityZonesForLoadBalancer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisableAvailabilityZonesForLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisableAvailabilityZonesForLoadBalancer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_EnableAvailabilityZonesForLoadBalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_EnableAvailabilityZonesForLoadBalancer.go new file mode 100644 index 000000000..4a8c7b36e --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_EnableAvailabilityZonesForLoadBalancer.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds the specified Availability Zones to the set of Availability Zones for the +// specified load balancer in EC2-Classic or a default VPC. +// +// For load balancers in a non-default VPC, use AttachLoadBalancerToSubnets. +// +// The load balancer evenly distributes requests across all its registered +// Availability Zones that contain instances. For more information, see [Add or Remove Availability Zones]in the +// Classic Load Balancers Guide. +// +// [Add or Remove Availability Zones]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html +func (c *Client) EnableAvailabilityZonesForLoadBalancer(ctx context.Context, params *EnableAvailabilityZonesForLoadBalancerInput, optFns ...func(*Options)) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { + if params == nil { + params = &EnableAvailabilityZonesForLoadBalancerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EnableAvailabilityZonesForLoadBalancer", params, optFns, c.addOperationEnableAvailabilityZonesForLoadBalancerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EnableAvailabilityZonesForLoadBalancerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for EnableAvailabilityZonesForLoadBalancer. +type EnableAvailabilityZonesForLoadBalancerInput struct { + + // The Availability Zones. These must be in the same region as the load balancer. + // + // This member is required. + AvailabilityZones []string + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output of EnableAvailabilityZonesForLoadBalancer. +type EnableAvailabilityZonesForLoadBalancerOutput struct { + + // The updated list of Availability Zones for the load balancer. + AvailabilityZones []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationEnableAvailabilityZonesForLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpEnableAvailabilityZonesForLoadBalancer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpEnableAvailabilityZonesForLoadBalancer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "EnableAvailabilityZonesForLoadBalancer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpEnableAvailabilityZonesForLoadBalancerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableAvailabilityZonesForLoadBalancer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opEnableAvailabilityZonesForLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "EnableAvailabilityZonesForLoadBalancer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ModifyLoadBalancerAttributes.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ModifyLoadBalancerAttributes.go new file mode 100644 index 000000000..242220538 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_ModifyLoadBalancerAttributes.go @@ -0,0 +1,220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the attributes of the specified load balancer. +// +// You can modify the load balancer attributes, such as AccessLogs , +// ConnectionDraining , and CrossZoneLoadBalancing by either enabling or disabling +// them. Or, you can modify the load balancer attribute ConnectionSettings by +// specifying an idle connection timeout value for your load balancer. +// +// For more information, see the following in the Classic Load Balancers Guide: +// +// [Cross-Zone Load Balancing] +// +// [Connection Draining] +// +// [Access Logs] +// +// [Idle Connection Timeout] +// +// [Cross-Zone Load Balancing]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html +// [Idle Connection Timeout]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html +// [Access Logs]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html +// [Connection Draining]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html +func (c *Client) ModifyLoadBalancerAttributes(ctx context.Context, params *ModifyLoadBalancerAttributesInput, optFns ...func(*Options)) (*ModifyLoadBalancerAttributesOutput, error) { + if params == nil { + params = &ModifyLoadBalancerAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyLoadBalancerAttributes", params, optFns, c.addOperationModifyLoadBalancerAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyLoadBalancerAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for ModifyLoadBalancerAttributes. +type ModifyLoadBalancerAttributesInput struct { + + // The attributes for the load balancer. + // + // This member is required. + LoadBalancerAttributes *types.LoadBalancerAttributes + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output of ModifyLoadBalancerAttributes. +type ModifyLoadBalancerAttributesOutput struct { + + // Information about the load balancer attributes. + LoadBalancerAttributes *types.LoadBalancerAttributes + + // The name of the load balancer. + LoadBalancerName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyLoadBalancerAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyLoadBalancerAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyLoadBalancerAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyLoadBalancerAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpModifyLoadBalancerAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyLoadBalancerAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyLoadBalancerAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyLoadBalancerAttributes", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_RegisterInstancesWithLoadBalancer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_RegisterInstancesWithLoadBalancer.go new file mode 100644 index 000000000..f16eb24e6 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_RegisterInstancesWithLoadBalancer.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds the specified instances to the specified load balancer. +// +// The instance must be a running instance in the same network as the load +// balancer (EC2-Classic or the same VPC). If you have EC2-Classic instances and a +// load balancer in a VPC with ClassicLink enabled, you can link the EC2-Classic +// instances to that VPC and then register the linked EC2-Classic instances with +// the load balancer in the VPC. +// +// Note that RegisterInstanceWithLoadBalancer completes when the request has been +// registered. Instance registration takes a little time to complete. To check the +// state of the registered instances, use DescribeLoadBalancersor DescribeInstanceHealth. +// +// After the instance is registered, it starts receiving traffic and requests from +// the load balancer. Any instance that is not in one of the Availability Zones +// registered for the load balancer is moved to the OutOfService state. If an +// Availability Zone is added to the load balancer later, any instances registered +// with the load balancer move to the InService state. +// +// To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer. +// +// For more information, see [Register or De-Register EC2 Instances] in the Classic Load Balancers Guide. +// +// [Register or De-Register EC2 Instances]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html +func (c *Client) RegisterInstancesWithLoadBalancer(ctx context.Context, params *RegisterInstancesWithLoadBalancerInput, optFns ...func(*Options)) (*RegisterInstancesWithLoadBalancerOutput, error) { + if params == nil { + params = &RegisterInstancesWithLoadBalancerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterInstancesWithLoadBalancer", params, optFns, c.addOperationRegisterInstancesWithLoadBalancerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterInstancesWithLoadBalancerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for RegisterInstancesWithLoadBalancer. +type RegisterInstancesWithLoadBalancerInput struct { + + // The IDs of the instances. + // + // This member is required. + Instances []types.Instance + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + noSmithyDocumentSerde +} + +// Contains the output of RegisterInstancesWithLoadBalancer. +type RegisterInstancesWithLoadBalancerOutput struct { + + // The updated list of instances for the load balancer. + Instances []types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterInstancesWithLoadBalancerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRegisterInstancesWithLoadBalancer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRegisterInstancesWithLoadBalancer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterInstancesWithLoadBalancer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpRegisterInstancesWithLoadBalancerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterInstancesWithLoadBalancer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterInstancesWithLoadBalancer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RegisterInstancesWithLoadBalancer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_RemoveTags.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_RemoveTags.go new file mode 100644 index 000000000..8f0036298 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_RemoveTags.go @@ -0,0 +1,194 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes one or more tags from the specified load balancer. +func (c *Client) RemoveTags(ctx context.Context, params *RemoveTagsInput, optFns ...func(*Options)) (*RemoveTagsOutput, error) { + if params == nil { + params = &RemoveTagsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveTags", params, optFns, c.addOperationRemoveTagsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveTagsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for RemoveTags. +type RemoveTagsInput struct { + + // The name of the load balancer. You can specify a maximum of one load balancer + // name. + // + // This member is required. + LoadBalancerNames []string + + // The list of tag keys to remove. + // + // This member is required. + Tags []types.TagKeyOnly + + noSmithyDocumentSerde +} + +// Contains the output of RemoveTags. +type RemoveTagsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRemoveTags{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemoveTags{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveTags"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpRemoveTagsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTags(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveTags(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveTags", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerListenerSSLCertificate.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerListenerSSLCertificate.go new file mode 100644 index 000000000..b5a1f05bb --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerListenerSSLCertificate.go @@ -0,0 +1,204 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sets the certificate that terminates the specified listener's SSL connections. +// The specified certificate replaces any prior certificate that was used on the +// same load balancer and port. +// +// For more information about updating your SSL certificate, see [Replace the SSL Certificate for Your Load Balancer] in the Classic +// Load Balancers Guide. +// +// [Replace the SSL Certificate for Your Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-update-ssl-cert.html +func (c *Client) SetLoadBalancerListenerSSLCertificate(ctx context.Context, params *SetLoadBalancerListenerSSLCertificateInput, optFns ...func(*Options)) (*SetLoadBalancerListenerSSLCertificateOutput, error) { + if params == nil { + params = &SetLoadBalancerListenerSSLCertificateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetLoadBalancerListenerSSLCertificate", params, optFns, c.addOperationSetLoadBalancerListenerSSLCertificateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetLoadBalancerListenerSSLCertificateOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for SetLoadBalancerListenerSSLCertificate. +type SetLoadBalancerListenerSSLCertificateInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The port that uses the specified SSL certificate. + // + // This member is required. + LoadBalancerPort int32 + + // The Amazon Resource Name (ARN) of the SSL certificate. + // + // This member is required. + SSLCertificateId *string + + noSmithyDocumentSerde +} + +// Contains the output of SetLoadBalancerListenerSSLCertificate. +type SetLoadBalancerListenerSSLCertificateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetLoadBalancerListenerSSLCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetLoadBalancerListenerSSLCertificate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetLoadBalancerListenerSSLCertificate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetLoadBalancerListenerSSLCertificate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpSetLoadBalancerListenerSSLCertificateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetLoadBalancerListenerSSLCertificate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetLoadBalancerListenerSSLCertificate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetLoadBalancerListenerSSLCertificate", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerPoliciesForBackendServer.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerPoliciesForBackendServer.go new file mode 100644 index 000000000..eeadacb45 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerPoliciesForBackendServer.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Replaces the set of policies associated with the specified port on which the +// EC2 instance is listening with a new set of policies. At this time, only the +// back-end server authentication policy type can be applied to the instance ports; +// this policy type is composed of multiple public key policies. +// +// Each time you use SetLoadBalancerPoliciesForBackendServer to enable the +// policies, use the PolicyNames parameter to list the policies that you want to +// enable. +// +// You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify that the policy is associated with the EC2 instance. +// +// For more information about enabling back-end instance authentication, see [Configure Back-end Instance Authentication] in +// the Classic Load Balancers Guide. For more information about Proxy Protocol, see +// [Configure Proxy Protocol Support]in the Classic Load Balancers Guide. +// +// [Configure Back-end Instance Authentication]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-create-https-ssl-load-balancer.html#configure_backendauth_clt +// [Configure Proxy Protocol Support]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html +func (c *Client) SetLoadBalancerPoliciesForBackendServer(ctx context.Context, params *SetLoadBalancerPoliciesForBackendServerInput, optFns ...func(*Options)) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { + if params == nil { + params = &SetLoadBalancerPoliciesForBackendServerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetLoadBalancerPoliciesForBackendServer", params, optFns, c.addOperationSetLoadBalancerPoliciesForBackendServerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetLoadBalancerPoliciesForBackendServerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for SetLoadBalancerPoliciesForBackendServer. +type SetLoadBalancerPoliciesForBackendServerInput struct { + + // The port number associated with the EC2 instance. + // + // This member is required. + InstancePort *int32 + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The names of the policies. If the list is empty, then all current polices are + // removed from the EC2 instance. + // + // This member is required. + PolicyNames []string + + noSmithyDocumentSerde +} + +// Contains the output of SetLoadBalancerPoliciesForBackendServer. +type SetLoadBalancerPoliciesForBackendServerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetLoadBalancerPoliciesForBackendServerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetLoadBalancerPoliciesForBackendServer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetLoadBalancerPoliciesForBackendServer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetLoadBalancerPoliciesForBackendServer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpSetLoadBalancerPoliciesForBackendServerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetLoadBalancerPoliciesForBackendServer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetLoadBalancerPoliciesForBackendServer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetLoadBalancerPoliciesForBackendServer", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerPoliciesOfListener.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerPoliciesOfListener.go new file mode 100644 index 000000000..565598e34 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/api_op_SetLoadBalancerPoliciesOfListener.go @@ -0,0 +1,209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Replaces the current set of policies for the specified load balancer port with +// the specified set of policies. +// +// To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer. +// +// For more information about setting policies, see [Update the SSL Negotiation Configuration], [Duration-Based Session Stickiness], and [Application-Controlled Session Stickiness] in the Classic Load +// Balancers Guide. +// +// [Update the SSL Negotiation Configuration]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html +// [Duration-Based Session Stickiness]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration +// [Application-Controlled Session Stickiness]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application +func (c *Client) SetLoadBalancerPoliciesOfListener(ctx context.Context, params *SetLoadBalancerPoliciesOfListenerInput, optFns ...func(*Options)) (*SetLoadBalancerPoliciesOfListenerOutput, error) { + if params == nil { + params = &SetLoadBalancerPoliciesOfListenerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SetLoadBalancerPoliciesOfListener", params, optFns, c.addOperationSetLoadBalancerPoliciesOfListenerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SetLoadBalancerPoliciesOfListenerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Contains the parameters for SetLoadBalancePoliciesOfListener. +type SetLoadBalancerPoliciesOfListenerInput struct { + + // The name of the load balancer. + // + // This member is required. + LoadBalancerName *string + + // The external port of the load balancer. + // + // This member is required. + LoadBalancerPort int32 + + // The names of the policies. This list must include all policies to be enabled. + // If you omit a policy that is currently enabled, it is disabled. If the list is + // empty, all current policies are disabled. + // + // This member is required. + PolicyNames []string + + noSmithyDocumentSerde +} + +// Contains the output of SetLoadBalancePoliciesOfListener. +type SetLoadBalancerPoliciesOfListenerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSetLoadBalancerPoliciesOfListenerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSetLoadBalancerPoliciesOfListener{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetLoadBalancerPoliciesOfListener{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SetLoadBalancerPoliciesOfListener"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpSetLoadBalancerPoliciesOfListenerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetLoadBalancerPoliciesOfListener(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptExecution(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSerialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterSerialization(stack, options); err != nil { + return err + } + if err = addInterceptBeforeSigning(stack, options); err != nil { + return err + } + if err = addInterceptAfterSigning(stack, options); err != nil { + return err + } + if err = addInterceptTransmit(stack, options); err != nil { + return err + } + if err = addInterceptBeforeDeserialization(stack, options); err != nil { + return err + } + if err = addInterceptAfterDeserialization(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSetLoadBalancerPoliciesOfListener(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SetLoadBalancerPoliciesOfListener", + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/auth.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/auth.go new file mode 100644 index 000000000..dc29d912b --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "elasticloadbalancing") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/deserializers.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/deserializers.go new file mode 100644 index 000000000..30f221e85 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/deserializers.go @@ -0,0 +1,9783 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "bytes" + "context" + "encoding/xml" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + smithy "github.com/aws/smithy-go" + smithyxml "github.com/aws/smithy-go/encoding/xml" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strconv" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsAwsquery_deserializeOpAddTags struct { +} + +func (*awsAwsquery_deserializeOpAddTags) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAddTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorAddTags(response, &metadata) + } + output := &AddTagsOutput{} + 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) + t, err = decoder.GetElement("AddTagsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAddTagsOutput(&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 awsAwsquery_deserializeOpErrorAddTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DuplicateTagKeys", errorCode): + return awsAwsquery_deserializeErrorDuplicateTagKeysException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTags", errorCode): + return awsAwsquery_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpApplySecurityGroupsToLoadBalancer struct { +} + +func (*awsAwsquery_deserializeOpApplySecurityGroupsToLoadBalancer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpApplySecurityGroupsToLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorApplySecurityGroupsToLoadBalancer(response, &metadata) + } + output := &ApplySecurityGroupsToLoadBalancerOutput{} + 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) + t, err = decoder.GetElement("ApplySecurityGroupsToLoadBalancerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentApplySecurityGroupsToLoadBalancerOutput(&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 awsAwsquery_deserializeOpErrorApplySecurityGroupsToLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("InvalidSecurityGroup", errorCode): + return awsAwsquery_deserializeErrorInvalidSecurityGroupException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAttachLoadBalancerToSubnets struct { +} + +func (*awsAwsquery_deserializeOpAttachLoadBalancerToSubnets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAttachLoadBalancerToSubnets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorAttachLoadBalancerToSubnets(response, &metadata) + } + output := &AttachLoadBalancerToSubnetsOutput{} + 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) + t, err = decoder.GetElement("AttachLoadBalancerToSubnetsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAttachLoadBalancerToSubnetsOutput(&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 awsAwsquery_deserializeOpErrorAttachLoadBalancerToSubnets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnetException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("SubnetNotFound", errorCode): + return awsAwsquery_deserializeErrorSubnetNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpConfigureHealthCheck struct { +} + +func (*awsAwsquery_deserializeOpConfigureHealthCheck) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpConfigureHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorConfigureHealthCheck(response, &metadata) + } + output := &ConfigureHealthCheckOutput{} + 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) + t, err = decoder.GetElement("ConfigureHealthCheckResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentConfigureHealthCheckOutput(&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 awsAwsquery_deserializeOpErrorConfigureHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateAppCookieStickinessPolicy struct { +} + +func (*awsAwsquery_deserializeOpCreateAppCookieStickinessPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateAppCookieStickinessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateAppCookieStickinessPolicy(response, &metadata) + } + output := &CreateAppCookieStickinessPolicyOutput{} + 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) + t, err = decoder.GetElement("CreateAppCookieStickinessPolicyResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateAppCookieStickinessPolicyOutput(&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 awsAwsquery_deserializeOpErrorCreateAppCookieStickinessPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DuplicatePolicyName", errorCode): + return awsAwsquery_deserializeErrorDuplicatePolicyNameException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyPolicies", errorCode): + return awsAwsquery_deserializeErrorTooManyPoliciesException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateLBCookieStickinessPolicy struct { +} + +func (*awsAwsquery_deserializeOpCreateLBCookieStickinessPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateLBCookieStickinessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateLBCookieStickinessPolicy(response, &metadata) + } + output := &CreateLBCookieStickinessPolicyOutput{} + 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) + t, err = decoder.GetElement("CreateLBCookieStickinessPolicyResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateLBCookieStickinessPolicyOutput(&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 awsAwsquery_deserializeOpErrorCreateLBCookieStickinessPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DuplicatePolicyName", errorCode): + return awsAwsquery_deserializeErrorDuplicatePolicyNameException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyPolicies", errorCode): + return awsAwsquery_deserializeErrorTooManyPoliciesException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateLoadBalancer struct { +} + +func (*awsAwsquery_deserializeOpCreateLoadBalancer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateLoadBalancer(response, &metadata) + } + output := &CreateLoadBalancerOutput{} + 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) + t, err = decoder.GetElement("CreateLoadBalancerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateLoadBalancerOutput(&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 awsAwsquery_deserializeOpErrorCreateLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundException(response, errorBody) + + case strings.EqualFold("DuplicateLoadBalancerName", errorCode): + return awsAwsquery_deserializeErrorDuplicateAccessPointNameException(response, errorBody) + + case strings.EqualFold("DuplicateTagKeys", errorCode): + return awsAwsquery_deserializeErrorDuplicateTagKeysException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("InvalidScheme", errorCode): + return awsAwsquery_deserializeErrorInvalidSchemeException(response, errorBody) + + case strings.EqualFold("InvalidSecurityGroup", errorCode): + return awsAwsquery_deserializeErrorInvalidSecurityGroupException(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnetException(response, errorBody) + + case strings.EqualFold("OperationNotPermitted", errorCode): + return awsAwsquery_deserializeErrorOperationNotPermittedException(response, errorBody) + + case strings.EqualFold("SubnetNotFound", errorCode): + return awsAwsquery_deserializeErrorSubnetNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyLoadBalancers", errorCode): + return awsAwsquery_deserializeErrorTooManyAccessPointsException(response, errorBody) + + case strings.EqualFold("TooManyTags", errorCode): + return awsAwsquery_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("UnsupportedProtocol", errorCode): + return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateLoadBalancerListeners struct { +} + +func (*awsAwsquery_deserializeOpCreateLoadBalancerListeners) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateLoadBalancerListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateLoadBalancerListeners(response, &metadata) + } + output := &CreateLoadBalancerListenersOutput{} + 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) + t, err = decoder.GetElement("CreateLoadBalancerListenersResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateLoadBalancerListenersOutput(&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 awsAwsquery_deserializeOpErrorCreateLoadBalancerListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundException(response, errorBody) + + case strings.EqualFold("DuplicateListener", errorCode): + return awsAwsquery_deserializeErrorDuplicateListenerException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedProtocol", errorCode): + return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateLoadBalancerPolicy struct { +} + +func (*awsAwsquery_deserializeOpCreateLoadBalancerPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateLoadBalancerPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorCreateLoadBalancerPolicy(response, &metadata) + } + output := &CreateLoadBalancerPolicyOutput{} + 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) + t, err = decoder.GetElement("CreateLoadBalancerPolicyResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateLoadBalancerPolicyOutput(&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 awsAwsquery_deserializeOpErrorCreateLoadBalancerPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DuplicatePolicyName", errorCode): + return awsAwsquery_deserializeErrorDuplicatePolicyNameException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("PolicyTypeNotFound", errorCode): + return awsAwsquery_deserializeErrorPolicyTypeNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyPolicies", errorCode): + return awsAwsquery_deserializeErrorTooManyPoliciesException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteLoadBalancer struct { +} + +func (*awsAwsquery_deserializeOpDeleteLoadBalancer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response, &metadata) + } + output := &DeleteLoadBalancerOutput{} + 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) + t, err = decoder.GetElement("DeleteLoadBalancerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(&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 awsAwsquery_deserializeOpErrorDeleteLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteLoadBalancerListeners struct { +} + +func (*awsAwsquery_deserializeOpDeleteLoadBalancerListeners) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteLoadBalancerListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteLoadBalancerListeners(response, &metadata) + } + output := &DeleteLoadBalancerListenersOutput{} + 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) + t, err = decoder.GetElement("DeleteLoadBalancerListenersResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteLoadBalancerListenersOutput(&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 awsAwsquery_deserializeOpErrorDeleteLoadBalancerListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteLoadBalancerPolicy struct { +} + +func (*awsAwsquery_deserializeOpDeleteLoadBalancerPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteLoadBalancerPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeleteLoadBalancerPolicy(response, &metadata) + } + output := &DeleteLoadBalancerPolicyOutput{} + 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) + t, err = decoder.GetElement("DeleteLoadBalancerPolicyResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteLoadBalancerPolicyOutput(&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 awsAwsquery_deserializeOpErrorDeleteLoadBalancerPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeregisterInstancesFromLoadBalancer struct { +} + +func (*awsAwsquery_deserializeOpDeregisterInstancesFromLoadBalancer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeregisterInstancesFromLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDeregisterInstancesFromLoadBalancer(response, &metadata) + } + output := &DeregisterInstancesFromLoadBalancerOutput{} + 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) + t, err = decoder.GetElement("DeregisterInstancesFromLoadBalancerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeregisterInstancesFromLoadBalancerOutput(&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 awsAwsquery_deserializeOpErrorDeregisterInstancesFromLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidInstance", errorCode): + return awsAwsquery_deserializeErrorInvalidEndPointException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeAccountLimits struct { +} + +func (*awsAwsquery_deserializeOpDescribeAccountLimits) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeAccountLimits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeAccountLimits(response, &metadata) + } + output := &DescribeAccountLimitsOutput{} + 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) + t, err = decoder.GetElement("DescribeAccountLimitsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(&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 awsAwsquery_deserializeOpErrorDescribeAccountLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeInstanceHealth struct { +} + +func (*awsAwsquery_deserializeOpDescribeInstanceHealth) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeInstanceHealth) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeInstanceHealth(response, &metadata) + } + output := &DescribeInstanceHealthOutput{} + 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) + t, err = decoder.GetElement("DescribeInstanceHealthResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeInstanceHealthOutput(&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 awsAwsquery_deserializeOpErrorDescribeInstanceHealth(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidInstance", errorCode): + return awsAwsquery_deserializeErrorInvalidEndPointException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeLoadBalancerAttributes struct { +} + +func (*awsAwsquery_deserializeOpDescribeLoadBalancerAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeLoadBalancerAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeLoadBalancerAttributes(response, &metadata) + } + output := &DescribeLoadBalancerAttributesOutput{} + 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) + t, err = decoder.GetElement("DescribeLoadBalancerAttributesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeLoadBalancerAttributesOutput(&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 awsAwsquery_deserializeOpErrorDescribeLoadBalancerAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("LoadBalancerAttributeNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerAttributeNotFoundException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeLoadBalancerPolicies struct { +} + +func (*awsAwsquery_deserializeOpDescribeLoadBalancerPolicies) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeLoadBalancerPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeLoadBalancerPolicies(response, &metadata) + } + output := &DescribeLoadBalancerPoliciesOutput{} + 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) + t, err = decoder.GetElement("DescribeLoadBalancerPoliciesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeLoadBalancerPoliciesOutput(&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 awsAwsquery_deserializeOpErrorDescribeLoadBalancerPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("PolicyNotFound", errorCode): + return awsAwsquery_deserializeErrorPolicyNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeLoadBalancerPolicyTypes struct { +} + +func (*awsAwsquery_deserializeOpDescribeLoadBalancerPolicyTypes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeLoadBalancerPolicyTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeLoadBalancerPolicyTypes(response, &metadata) + } + output := &DescribeLoadBalancerPolicyTypesOutput{} + 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) + t, err = decoder.GetElement("DescribeLoadBalancerPolicyTypesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeLoadBalancerPolicyTypesOutput(&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 awsAwsquery_deserializeOpErrorDescribeLoadBalancerPolicyTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("PolicyTypeNotFound", errorCode): + return awsAwsquery_deserializeErrorPolicyTypeNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeLoadBalancers struct { +} + +func (*awsAwsquery_deserializeOpDescribeLoadBalancers) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeLoadBalancers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeLoadBalancers(response, &metadata) + } + output := &DescribeLoadBalancersOutput{} + 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) + t, err = decoder.GetElement("DescribeLoadBalancersResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeLoadBalancersOutput(&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 awsAwsquery_deserializeOpErrorDescribeLoadBalancers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DependencyThrottle", errorCode): + return awsAwsquery_deserializeErrorDependencyThrottleException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeTags struct { +} + +func (*awsAwsquery_deserializeOpDescribeTags) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDescribeTags(response, &metadata) + } + output := &DescribeTagsOutput{} + 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) + t, err = decoder.GetElement("DescribeTagsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeTagsOutput(&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 awsAwsquery_deserializeOpErrorDescribeTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDetachLoadBalancerFromSubnets struct { +} + +func (*awsAwsquery_deserializeOpDetachLoadBalancerFromSubnets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDetachLoadBalancerFromSubnets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDetachLoadBalancerFromSubnets(response, &metadata) + } + output := &DetachLoadBalancerFromSubnetsOutput{} + 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) + t, err = decoder.GetElement("DetachLoadBalancerFromSubnetsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDetachLoadBalancerFromSubnetsOutput(&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 awsAwsquery_deserializeOpErrorDetachLoadBalancerFromSubnets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDisableAvailabilityZonesForLoadBalancer struct { +} + +func (*awsAwsquery_deserializeOpDisableAvailabilityZonesForLoadBalancer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDisableAvailabilityZonesForLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorDisableAvailabilityZonesForLoadBalancer(response, &metadata) + } + output := &DisableAvailabilityZonesForLoadBalancerOutput{} + 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) + t, err = decoder.GetElement("DisableAvailabilityZonesForLoadBalancerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDisableAvailabilityZonesForLoadBalancerOutput(&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 awsAwsquery_deserializeOpErrorDisableAvailabilityZonesForLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpEnableAvailabilityZonesForLoadBalancer struct { +} + +func (*awsAwsquery_deserializeOpEnableAvailabilityZonesForLoadBalancer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpEnableAvailabilityZonesForLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorEnableAvailabilityZonesForLoadBalancer(response, &metadata) + } + output := &EnableAvailabilityZonesForLoadBalancerOutput{} + 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) + t, err = decoder.GetElement("EnableAvailabilityZonesForLoadBalancerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentEnableAvailabilityZonesForLoadBalancerOutput(&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 awsAwsquery_deserializeOpErrorEnableAvailabilityZonesForLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyLoadBalancerAttributes struct { +} + +func (*awsAwsquery_deserializeOpModifyLoadBalancerAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyLoadBalancerAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response, &metadata) + } + output := &ModifyLoadBalancerAttributesOutput{} + 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) + t, err = decoder.GetElement("ModifyLoadBalancerAttributesResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyLoadBalancerAttributesOutput(&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 awsAwsquery_deserializeOpErrorModifyLoadBalancerAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerAttributeNotFound", errorCode): + return awsAwsquery_deserializeErrorLoadBalancerAttributeNotFoundException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRegisterInstancesWithLoadBalancer struct { +} + +func (*awsAwsquery_deserializeOpRegisterInstancesWithLoadBalancer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRegisterInstancesWithLoadBalancer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorRegisterInstancesWithLoadBalancer(response, &metadata) + } + output := &RegisterInstancesWithLoadBalancerOutput{} + 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) + t, err = decoder.GetElement("RegisterInstancesWithLoadBalancerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRegisterInstancesWithLoadBalancerOutput(&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 awsAwsquery_deserializeOpErrorRegisterInstancesWithLoadBalancer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidInstance", errorCode): + return awsAwsquery_deserializeErrorInvalidEndPointException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRemoveTags struct { +} + +func (*awsAwsquery_deserializeOpRemoveTags) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorRemoveTags(response, &metadata) + } + output := &RemoveTagsOutput{} + 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) + t, err = decoder.GetElement("RemoveTagsResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRemoveTagsOutput(&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 awsAwsquery_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetLoadBalancerListenerSSLCertificate struct { +} + +func (*awsAwsquery_deserializeOpSetLoadBalancerListenerSSLCertificate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetLoadBalancerListenerSSLCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetLoadBalancerListenerSSLCertificate(response, &metadata) + } + output := &SetLoadBalancerListenerSSLCertificateOutput{} + 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) + t, err = decoder.GetElement("SetLoadBalancerListenerSSLCertificateResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetLoadBalancerListenerSSLCertificateOutput(&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 awsAwsquery_deserializeOpErrorSetLoadBalancerListenerSSLCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedProtocol", errorCode): + return awsAwsquery_deserializeErrorUnsupportedProtocolException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetLoadBalancerPoliciesForBackendServer struct { +} + +func (*awsAwsquery_deserializeOpSetLoadBalancerPoliciesForBackendServer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetLoadBalancerPoliciesForBackendServer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetLoadBalancerPoliciesForBackendServer(response, &metadata) + } + output := &SetLoadBalancerPoliciesForBackendServerOutput{} + 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) + t, err = decoder.GetElement("SetLoadBalancerPoliciesForBackendServerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetLoadBalancerPoliciesForBackendServerOutput(&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 awsAwsquery_deserializeOpErrorSetLoadBalancerPoliciesForBackendServer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("PolicyNotFound", errorCode): + return awsAwsquery_deserializeErrorPolicyNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSetLoadBalancerPoliciesOfListener struct { +} + +func (*awsAwsquery_deserializeOpSetLoadBalancerPoliciesOfListener) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSetLoadBalancerPoliciesOfListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSetLoadBalancerPoliciesOfListener(response, &metadata) + } + output := &SetLoadBalancerPoliciesOfListenerOutput{} + 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) + t, err = decoder.GetElement("SetLoadBalancerPoliciesOfListenerResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSetLoadBalancerPoliciesOfListenerOutput(&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 awsAwsquery_deserializeOpErrorSetLoadBalancerPoliciesOfListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidConfigurationRequest", errorCode): + return awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response, errorBody) + + case strings.EqualFold("ListenerNotFound", errorCode): + return awsAwsquery_deserializeErrorListenerNotFoundException(response, errorBody) + + case strings.EqualFold("LoadBalancerNotFound", errorCode): + return awsAwsquery_deserializeErrorAccessPointNotFoundException(response, errorBody) + + case strings.EqualFold("PolicyNotFound", errorCode): + return awsAwsquery_deserializeErrorPolicyNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsquery_deserializeErrorAccessPointNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessPointNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentAccessPointNotFoundException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCertificateNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CertificateNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCertificateNotFoundException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDependencyThrottleException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DependencyThrottleException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDependencyThrottleException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDuplicateAccessPointNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateAccessPointNameException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDuplicateAccessPointNameException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDuplicateListenerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateListenerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDuplicateListenerException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDuplicatePolicyNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicatePolicyNameException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDuplicatePolicyNameException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDuplicateTagKeysException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DuplicateTagKeysException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDuplicateTagKeysException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidConfigurationRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidConfigurationRequestException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidEndPointException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidEndPointException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidEndPointException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidSchemeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSchemeException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidSchemeException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidSecurityGroupException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSecurityGroupException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidSecurityGroupException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidSubnetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSubnetException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidSubnetException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorListenerNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ListenerNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentListenerNotFoundException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorLoadBalancerAttributeNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LoadBalancerAttributeNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentLoadBalancerAttributeNotFoundException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorOperationNotPermittedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.OperationNotPermittedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentOperationNotPermittedException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PolicyNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentPolicyNotFoundException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorPolicyTypeNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PolicyTypeNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentPolicyTypeNotFoundException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSubnetNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SubnetNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSubnetNotFoundException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTooManyAccessPointsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyAccessPointsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTooManyAccessPointsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTooManyPoliciesException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyPoliciesException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTooManyPoliciesException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTagsException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTooManyTagsException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorUnsupportedProtocolException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnsupportedProtocolException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentUnsupportedProtocolException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeDocumentAccessLog(v **types.AccessLog, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AccessLog + if *v == nil { + sv = &types.AccessLog{} + } 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("EmitInterval", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.EmitInterval = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Enabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected AccessLogEnabled to be of type *bool, got %T instead", val) + } + sv.Enabled = xtv + } + + case strings.EqualFold("S3BucketName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3BucketName = ptr.String(xtv) + } + + case strings.EqualFold("S3BucketPrefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3BucketPrefix = 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 awsAwsquery_deserializeDocumentAccessPointNotFoundException(v **types.AccessPointNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AccessPointNotFoundException + if *v == nil { + sv = &types.AccessPointNotFoundException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAdditionalAttribute(v **types.AdditionalAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AdditionalAttribute + if *v == nil { + sv = &types.AdditionalAttribute{} + } 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("Key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Key = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAdditionalAttributes(v *[]types.AdditionalAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AdditionalAttribute + if *v == nil { + sv = make([]types.AdditionalAttribute, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.AdditionalAttribute + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAdditionalAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAdditionalAttributesUnwrapped(v *[]types.AdditionalAttribute, decoder smithyxml.NodeDecoder) error { + var sv []types.AdditionalAttribute + if *v == nil { + sv = make([]types.AdditionalAttribute, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AdditionalAttribute + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAdditionalAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAppCookieStickinessPolicies(v *[]types.AppCookieStickinessPolicy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AppCookieStickinessPolicy + if *v == nil { + sv = make([]types.AppCookieStickinessPolicy, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.AppCookieStickinessPolicy + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAppCookieStickinessPolicy(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAppCookieStickinessPoliciesUnwrapped(v *[]types.AppCookieStickinessPolicy, decoder smithyxml.NodeDecoder) error { + var sv []types.AppCookieStickinessPolicy + if *v == nil { + sv = make([]types.AppCookieStickinessPolicy, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AppCookieStickinessPolicy + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAppCookieStickinessPolicy(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAppCookieStickinessPolicy(v **types.AppCookieStickinessPolicy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AppCookieStickinessPolicy + if *v == nil { + sv = &types.AppCookieStickinessPolicy{} + } 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("CookieName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CookieName = ptr.String(xtv) + } + + case strings.EqualFold("PolicyName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PolicyName = 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 awsAwsquery_deserializeDocumentAvailabilityZones(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAvailabilityZonesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentBackendServerDescription(v **types.BackendServerDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BackendServerDescription + if *v == nil { + sv = &types.BackendServerDescription{} + } 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("InstancePort", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.InstancePort = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("PolicyNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyNames(&sv.PolicyNames, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBackendServerDescriptions(v *[]types.BackendServerDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.BackendServerDescription + if *v == nil { + sv = make([]types.BackendServerDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.BackendServerDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentBackendServerDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBackendServerDescriptionsUnwrapped(v *[]types.BackendServerDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.BackendServerDescription + if *v == nil { + sv = make([]types.BackendServerDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.BackendServerDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentBackendServerDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCertificateNotFoundException(v **types.CertificateNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CertificateNotFoundException + if *v == nil { + sv = &types.CertificateNotFoundException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentConnectionDraining(v **types.ConnectionDraining, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConnectionDraining + if *v == nil { + sv = &types.ConnectionDraining{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Enabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected ConnectionDrainingEnabled to be of type *bool, got %T instead", val) + } + sv.Enabled = xtv + } + + case strings.EqualFold("Timeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Timeout = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentConnectionSettings(v **types.ConnectionSettings, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConnectionSettings + if *v == nil { + sv = &types.ConnectionSettings{} + } 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("IdleTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.IdleTimeout = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCrossZoneLoadBalancing(v **types.CrossZoneLoadBalancing, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CrossZoneLoadBalancing + if *v == nil { + sv = &types.CrossZoneLoadBalancing{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Enabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected CrossZoneLoadBalancingEnabled to be of type *bool, got %T instead", val) + } + sv.Enabled = 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 awsAwsquery_deserializeDocumentDependencyThrottleException(v **types.DependencyThrottleException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DependencyThrottleException + if *v == nil { + sv = &types.DependencyThrottleException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDuplicateAccessPointNameException(v **types.DuplicateAccessPointNameException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DuplicateAccessPointNameException + if *v == nil { + sv = &types.DuplicateAccessPointNameException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDuplicateListenerException(v **types.DuplicateListenerException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DuplicateListenerException + if *v == nil { + sv = &types.DuplicateListenerException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDuplicatePolicyNameException(v **types.DuplicatePolicyNameException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DuplicatePolicyNameException + if *v == nil { + sv = &types.DuplicatePolicyNameException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDuplicateTagKeysException(v **types.DuplicateTagKeysException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DuplicateTagKeysException + if *v == nil { + sv = &types.DuplicateTagKeysException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HealthCheck + if *v == nil { + sv = &types.HealthCheck{} + } 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("HealthyThreshold", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.HealthyThreshold = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Interval", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Interval = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Target", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Target = ptr.String(xtv) + } + + case strings.EqualFold("Timeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Timeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("UnhealthyThreshold", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.UnhealthyThreshold = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInstance(v **types.Instance, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Instance + if *v == nil { + sv = &types.Instance{} + } 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("InstanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceId = 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 awsAwsquery_deserializeDocumentInstances(v *[]types.Instance, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Instance + if *v == nil { + sv = make([]types.Instance, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.Instance + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentInstance(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInstancesUnwrapped(v *[]types.Instance, decoder smithyxml.NodeDecoder) error { + var sv []types.Instance + if *v == nil { + sv = make([]types.Instance, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Instance + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentInstance(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentInstanceState(v **types.InstanceState, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InstanceState + if *v == nil { + sv = &types.InstanceState{} + } 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("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("InstanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceId = ptr.String(xtv) + } + + case strings.EqualFold("ReasonCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReasonCode = ptr.String(xtv) + } + + case strings.EqualFold("State", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = 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 awsAwsquery_deserializeDocumentInstanceStates(v *[]types.InstanceState, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.InstanceState + if *v == nil { + sv = make([]types.InstanceState, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.InstanceState + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentInstanceState(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInstanceStatesUnwrapped(v *[]types.InstanceState, decoder smithyxml.NodeDecoder) error { + var sv []types.InstanceState + if *v == nil { + sv = make([]types.InstanceState, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.InstanceState + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentInstanceState(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentInvalidConfigurationRequestException(v **types.InvalidConfigurationRequestException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidConfigurationRequestException + if *v == nil { + sv = &types.InvalidConfigurationRequestException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidEndPointException(v **types.InvalidEndPointException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidEndPointException + if *v == nil { + sv = &types.InvalidEndPointException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidSchemeException(v **types.InvalidSchemeException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidSchemeException + if *v == nil { + sv = &types.InvalidSchemeException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidSecurityGroupException(v **types.InvalidSecurityGroupException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidSecurityGroupException + if *v == nil { + sv = &types.InvalidSecurityGroupException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidSubnetException(v **types.InvalidSubnetException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidSubnetException + if *v == nil { + sv = &types.InvalidSubnetException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLBCookieStickinessPolicies(v *[]types.LBCookieStickinessPolicy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.LBCookieStickinessPolicy + if *v == nil { + sv = make([]types.LBCookieStickinessPolicy, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.LBCookieStickinessPolicy + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentLBCookieStickinessPolicy(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLBCookieStickinessPoliciesUnwrapped(v *[]types.LBCookieStickinessPolicy, decoder smithyxml.NodeDecoder) error { + var sv []types.LBCookieStickinessPolicy + if *v == nil { + sv = make([]types.LBCookieStickinessPolicy, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.LBCookieStickinessPolicy + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentLBCookieStickinessPolicy(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentLBCookieStickinessPolicy(v **types.LBCookieStickinessPolicy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LBCookieStickinessPolicy + if *v == nil { + sv = &types.LBCookieStickinessPolicy{} + } 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("CookieExpirationPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.CookieExpirationPeriod = ptr.Int64(i64) + } + + case strings.EqualFold("PolicyName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PolicyName = 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 awsAwsquery_deserializeDocumentLimit(v **types.Limit, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Limit + if *v == nil { + sv = &types.Limit{} + } 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("Max", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Max = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = 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 awsAwsquery_deserializeDocumentLimits(v *[]types.Limit, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Limit + if *v == nil { + sv = make([]types.Limit, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.Limit + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentLimit(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLimitsUnwrapped(v *[]types.Limit, decoder smithyxml.NodeDecoder) error { + var sv []types.Limit + if *v == nil { + sv = make([]types.Limit, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Limit + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentLimit(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentListener(v **types.Listener, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Listener + if *v == nil { + sv = &types.Listener{} + } 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("InstancePort", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.InstancePort = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("InstanceProtocol", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceProtocol = ptr.String(xtv) + } + + case strings.EqualFold("LoadBalancerPort", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.LoadBalancerPort = int32(i64) + } + + case strings.EqualFold("Protocol", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Protocol = ptr.String(xtv) + } + + case strings.EqualFold("SSLCertificateId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SSLCertificateId = 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 awsAwsquery_deserializeDocumentListenerDescription(v **types.ListenerDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ListenerDescription + if *v == nil { + sv = &types.ListenerDescription{} + } 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("Listener", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListener(&sv.Listener, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PolicyNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyNames(&sv.PolicyNames, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentListenerDescriptions(v *[]types.ListenerDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ListenerDescription + if *v == nil { + sv = make([]types.ListenerDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ListenerDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentListenerDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentListenerDescriptionsUnwrapped(v *[]types.ListenerDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.ListenerDescription + if *v == nil { + sv = make([]types.ListenerDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ListenerDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentListenerDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentListenerNotFoundException(v **types.ListenerNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ListenerNotFoundException + if *v == nil { + sv = &types.ListenerNotFoundException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLoadBalancerAttributeNotFoundException(v **types.LoadBalancerAttributeNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LoadBalancerAttributeNotFoundException + if *v == nil { + sv = &types.LoadBalancerAttributeNotFoundException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLoadBalancerAttributes(v **types.LoadBalancerAttributes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LoadBalancerAttributes + if *v == nil { + sv = &types.LoadBalancerAttributes{} + } 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("AccessLog", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAccessLog(&sv.AccessLog, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AdditionalAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAdditionalAttributes(&sv.AdditionalAttributes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ConnectionDraining", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentConnectionDraining(&sv.ConnectionDraining, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ConnectionSettings", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentConnectionSettings(&sv.ConnectionSettings, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CrossZoneLoadBalancing", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCrossZoneLoadBalancing(&sv.CrossZoneLoadBalancing, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLoadBalancerDescription(v **types.LoadBalancerDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LoadBalancerDescription + if *v == nil { + sv = &types.LoadBalancerDescription{} + } 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("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("BackendServerDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBackendServerDescriptions(&sv.BackendServerDescriptions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CanonicalHostedZoneName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CanonicalHostedZoneName = ptr.String(xtv) + } + + case strings.EqualFold("CanonicalHostedZoneNameID", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CanonicalHostedZoneNameID = ptr.String(xtv) + } + + case strings.EqualFold("CreatedTime", 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.CreatedTime = ptr.Time(t) + } + + case strings.EqualFold("DNSName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DNSName = ptr.String(xtv) + } + + case strings.EqualFold("HealthCheck", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentHealthCheck(&sv.HealthCheck, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Instances", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentInstances(&sv.Instances, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ListenerDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentListenerDescriptions(&sv.ListenerDescriptions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("LoadBalancerName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LoadBalancerName = ptr.String(xtv) + } + + case strings.EqualFold("Policies", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicies(&sv.Policies, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Scheme", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Scheme = ptr.String(xtv) + } + + case strings.EqualFold("SecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSecurityGroups(&sv.SecurityGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SourceSecurityGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSourceSecurityGroup(&sv.SourceSecurityGroup, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Subnets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSubnets(&sv.Subnets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VPCId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VPCId = 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 awsAwsquery_deserializeDocumentLoadBalancerDescriptions(v *[]types.LoadBalancerDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.LoadBalancerDescription + if *v == nil { + sv = make([]types.LoadBalancerDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.LoadBalancerDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentLoadBalancerDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLoadBalancerDescriptionsUnwrapped(v *[]types.LoadBalancerDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.LoadBalancerDescription + if *v == nil { + sv = make([]types.LoadBalancerDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.LoadBalancerDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentLoadBalancerDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOperationNotPermittedException(v **types.OperationNotPermittedException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OperationNotPermittedException + if *v == nil { + sv = &types.OperationNotPermittedException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicies(v **types.Policies, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Policies + if *v == nil { + sv = &types.Policies{} + } 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("AppCookieStickinessPolicies", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAppCookieStickinessPolicies(&sv.AppCookieStickinessPolicies, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("LBCookieStickinessPolicies", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLBCookieStickinessPolicies(&sv.LBCookieStickinessPolicies, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OtherPolicies", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyNames(&sv.OtherPolicies, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyAttributeDescription(v **types.PolicyAttributeDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PolicyAttributeDescription + if *v == nil { + sv = &types.PolicyAttributeDescription{} + } 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("AttributeName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AttributeName = ptr.String(xtv) + } + + case strings.EqualFold("AttributeValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AttributeValue = 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 awsAwsquery_deserializeDocumentPolicyAttributeDescriptions(v *[]types.PolicyAttributeDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.PolicyAttributeDescription + if *v == nil { + sv = make([]types.PolicyAttributeDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.PolicyAttributeDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentPolicyAttributeDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyAttributeDescriptionsUnwrapped(v *[]types.PolicyAttributeDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.PolicyAttributeDescription + if *v == nil { + sv = make([]types.PolicyAttributeDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.PolicyAttributeDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentPolicyAttributeDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPolicyAttributeTypeDescription(v **types.PolicyAttributeTypeDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PolicyAttributeTypeDescription + if *v == nil { + sv = &types.PolicyAttributeTypeDescription{} + } 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("AttributeName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AttributeName = ptr.String(xtv) + } + + case strings.EqualFold("AttributeType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AttributeType = ptr.String(xtv) + } + + case strings.EqualFold("Cardinality", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Cardinality = ptr.String(xtv) + } + + case strings.EqualFold("DefaultValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DefaultValue = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = 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 awsAwsquery_deserializeDocumentPolicyAttributeTypeDescriptions(v *[]types.PolicyAttributeTypeDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.PolicyAttributeTypeDescription + if *v == nil { + sv = make([]types.PolicyAttributeTypeDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.PolicyAttributeTypeDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentPolicyAttributeTypeDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyAttributeTypeDescriptionsUnwrapped(v *[]types.PolicyAttributeTypeDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.PolicyAttributeTypeDescription + if *v == nil { + sv = make([]types.PolicyAttributeTypeDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.PolicyAttributeTypeDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentPolicyAttributeTypeDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPolicyDescription(v **types.PolicyDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PolicyDescription + if *v == nil { + sv = &types.PolicyDescription{} + } 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("PolicyAttributeDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyAttributeDescriptions(&sv.PolicyAttributeDescriptions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PolicyName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PolicyName = ptr.String(xtv) + } + + case strings.EqualFold("PolicyTypeName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PolicyTypeName = 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 awsAwsquery_deserializeDocumentPolicyDescriptions(v *[]types.PolicyDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.PolicyDescription + if *v == nil { + sv = make([]types.PolicyDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.PolicyDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentPolicyDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyDescriptionsUnwrapped(v *[]types.PolicyDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.PolicyDescription + if *v == nil { + sv = make([]types.PolicyDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.PolicyDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentPolicyDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPolicyNames(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyNamesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPolicyNotFoundException(v **types.PolicyNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PolicyNotFoundException + if *v == nil { + sv = &types.PolicyNotFoundException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyTypeDescription(v **types.PolicyTypeDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PolicyTypeDescription + if *v == nil { + sv = &types.PolicyTypeDescription{} + } 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("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("PolicyAttributeTypeDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyAttributeTypeDescriptions(&sv.PolicyAttributeTypeDescriptions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PolicyTypeName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PolicyTypeName = 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 awsAwsquery_deserializeDocumentPolicyTypeDescriptions(v *[]types.PolicyTypeDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.PolicyTypeDescription + if *v == nil { + sv = make([]types.PolicyTypeDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.PolicyTypeDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentPolicyTypeDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPolicyTypeDescriptionsUnwrapped(v *[]types.PolicyTypeDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.PolicyTypeDescription + if *v == nil { + sv = make([]types.PolicyTypeDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.PolicyTypeDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentPolicyTypeDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPolicyTypeNotFoundException(v **types.PolicyTypeNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PolicyTypeNotFoundException + if *v == nil { + sv = &types.PolicyTypeNotFoundException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSecurityGroups(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSecurityGroupsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentSourceSecurityGroup(v **types.SourceSecurityGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SourceSecurityGroup + if *v == nil { + sv = &types.SourceSecurityGroup{} + } 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("GroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GroupName = ptr.String(xtv) + } + + case strings.EqualFold("OwnerAlias", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OwnerAlias = 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 awsAwsquery_deserializeDocumentSubnetNotFoundException(v **types.SubnetNotFoundException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SubnetNotFoundException + if *v == nil { + sv = &types.SubnetNotFoundException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSubnets(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSubnetsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } 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("Key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Key = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTagDescription(v **types.TagDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TagDescription + if *v == nil { + sv = &types.TagDescription{} + } 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("LoadBalancerName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LoadBalancerName = ptr.String(xtv) + } + + case strings.EqualFold("Tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTagDescriptions(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.TagDescription + if *v == nil { + sv = make([]types.TagDescription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.TagDescription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTagDescriptionsUnwrapped(v *[]types.TagDescription, decoder smithyxml.NodeDecoder) error { + var sv []types.TagDescription + if *v == nil { + sv = make([]types.TagDescription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.TagDescription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTagDescription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTagList(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Tag + if *v == nil { + sv = make([]types.Tag, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.Tag + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTagListUnwrapped(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { + var sv []types.Tag + if *v == nil { + sv = make([]types.Tag, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Tag + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTooManyAccessPointsException(v **types.TooManyAccessPointsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyAccessPointsException + if *v == nil { + sv = &types.TooManyAccessPointsException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTooManyPoliciesException(v **types.TooManyPoliciesException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyPoliciesException + if *v == nil { + sv = &types.TooManyPoliciesException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyTagsException + if *v == nil { + sv = &types.TooManyTagsException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentUnsupportedProtocolException(v **types.UnsupportedProtocolException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.UnsupportedProtocolException + if *v == nil { + sv = &types.UnsupportedProtocolException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentAddTagsOutput(v **AddTagsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AddTagsOutput + if *v == nil { + sv = &AddTagsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentApplySecurityGroupsToLoadBalancerOutput(v **ApplySecurityGroupsToLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ApplySecurityGroupsToLoadBalancerOutput + if *v == nil { + sv = &ApplySecurityGroupsToLoadBalancerOutput{} + } 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("SecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSecurityGroups(&sv.SecurityGroups, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentAttachLoadBalancerToSubnetsOutput(v **AttachLoadBalancerToSubnetsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AttachLoadBalancerToSubnetsOutput + if *v == nil { + sv = &AttachLoadBalancerToSubnetsOutput{} + } 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("Subnets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSubnets(&sv.Subnets, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentConfigureHealthCheckOutput(v **ConfigureHealthCheckOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ConfigureHealthCheckOutput + if *v == nil { + sv = &ConfigureHealthCheckOutput{} + } 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("HealthCheck", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentHealthCheck(&sv.HealthCheck, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateAppCookieStickinessPolicyOutput(v **CreateAppCookieStickinessPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateAppCookieStickinessPolicyOutput + if *v == nil { + sv = &CreateAppCookieStickinessPolicyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateLBCookieStickinessPolicyOutput(v **CreateLBCookieStickinessPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateLBCookieStickinessPolicyOutput + if *v == nil { + sv = &CreateLBCookieStickinessPolicyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateLoadBalancerListenersOutput(v **CreateLoadBalancerListenersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateLoadBalancerListenersOutput + if *v == nil { + sv = &CreateLoadBalancerListenersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateLoadBalancerOutput(v **CreateLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateLoadBalancerOutput + if *v == nil { + sv = &CreateLoadBalancerOutput{} + } 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("DNSName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DNSName = 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 awsAwsquery_deserializeOpDocumentCreateLoadBalancerPolicyOutput(v **CreateLoadBalancerPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateLoadBalancerPolicyOutput + if *v == nil { + sv = &CreateLoadBalancerPolicyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteLoadBalancerListenersOutput(v **DeleteLoadBalancerListenersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteLoadBalancerListenersOutput + if *v == nil { + sv = &DeleteLoadBalancerListenersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteLoadBalancerOutput(v **DeleteLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteLoadBalancerOutput + if *v == nil { + sv = &DeleteLoadBalancerOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteLoadBalancerPolicyOutput(v **DeleteLoadBalancerPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteLoadBalancerPolicyOutput + if *v == nil { + sv = &DeleteLoadBalancerPolicyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeregisterInstancesFromLoadBalancerOutput(v **DeregisterInstancesFromLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeregisterInstancesFromLoadBalancerOutput + if *v == nil { + sv = &DeregisterInstancesFromLoadBalancerOutput{} + } 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("Instances", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentInstances(&sv.Instances, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeAccountLimitsOutput(v **DescribeAccountLimitsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeAccountLimitsOutput + if *v == nil { + sv = &DescribeAccountLimitsOutput{} + } 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("Limits", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLimits(&sv.Limits, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + + 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 awsAwsquery_deserializeOpDocumentDescribeInstanceHealthOutput(v **DescribeInstanceHealthOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeInstanceHealthOutput + if *v == nil { + sv = &DescribeInstanceHealthOutput{} + } 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("InstanceStates", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentInstanceStates(&sv.InstanceStates, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeLoadBalancerAttributesOutput(v **DescribeLoadBalancerAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeLoadBalancerAttributesOutput + if *v == nil { + sv = &DescribeLoadBalancerAttributesOutput{} + } 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("LoadBalancerAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancerAttributes(&sv.LoadBalancerAttributes, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeLoadBalancerPoliciesOutput(v **DescribeLoadBalancerPoliciesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeLoadBalancerPoliciesOutput + if *v == nil { + sv = &DescribeLoadBalancerPoliciesOutput{} + } 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("PolicyDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyDescriptions(&sv.PolicyDescriptions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeLoadBalancerPolicyTypesOutput(v **DescribeLoadBalancerPolicyTypesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeLoadBalancerPolicyTypesOutput + if *v == nil { + sv = &DescribeLoadBalancerPolicyTypesOutput{} + } 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("PolicyTypeDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPolicyTypeDescriptions(&sv.PolicyTypeDescriptions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeLoadBalancersOutput(v **DescribeLoadBalancersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeLoadBalancersOutput + if *v == nil { + sv = &DescribeLoadBalancersOutput{} + } 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("LoadBalancerDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancerDescriptions(&sv.LoadBalancerDescriptions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + + 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 awsAwsquery_deserializeOpDocumentDescribeTagsOutput(v **DescribeTagsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeTagsOutput + if *v == nil { + sv = &DescribeTagsOutput{} + } 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("TagDescriptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagDescriptions(&sv.TagDescriptions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDetachLoadBalancerFromSubnetsOutput(v **DetachLoadBalancerFromSubnetsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DetachLoadBalancerFromSubnetsOutput + if *v == nil { + sv = &DetachLoadBalancerFromSubnetsOutput{} + } 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("Subnets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSubnets(&sv.Subnets, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDisableAvailabilityZonesForLoadBalancerOutput(v **DisableAvailabilityZonesForLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DisableAvailabilityZonesForLoadBalancerOutput + if *v == nil { + sv = &DisableAvailabilityZonesForLoadBalancerOutput{} + } 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("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentEnableAvailabilityZonesForLoadBalancerOutput(v **EnableAvailabilityZonesForLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *EnableAvailabilityZonesForLoadBalancerOutput + if *v == nil { + sv = &EnableAvailabilityZonesForLoadBalancerOutput{} + } 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("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyLoadBalancerAttributesOutput(v **ModifyLoadBalancerAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyLoadBalancerAttributesOutput + if *v == nil { + sv = &ModifyLoadBalancerAttributesOutput{} + } 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("LoadBalancerAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLoadBalancerAttributes(&sv.LoadBalancerAttributes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("LoadBalancerName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LoadBalancerName = 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 awsAwsquery_deserializeOpDocumentRegisterInstancesWithLoadBalancerOutput(v **RegisterInstancesWithLoadBalancerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RegisterInstancesWithLoadBalancerOutput + if *v == nil { + sv = &RegisterInstancesWithLoadBalancerOutput{} + } 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("Instances", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentInstances(&sv.Instances, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRemoveTagsOutput(v **RemoveTagsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RemoveTagsOutput + if *v == nil { + sv = &RemoveTagsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetLoadBalancerListenerSSLCertificateOutput(v **SetLoadBalancerListenerSSLCertificateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetLoadBalancerListenerSSLCertificateOutput + if *v == nil { + sv = &SetLoadBalancerListenerSSLCertificateOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetLoadBalancerPoliciesForBackendServerOutput(v **SetLoadBalancerPoliciesForBackendServerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetLoadBalancerPoliciesForBackendServerOutput + if *v == nil { + sv = &SetLoadBalancerPoliciesForBackendServerOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSetLoadBalancerPoliciesOfListenerOutput(v **SetLoadBalancerPoliciesOfListenerOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SetLoadBalancerPoliciesOfListenerOutput + if *v == nil { + sv = &SetLoadBalancerPoliciesOfListenerOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/doc.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/doc.go new file mode 100644 index 000000000..426f94020 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/doc.go @@ -0,0 +1,33 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package elasticloadbalancing provides the API client, operations, and parameter +// types for Elastic Load Balancing. +// +// # Elastic Load Balancing +// +// A load balancer can distribute incoming traffic across your EC2 instances. This +// enables you to increase the availability of your application. The load balancer +// also monitors the health of its registered instances and ensures that it routes +// traffic only to healthy instances. You configure your load balancer to accept +// incoming traffic by specifying one or more listeners, which are configured with +// a protocol and port number for connections from clients to the load balancer and +// a protocol and port number for connections from the load balancer to the +// instances. +// +// Elastic Load Balancing supports three types of load balancers: Application Load +// Balancers, Network Load Balancers, and Classic Load Balancers. You can select a +// load balancer based on your application needs. For more information, see the [Elastic Load Balancing User Guide]. +// +// This reference covers the 2012-06-01 API, which supports Classic Load +// Balancers. The 2015-12-01 API supports Application Load Balancers and Network +// Load Balancers. +// +// To get started, create a load balancer with one or more listeners using CreateLoadBalancer. +// Register your instances with the load balancer using RegisterInstancesWithLoadBalancer. +// +// All Elastic Load Balancing operations are idempotent, which means that they +// complete at most one time. If you repeat an operation, it succeeds with a 200 OK +// response code. +// +// [Elastic Load Balancing User Guide]: https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/ +package elasticloadbalancing diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/endpoints.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/endpoints.go new file mode 100644 index 000000000..72594b4d4 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/endpoints.go @@ -0,0 +1,556 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "elasticloadbalancing" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_ELASTIC_LOAD_BALANCING") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Elastic Load Balancing", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://elasticloadbalancing-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { + uriString := func() string { + var out strings.Builder + out.WriteString("https://elasticloadbalancing.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://elasticloadbalancing-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://elasticloadbalancing.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://elasticloadbalancing.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/generated.json b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/generated.json new file mode 100644 index 000000000..696c020fc --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/generated.json @@ -0,0 +1,61 @@ +{ + "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_AddTags.go", + "api_op_ApplySecurityGroupsToLoadBalancer.go", + "api_op_AttachLoadBalancerToSubnets.go", + "api_op_ConfigureHealthCheck.go", + "api_op_CreateAppCookieStickinessPolicy.go", + "api_op_CreateLBCookieStickinessPolicy.go", + "api_op_CreateLoadBalancer.go", + "api_op_CreateLoadBalancerListeners.go", + "api_op_CreateLoadBalancerPolicy.go", + "api_op_DeleteLoadBalancer.go", + "api_op_DeleteLoadBalancerListeners.go", + "api_op_DeleteLoadBalancerPolicy.go", + "api_op_DeregisterInstancesFromLoadBalancer.go", + "api_op_DescribeAccountLimits.go", + "api_op_DescribeInstanceHealth.go", + "api_op_DescribeLoadBalancerAttributes.go", + "api_op_DescribeLoadBalancerPolicies.go", + "api_op_DescribeLoadBalancerPolicyTypes.go", + "api_op_DescribeLoadBalancers.go", + "api_op_DescribeTags.go", + "api_op_DetachLoadBalancerFromSubnets.go", + "api_op_DisableAvailabilityZonesForLoadBalancer.go", + "api_op_EnableAvailabilityZonesForLoadBalancer.go", + "api_op_ModifyLoadBalancerAttributes.go", + "api_op_RegisterInstancesWithLoadBalancer.go", + "api_op_RemoveTags.go", + "api_op_SetLoadBalancerListenerSSLCertificate.go", + "api_op_SetLoadBalancerPoliciesForBackendServer.go", + "api_op_SetLoadBalancerPoliciesOfListener.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "sra_operation_order_test.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.22", + "module": "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing", + "unstable": false +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/go_module_metadata.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/go_module_metadata.go new file mode 100644 index 000000000..e3a6c2c56 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package elasticloadbalancing + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.30.1" diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/internal/endpoints/endpoints.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/internal/endpoints/endpoints.go new file mode 100644 index 000000000..17ae9601c --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/internal/endpoints/endpoints.go @@ -0,0 +1,559 @@ +// 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 Elastic Load Balancing 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 + AwsEusc *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticloadbalancing.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-2", + }: 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: "ap-southeast-5", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-7", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-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: "fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "elasticloadbalancing-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-2", + }: endpoints.Endpoint{ + Hostname: "elasticloadbalancing-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-1", + }: endpoints.Endpoint{ + Hostname: "elasticloadbalancing-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "elasticloadbalancing-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "mx-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.us-east-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.us-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.us-west-2.amazonaws.com", + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticloadbalancing.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-eusc", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.amazonaws.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.amazonaws.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsEusc, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{ + Protocols: []string{"http", "https"}, + }, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "eu-isoe-west-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isof-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isof-south-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "elasticloadbalancing.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "elasticloadbalancing-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "elasticloadbalancing.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "elasticloadbalancing.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "elasticloadbalancing.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing.us-gov-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Protocols: []string{"http", "https"}, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "elasticloadbalancing.us-gov-west-1.amazonaws.com", + Protocols: []string{"http", "https"}, + }, + }, + }, +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/options.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/options.go new file mode 100644 index 000000000..048bc6c0c --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/options.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // Client registry of operation interceptors. + Interceptors smithyhttp.InterceptorRegistry + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + to.Interceptors = o.Interceptors.Copy() + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/serializers.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/serializers.go new file mode 100644 index 000000000..d504bbb1d --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/serializers.go @@ -0,0 +1,3041 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/query" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsquery_serializeOpAddTags struct { +} + +func (*awsAwsquery_serializeOpAddTags) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAddTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddTagsInput) + _ = 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("AddTags") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentAddTagsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpApplySecurityGroupsToLoadBalancer struct { +} + +func (*awsAwsquery_serializeOpApplySecurityGroupsToLoadBalancer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpApplySecurityGroupsToLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ApplySecurityGroupsToLoadBalancerInput) + _ = 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("ApplySecurityGroupsToLoadBalancer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentApplySecurityGroupsToLoadBalancerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAttachLoadBalancerToSubnets struct { +} + +func (*awsAwsquery_serializeOpAttachLoadBalancerToSubnets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAttachLoadBalancerToSubnets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AttachLoadBalancerToSubnetsInput) + _ = 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("AttachLoadBalancerToSubnets") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentAttachLoadBalancerToSubnetsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpConfigureHealthCheck struct { +} + +func (*awsAwsquery_serializeOpConfigureHealthCheck) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpConfigureHealthCheck) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ConfigureHealthCheckInput) + _ = 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("ConfigureHealthCheck") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentConfigureHealthCheckInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateAppCookieStickinessPolicy struct { +} + +func (*awsAwsquery_serializeOpCreateAppCookieStickinessPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateAppCookieStickinessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateAppCookieStickinessPolicyInput) + _ = 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("CreateAppCookieStickinessPolicy") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentCreateAppCookieStickinessPolicyInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateLBCookieStickinessPolicy struct { +} + +func (*awsAwsquery_serializeOpCreateLBCookieStickinessPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateLBCookieStickinessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLBCookieStickinessPolicyInput) + _ = 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("CreateLBCookieStickinessPolicy") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentCreateLBCookieStickinessPolicyInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateLoadBalancer struct { +} + +func (*awsAwsquery_serializeOpCreateLoadBalancer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLoadBalancerInput) + _ = 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("CreateLoadBalancer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentCreateLoadBalancerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateLoadBalancerListeners struct { +} + +func (*awsAwsquery_serializeOpCreateLoadBalancerListeners) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateLoadBalancerListeners) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLoadBalancerListenersInput) + _ = 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("CreateLoadBalancerListeners") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentCreateLoadBalancerListenersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateLoadBalancerPolicy struct { +} + +func (*awsAwsquery_serializeOpCreateLoadBalancerPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateLoadBalancerPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLoadBalancerPolicyInput) + _ = 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("CreateLoadBalancerPolicy") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentCreateLoadBalancerPolicyInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteLoadBalancer struct { +} + +func (*awsAwsquery_serializeOpDeleteLoadBalancer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteLoadBalancerInput) + _ = 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("DeleteLoadBalancer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDeleteLoadBalancerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteLoadBalancerListeners struct { +} + +func (*awsAwsquery_serializeOpDeleteLoadBalancerListeners) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteLoadBalancerListeners) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteLoadBalancerListenersInput) + _ = 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("DeleteLoadBalancerListeners") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDeleteLoadBalancerListenersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteLoadBalancerPolicy struct { +} + +func (*awsAwsquery_serializeOpDeleteLoadBalancerPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteLoadBalancerPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteLoadBalancerPolicyInput) + _ = 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("DeleteLoadBalancerPolicy") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDeleteLoadBalancerPolicyInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeregisterInstancesFromLoadBalancer struct { +} + +func (*awsAwsquery_serializeOpDeregisterInstancesFromLoadBalancer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeregisterInstancesFromLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeregisterInstancesFromLoadBalancerInput) + _ = 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("DeregisterInstancesFromLoadBalancer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDeregisterInstancesFromLoadBalancerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeAccountLimits struct { +} + +func (*awsAwsquery_serializeOpDescribeAccountLimits) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeAccountLimits) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeAccountLimitsInput) + _ = 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("DescribeAccountLimits") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDescribeAccountLimitsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeInstanceHealth struct { +} + +func (*awsAwsquery_serializeOpDescribeInstanceHealth) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeInstanceHealth) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeInstanceHealthInput) + _ = 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("DescribeInstanceHealth") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDescribeInstanceHealthInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeLoadBalancerAttributes struct { +} + +func (*awsAwsquery_serializeOpDescribeLoadBalancerAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeLoadBalancerAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeLoadBalancerAttributesInput) + _ = 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("DescribeLoadBalancerAttributes") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDescribeLoadBalancerAttributesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeLoadBalancerPolicies struct { +} + +func (*awsAwsquery_serializeOpDescribeLoadBalancerPolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeLoadBalancerPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeLoadBalancerPoliciesInput) + _ = 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("DescribeLoadBalancerPolicies") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDescribeLoadBalancerPoliciesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeLoadBalancerPolicyTypes struct { +} + +func (*awsAwsquery_serializeOpDescribeLoadBalancerPolicyTypes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeLoadBalancerPolicyTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeLoadBalancerPolicyTypesInput) + _ = 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("DescribeLoadBalancerPolicyTypes") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDescribeLoadBalancerPolicyTypesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeLoadBalancers struct { +} + +func (*awsAwsquery_serializeOpDescribeLoadBalancers) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeLoadBalancers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeLoadBalancersInput) + _ = 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("DescribeLoadBalancers") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDescribeLoadBalancersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeTags struct { +} + +func (*awsAwsquery_serializeOpDescribeTags) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeTagsInput) + _ = 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("DescribeTags") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDescribeTagsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDetachLoadBalancerFromSubnets struct { +} + +func (*awsAwsquery_serializeOpDetachLoadBalancerFromSubnets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDetachLoadBalancerFromSubnets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DetachLoadBalancerFromSubnetsInput) + _ = 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("DetachLoadBalancerFromSubnets") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDetachLoadBalancerFromSubnetsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDisableAvailabilityZonesForLoadBalancer struct { +} + +func (*awsAwsquery_serializeOpDisableAvailabilityZonesForLoadBalancer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDisableAvailabilityZonesForLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisableAvailabilityZonesForLoadBalancerInput) + _ = 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("DisableAvailabilityZonesForLoadBalancer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentDisableAvailabilityZonesForLoadBalancerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpEnableAvailabilityZonesForLoadBalancer struct { +} + +func (*awsAwsquery_serializeOpEnableAvailabilityZonesForLoadBalancer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpEnableAvailabilityZonesForLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*EnableAvailabilityZonesForLoadBalancerInput) + _ = 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("EnableAvailabilityZonesForLoadBalancer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentEnableAvailabilityZonesForLoadBalancerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyLoadBalancerAttributes struct { +} + +func (*awsAwsquery_serializeOpModifyLoadBalancerAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyLoadBalancerAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyLoadBalancerAttributesInput) + _ = 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("ModifyLoadBalancerAttributes") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentModifyLoadBalancerAttributesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRegisterInstancesWithLoadBalancer struct { +} + +func (*awsAwsquery_serializeOpRegisterInstancesWithLoadBalancer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRegisterInstancesWithLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterInstancesWithLoadBalancerInput) + _ = 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("RegisterInstancesWithLoadBalancer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentRegisterInstancesWithLoadBalancerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRemoveTags struct { +} + +func (*awsAwsquery_serializeOpRemoveTags) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRemoveTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveTagsInput) + _ = 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("RemoveTags") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentRemoveTagsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpSetLoadBalancerListenerSSLCertificate struct { +} + +func (*awsAwsquery_serializeOpSetLoadBalancerListenerSSLCertificate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetLoadBalancerListenerSSLCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetLoadBalancerListenerSSLCertificateInput) + _ = 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("SetLoadBalancerListenerSSLCertificate") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentSetLoadBalancerListenerSSLCertificateInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpSetLoadBalancerPoliciesForBackendServer struct { +} + +func (*awsAwsquery_serializeOpSetLoadBalancerPoliciesForBackendServer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetLoadBalancerPoliciesForBackendServer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetLoadBalancerPoliciesForBackendServerInput) + _ = 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("SetLoadBalancerPoliciesForBackendServer") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentSetLoadBalancerPoliciesForBackendServerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpSetLoadBalancerPoliciesOfListener struct { +} + +func (*awsAwsquery_serializeOpSetLoadBalancerPoliciesOfListener) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSetLoadBalancerPoliciesOfListener) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SetLoadBalancerPoliciesOfListenerInput) + _ = 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("SetLoadBalancerPoliciesOfListener") + body.Key("Version").String("2012-06-01") + + if err := awsAwsquery_serializeOpDocumentSetLoadBalancerPoliciesOfListenerInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsAwsquery_serializeDocumentAccessLog(v *types.AccessLog, value query.Value) error { + object := value.Object() + _ = object + + if v.EmitInterval != nil { + objectKey := object.Key("EmitInterval") + objectKey.Integer(*v.EmitInterval) + } + + { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + if v.S3BucketName != nil { + objectKey := object.Key("S3BucketName") + objectKey.String(*v.S3BucketName) + } + + if v.S3BucketPrefix != nil { + objectKey := object.Key("S3BucketPrefix") + objectKey.String(*v.S3BucketPrefix) + } + + return nil +} + +func awsAwsquery_serializeDocumentAdditionalAttribute(v *types.AdditionalAttribute, value query.Value) error { + object := value.Object() + _ = object + + if v.Key != nil { + objectKey := object.Key("Key") + objectKey.String(*v.Key) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentAdditionalAttributes(v []types.AdditionalAttribute, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentAdditionalAttribute(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentAvailabilityZones(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentConnectionDraining(v *types.ConnectionDraining, value query.Value) error { + object := value.Object() + _ = object + + { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + if v.Timeout != nil { + objectKey := object.Key("Timeout") + objectKey.Integer(*v.Timeout) + } + + return nil +} + +func awsAwsquery_serializeDocumentConnectionSettings(v *types.ConnectionSettings, value query.Value) error { + object := value.Object() + _ = object + + if v.IdleTimeout != nil { + objectKey := object.Key("IdleTimeout") + objectKey.Integer(*v.IdleTimeout) + } + + return nil +} + +func awsAwsquery_serializeDocumentCrossZoneLoadBalancing(v *types.CrossZoneLoadBalancing, value query.Value) error { + object := value.Object() + _ = object + + { + objectKey := object.Key("Enabled") + objectKey.Boolean(v.Enabled) + } + + return nil +} + +func awsAwsquery_serializeDocumentHealthCheck(v *types.HealthCheck, value query.Value) error { + object := value.Object() + _ = object + + if v.HealthyThreshold != nil { + objectKey := object.Key("HealthyThreshold") + objectKey.Integer(*v.HealthyThreshold) + } + + if v.Interval != nil { + objectKey := object.Key("Interval") + objectKey.Integer(*v.Interval) + } + + if v.Target != nil { + objectKey := object.Key("Target") + objectKey.String(*v.Target) + } + + if v.Timeout != nil { + objectKey := object.Key("Timeout") + objectKey.Integer(*v.Timeout) + } + + if v.UnhealthyThreshold != nil { + objectKey := object.Key("UnhealthyThreshold") + objectKey.Integer(*v.UnhealthyThreshold) + } + + return nil +} + +func awsAwsquery_serializeDocumentInstance(v *types.Instance, value query.Value) error { + object := value.Object() + _ = object + + if v.InstanceId != nil { + objectKey := object.Key("InstanceId") + objectKey.String(*v.InstanceId) + } + + return nil +} + +func awsAwsquery_serializeDocumentInstances(v []types.Instance, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentInstance(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentListener(v *types.Listener, value query.Value) error { + object := value.Object() + _ = object + + if v.InstancePort != nil { + objectKey := object.Key("InstancePort") + objectKey.Integer(*v.InstancePort) + } + + if v.InstanceProtocol != nil { + objectKey := object.Key("InstanceProtocol") + objectKey.String(*v.InstanceProtocol) + } + + { + objectKey := object.Key("LoadBalancerPort") + objectKey.Integer(v.LoadBalancerPort) + } + + if v.Protocol != nil { + objectKey := object.Key("Protocol") + objectKey.String(*v.Protocol) + } + + if v.SSLCertificateId != nil { + objectKey := object.Key("SSLCertificateId") + objectKey.String(*v.SSLCertificateId) + } + + return nil +} + +func awsAwsquery_serializeDocumentListeners(v []types.Listener, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentListener(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentLoadBalancerAttributes(v *types.LoadBalancerAttributes, value query.Value) error { + object := value.Object() + _ = object + + if v.AccessLog != nil { + objectKey := object.Key("AccessLog") + if err := awsAwsquery_serializeDocumentAccessLog(v.AccessLog, objectKey); err != nil { + return err + } + } + + if v.AdditionalAttributes != nil { + objectKey := object.Key("AdditionalAttributes") + if err := awsAwsquery_serializeDocumentAdditionalAttributes(v.AdditionalAttributes, objectKey); err != nil { + return err + } + } + + if v.ConnectionDraining != nil { + objectKey := object.Key("ConnectionDraining") + if err := awsAwsquery_serializeDocumentConnectionDraining(v.ConnectionDraining, objectKey); err != nil { + return err + } + } + + if v.ConnectionSettings != nil { + objectKey := object.Key("ConnectionSettings") + if err := awsAwsquery_serializeDocumentConnectionSettings(v.ConnectionSettings, objectKey); err != nil { + return err + } + } + + if v.CrossZoneLoadBalancing != nil { + objectKey := object.Key("CrossZoneLoadBalancing") + if err := awsAwsquery_serializeDocumentCrossZoneLoadBalancing(v.CrossZoneLoadBalancing, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentLoadBalancerNames(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentLoadBalancerNamesMax20(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentPolicyAttribute(v *types.PolicyAttribute, value query.Value) error { + object := value.Object() + _ = object + + if v.AttributeName != nil { + objectKey := object.Key("AttributeName") + objectKey.String(*v.AttributeName) + } + + if v.AttributeValue != nil { + objectKey := object.Key("AttributeValue") + objectKey.String(*v.AttributeValue) + } + + return nil +} + +func awsAwsquery_serializeDocumentPolicyAttributes(v []types.PolicyAttribute, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentPolicyAttribute(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentPolicyNames(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentPolicyTypeNames(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentPorts(v []int32, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.Integer(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentSecurityGroups(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentSubnets(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error { + object := value.Object() + _ = object + + if v.Key != nil { + objectKey := object.Key("Key") + objectKey.String(*v.Key) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentTagKeyList(v []types.TagKeyOnly, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentTagKeyOnly(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentTagKeyOnly(v *types.TagKeyOnly, value query.Value) error { + object := value.Object() + _ = object + + if v.Key != nil { + objectKey := object.Key("Key") + objectKey.String(*v.Key) + } + + return nil +} + +func awsAwsquery_serializeDocumentTagList(v []types.Tag, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeOpDocumentAddTagsInput(v *AddTagsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerNames != nil { + objectKey := object.Key("LoadBalancerNames") + if err := awsAwsquery_serializeDocumentLoadBalancerNames(v.LoadBalancerNames, objectKey); err != nil { + return err + } + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentApplySecurityGroupsToLoadBalancerInput(v *ApplySecurityGroupsToLoadBalancerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.SecurityGroups != nil { + objectKey := object.Key("SecurityGroups") + if err := awsAwsquery_serializeDocumentSecurityGroups(v.SecurityGroups, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAttachLoadBalancerToSubnetsInput(v *AttachLoadBalancerToSubnetsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.Subnets != nil { + objectKey := object.Key("Subnets") + if err := awsAwsquery_serializeDocumentSubnets(v.Subnets, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentConfigureHealthCheckInput(v *ConfigureHealthCheckInput, value query.Value) error { + object := value.Object() + _ = object + + if v.HealthCheck != nil { + objectKey := object.Key("HealthCheck") + if err := awsAwsquery_serializeDocumentHealthCheck(v.HealthCheck, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateAppCookieStickinessPolicyInput(v *CreateAppCookieStickinessPolicyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CookieName != nil { + objectKey := object.Key("CookieName") + objectKey.String(*v.CookieName) + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.PolicyName != nil { + objectKey := object.Key("PolicyName") + objectKey.String(*v.PolicyName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateLBCookieStickinessPolicyInput(v *CreateLBCookieStickinessPolicyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CookieExpirationPeriod != nil { + objectKey := object.Key("CookieExpirationPeriod") + objectKey.Long(*v.CookieExpirationPeriod) + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.PolicyName != nil { + objectKey := object.Key("PolicyName") + objectKey.String(*v.PolicyName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateLoadBalancerInput(v *CreateLoadBalancerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AvailabilityZones != nil { + objectKey := object.Key("AvailabilityZones") + if err := awsAwsquery_serializeDocumentAvailabilityZones(v.AvailabilityZones, objectKey); err != nil { + return err + } + } + + if v.Listeners != nil { + objectKey := object.Key("Listeners") + if err := awsAwsquery_serializeDocumentListeners(v.Listeners, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.Scheme != nil { + objectKey := object.Key("Scheme") + objectKey.String(*v.Scheme) + } + + if v.SecurityGroups != nil { + objectKey := object.Key("SecurityGroups") + if err := awsAwsquery_serializeDocumentSecurityGroups(v.SecurityGroups, objectKey); err != nil { + return err + } + } + + if v.Subnets != nil { + objectKey := object.Key("Subnets") + if err := awsAwsquery_serializeDocumentSubnets(v.Subnets, objectKey); err != nil { + return err + } + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateLoadBalancerListenersInput(v *CreateLoadBalancerListenersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Listeners != nil { + objectKey := object.Key("Listeners") + if err := awsAwsquery_serializeDocumentListeners(v.Listeners, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateLoadBalancerPolicyInput(v *CreateLoadBalancerPolicyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.PolicyAttributes != nil { + objectKey := object.Key("PolicyAttributes") + if err := awsAwsquery_serializeDocumentPolicyAttributes(v.PolicyAttributes, objectKey); err != nil { + return err + } + } + + if v.PolicyName != nil { + objectKey := object.Key("PolicyName") + objectKey.String(*v.PolicyName) + } + + if v.PolicyTypeName != nil { + objectKey := object.Key("PolicyTypeName") + objectKey.String(*v.PolicyTypeName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteLoadBalancerInput(v *DeleteLoadBalancerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteLoadBalancerListenersInput(v *DeleteLoadBalancerListenersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.LoadBalancerPorts != nil { + objectKey := object.Key("LoadBalancerPorts") + if err := awsAwsquery_serializeDocumentPorts(v.LoadBalancerPorts, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteLoadBalancerPolicyInput(v *DeleteLoadBalancerPolicyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.PolicyName != nil { + objectKey := object.Key("PolicyName") + objectKey.String(*v.PolicyName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeregisterInstancesFromLoadBalancerInput(v *DeregisterInstancesFromLoadBalancerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Instances != nil { + objectKey := object.Key("Instances") + if err := awsAwsquery_serializeDocumentInstances(v.Instances, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeAccountLimitsInput(v *DescribeAccountLimitsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.PageSize != nil { + objectKey := object.Key("PageSize") + objectKey.Integer(*v.PageSize) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeInstanceHealthInput(v *DescribeInstanceHealthInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Instances != nil { + objectKey := object.Key("Instances") + if err := awsAwsquery_serializeDocumentInstances(v.Instances, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeLoadBalancerAttributesInput(v *DescribeLoadBalancerAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeLoadBalancerPoliciesInput(v *DescribeLoadBalancerPoliciesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.PolicyNames != nil { + objectKey := object.Key("PolicyNames") + if err := awsAwsquery_serializeDocumentPolicyNames(v.PolicyNames, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeLoadBalancerPolicyTypesInput(v *DescribeLoadBalancerPolicyTypesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.PolicyTypeNames != nil { + objectKey := object.Key("PolicyTypeNames") + if err := awsAwsquery_serializeDocumentPolicyTypeNames(v.PolicyTypeNames, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeLoadBalancersInput(v *DescribeLoadBalancersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerNames != nil { + objectKey := object.Key("LoadBalancerNames") + if err := awsAwsquery_serializeDocumentLoadBalancerNames(v.LoadBalancerNames, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.PageSize != nil { + objectKey := object.Key("PageSize") + objectKey.Integer(*v.PageSize) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeTagsInput(v *DescribeTagsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerNames != nil { + objectKey := object.Key("LoadBalancerNames") + if err := awsAwsquery_serializeDocumentLoadBalancerNamesMax20(v.LoadBalancerNames, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDetachLoadBalancerFromSubnetsInput(v *DetachLoadBalancerFromSubnetsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.Subnets != nil { + objectKey := object.Key("Subnets") + if err := awsAwsquery_serializeDocumentSubnets(v.Subnets, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDisableAvailabilityZonesForLoadBalancerInput(v *DisableAvailabilityZonesForLoadBalancerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AvailabilityZones != nil { + objectKey := object.Key("AvailabilityZones") + if err := awsAwsquery_serializeDocumentAvailabilityZones(v.AvailabilityZones, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentEnableAvailabilityZonesForLoadBalancerInput(v *EnableAvailabilityZonesForLoadBalancerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AvailabilityZones != nil { + objectKey := object.Key("AvailabilityZones") + if err := awsAwsquery_serializeDocumentAvailabilityZones(v.AvailabilityZones, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyLoadBalancerAttributesInput(v *ModifyLoadBalancerAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerAttributes != nil { + objectKey := object.Key("LoadBalancerAttributes") + if err := awsAwsquery_serializeDocumentLoadBalancerAttributes(v.LoadBalancerAttributes, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRegisterInstancesWithLoadBalancerInput(v *RegisterInstancesWithLoadBalancerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Instances != nil { + objectKey := object.Key("Instances") + if err := awsAwsquery_serializeDocumentInstances(v.Instances, objectKey); err != nil { + return err + } + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRemoveTagsInput(v *RemoveTagsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerNames != nil { + objectKey := object.Key("LoadBalancerNames") + if err := awsAwsquery_serializeDocumentLoadBalancerNames(v.LoadBalancerNames, objectKey); err != nil { + return err + } + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagKeyList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetLoadBalancerListenerSSLCertificateInput(v *SetLoadBalancerListenerSSLCertificateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + { + objectKey := object.Key("LoadBalancerPort") + objectKey.Integer(v.LoadBalancerPort) + } + + if v.SSLCertificateId != nil { + objectKey := object.Key("SSLCertificateId") + objectKey.String(*v.SSLCertificateId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetLoadBalancerPoliciesForBackendServerInput(v *SetLoadBalancerPoliciesForBackendServerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.InstancePort != nil { + objectKey := object.Key("InstancePort") + objectKey.Integer(*v.InstancePort) + } + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + if v.PolicyNames != nil { + objectKey := object.Key("PolicyNames") + if err := awsAwsquery_serializeDocumentPolicyNames(v.PolicyNames, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSetLoadBalancerPoliciesOfListenerInput(v *SetLoadBalancerPoliciesOfListenerInput, value query.Value) error { + object := value.Object() + _ = object + + if v.LoadBalancerName != nil { + objectKey := object.Key("LoadBalancerName") + objectKey.String(*v.LoadBalancerName) + } + + { + objectKey := object.Key("LoadBalancerPort") + objectKey.Integer(v.LoadBalancerPort) + } + + if v.PolicyNames != nil { + objectKey := object.Key("PolicyNames") + if err := awsAwsquery_serializeDocumentPolicyNames(v.PolicyNames, objectKey); err != nil { + return err + } + } + + return nil +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types/errors.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types/errors.go new file mode 100644 index 000000000..d0c82d4db --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types/errors.go @@ -0,0 +1,591 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The specified load balancer does not exist. +type AccessPointNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessPointNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessPointNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessPointNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "LoadBalancerNotFound" + } + return *e.ErrorCodeOverride +} +func (e *AccessPointNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified ARN does not refer to a valid SSL certificate in AWS Identity and +// Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you +// recently uploaded the certificate to IAM, this error might indicate that the +// certificate is not fully available yet. +type CertificateNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CertificateNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CertificateNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CertificateNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CertificateNotFound" + } + return *e.ErrorCodeOverride +} +func (e *CertificateNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A request made by Elastic Load Balancing to another service exceeds the maximum +// request rate permitted for your account. +type DependencyThrottleException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DependencyThrottleException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DependencyThrottleException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DependencyThrottleException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DependencyThrottle" + } + return *e.ErrorCodeOverride +} +func (e *DependencyThrottleException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified load balancer name already exists for this account. +type DuplicateAccessPointNameException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DuplicateAccessPointNameException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DuplicateAccessPointNameException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DuplicateAccessPointNameException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicateLoadBalancerName" + } + return *e.ErrorCodeOverride +} +func (e *DuplicateAccessPointNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A listener already exists for the specified load balancer name and port, but +// with a different instance port, protocol, or SSL certificate. +type DuplicateListenerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DuplicateListenerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DuplicateListenerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DuplicateListenerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicateListener" + } + return *e.ErrorCodeOverride +} +func (e *DuplicateListenerException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A policy with the specified name already exists for this load balancer. +type DuplicatePolicyNameException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DuplicatePolicyNameException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DuplicatePolicyNameException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DuplicatePolicyNameException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicatePolicyName" + } + return *e.ErrorCodeOverride +} +func (e *DuplicatePolicyNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A tag key was specified more than once. +type DuplicateTagKeysException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DuplicateTagKeysException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DuplicateTagKeysException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DuplicateTagKeysException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicateTagKeys" + } + return *e.ErrorCodeOverride +} +func (e *DuplicateTagKeysException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested configuration change is not valid. +type InvalidConfigurationRequestException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidConfigurationRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidConfigurationRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidConfigurationRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidConfigurationRequest" + } + return *e.ErrorCodeOverride +} +func (e *InvalidConfigurationRequestException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified endpoint is not valid. +type InvalidEndPointException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidEndPointException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidEndPointException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidEndPointException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidInstance" + } + return *e.ErrorCodeOverride +} +func (e *InvalidEndPointException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified value for the schema is not valid. You can only specify a scheme +// for load balancers in a VPC. +type InvalidSchemeException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidSchemeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSchemeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSchemeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidScheme" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSchemeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// One or more of the specified security groups do not exist. +type InvalidSecurityGroupException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidSecurityGroupException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSecurityGroupException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSecurityGroupException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSecurityGroup" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSecurityGroupException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified VPC has no associated Internet gateway. +type InvalidSubnetException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidSubnetException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSubnetException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSubnetException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSubnet" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSubnetException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The load balancer does not have a listener configured at the specified port. +type ListenerNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ListenerNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ListenerNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ListenerNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ListenerNotFound" + } + return *e.ErrorCodeOverride +} +func (e *ListenerNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified load balancer attribute does not exist. +type LoadBalancerAttributeNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *LoadBalancerAttributeNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *LoadBalancerAttributeNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *LoadBalancerAttributeNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "LoadBalancerAttributeNotFound" + } + return *e.ErrorCodeOverride +} +func (e *LoadBalancerAttributeNotFoundException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// This operation is not allowed. +type OperationNotPermittedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OperationNotPermittedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OperationNotPermittedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OperationNotPermittedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OperationNotPermitted" + } + return *e.ErrorCodeOverride +} +func (e *OperationNotPermittedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// One or more of the specified policies do not exist. +type PolicyNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *PolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PolicyNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PolicyNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PolicyNotFound" + } + return *e.ErrorCodeOverride +} +func (e *PolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// One or more of the specified policy types do not exist. +type PolicyTypeNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *PolicyTypeNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PolicyTypeNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PolicyTypeNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PolicyTypeNotFound" + } + return *e.ErrorCodeOverride +} +func (e *PolicyTypeNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// One or more of the specified subnets do not exist. +type SubnetNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SubnetNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SubnetNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SubnetNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SubnetNotFound" + } + return *e.ErrorCodeOverride +} +func (e *SubnetNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The quota for the number of load balancers has been reached. +type TooManyAccessPointsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyAccessPointsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyAccessPointsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyAccessPointsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyLoadBalancers" + } + return *e.ErrorCodeOverride +} +func (e *TooManyAccessPointsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The quota for the number of policies for this load balancer has been reached. +type TooManyPoliciesException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyPoliciesException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyPoliciesException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyPoliciesException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyPolicies" + } + return *e.ErrorCodeOverride +} +func (e *TooManyPoliciesException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The quota for the number of tags that can be assigned to a load balancer has +// been reached. +type TooManyTagsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyTagsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyTagsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyTags" + } + return *e.ErrorCodeOverride +} +func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified protocol or signature version is not supported. +type UnsupportedProtocolException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedProtocolException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedProtocolException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedProtocolException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedProtocol" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedProtocolException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types/types.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types/types.go new file mode 100644 index 000000000..0c6472247 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types/types.go @@ -0,0 +1,579 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Information about the AccessLog attribute. +type AccessLog struct { + + // Specifies whether access logs are enabled for the load balancer. + // + // This member is required. + Enabled bool + + // The interval for publishing the access logs. You can specify an interval of + // either 5 minutes or 60 minutes. + // + // Default: 60 minutes + EmitInterval *int32 + + // The name of the Amazon S3 bucket where the access logs are stored. + S3BucketName *string + + // The logical hierarchy you created for your Amazon S3 bucket, for example + // my-bucket-prefix/prod . If the prefix is not provided, the log is placed at the + // root level of the bucket. + S3BucketPrefix *string + + noSmithyDocumentSerde +} + +// Information about additional load balancer attributes. +type AdditionalAttribute struct { + + // The name of the attribute. + // + // The following attribute is supported. + // + // - elb.http.desyncmitigationmode - Determines how the load balancer handles + // requests that might pose a security risk to your application. The possible + // values are monitor , defensive , and strictest . The default is defensive . + Key *string + + // This value of the attribute. + Value *string + + noSmithyDocumentSerde +} + +// Information about a policy for application-controlled session stickiness. +type AppCookieStickinessPolicy struct { + + // The name of the application cookie used for stickiness. + CookieName *string + + // The mnemonic name for the policy being created. The name must be unique within + // a set of policies for this load balancer. + PolicyName *string + + noSmithyDocumentSerde +} + +// Information about the configuration of an EC2 instance. +type BackendServerDescription struct { + + // The port on which the EC2 instance is listening. + InstancePort *int32 + + // The names of the policies enabled for the EC2 instance. + PolicyNames []string + + noSmithyDocumentSerde +} + +// Information about the ConnectionDraining attribute. +type ConnectionDraining struct { + + // Specifies whether connection draining is enabled for the load balancer. + // + // This member is required. + Enabled bool + + // The maximum time, in seconds, to keep the existing connections open before + // deregistering the instances. + Timeout *int32 + + noSmithyDocumentSerde +} + +// Information about the ConnectionSettings attribute. +type ConnectionSettings struct { + + // The time, in seconds, that the connection is allowed to be idle (no data has + // been sent over the connection) before it is closed by the load balancer. + // + // This member is required. + IdleTimeout *int32 + + noSmithyDocumentSerde +} + +// Information about the CrossZoneLoadBalancing attribute. +type CrossZoneLoadBalancing struct { + + // Specifies whether cross-zone load balancing is enabled for the load balancer. + // + // This member is required. + Enabled bool + + noSmithyDocumentSerde +} + +// Information about a health check. +type HealthCheck struct { + + // The number of consecutive health checks successes required before moving the + // instance to the Healthy state. + // + // This member is required. + HealthyThreshold *int32 + + // The approximate interval, in seconds, between health checks of an individual + // instance. + // + // This member is required. + Interval *int32 + + // The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. + // The range of valid ports is one (1) through 65535. + // + // TCP is the default, specified as a TCP: port pair, for example "TCP:5000". In + // this case, a health check simply attempts to open a TCP connection to the + // instance on the specified port. Failure to connect within the configured timeout + // is considered unhealthy. + // + // SSL is also specified as SSL: port pair, for example, SSL:5000. + // + // For HTTP/HTTPS, you must include a ping path in the string. HTTP is specified + // as a HTTP:port;/;PathToPing; grouping, for example + // "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to + // the instance on the given port and path. Any answer other than "200 OK" within + // the timeout period is considered unhealthy. + // + // The total length of the HTTP ping target must be 1024 16-bit Unicode characters + // or less. + // + // This member is required. + Target *string + + // The amount of time, in seconds, during which no response means a failed health + // check. + // + // This value must be less than the Interval value. + // + // This member is required. + Timeout *int32 + + // The number of consecutive health check failures required before moving the + // instance to the Unhealthy state. + // + // This member is required. + UnhealthyThreshold *int32 + + noSmithyDocumentSerde +} + +// The ID of an EC2 instance. +type Instance struct { + + // The instance ID. + InstanceId *string + + noSmithyDocumentSerde +} + +// Information about the state of an EC2 instance. +type InstanceState struct { + + // A description of the instance state. This string can contain one or more of the + // following messages. + // + // - N/A + // + // - A transient error occurred. Please try again later. + // + // - Instance has failed at least the UnhealthyThreshold number of health checks + // consecutively. + // + // - Instance has not passed the configured HealthyThreshold number of health + // checks consecutively. + // + // - Instance registration is still in progress. + // + // - Instance is in the EC2 Availability Zone for which LoadBalancer is not + // configured to route traffic to. + // + // - Instance is not currently registered with the LoadBalancer. + // + // - Instance deregistration currently in progress. + // + // - Disable Availability Zone is currently in progress. + // + // - Instance is in pending state. + // + // - Instance is in stopped state. + // + // - Instance is in terminated state. + Description *string + + // The ID of the instance. + InstanceId *string + + // Information about the cause of OutOfService instances. Specifically, whether + // the cause is Elastic Load Balancing or the instance. + // + // Valid values: ELB | Instance | N/A + ReasonCode *string + + // The current state of the instance. + // + // Valid values: InService | OutOfService | Unknown + State *string + + noSmithyDocumentSerde +} + +// Information about a policy for duration-based session stickiness. +type LBCookieStickinessPolicy struct { + + // The time period, in seconds, after which the cookie should be considered stale. + // If this parameter is not specified, the stickiness session lasts for the + // duration of the browser session. + CookieExpirationPeriod *int64 + + // The name of the policy. This name must be unique within the set of policies for + // this load balancer. + PolicyName *string + + noSmithyDocumentSerde +} + +// Information about an Elastic Load Balancing resource limit for your AWS account. +type Limit struct { + + // The maximum value of the limit. + Max *string + + // The name of the limit. The possible values are: + // + // - classic-listeners + // + // - classic-load-balancers + // + // - classic-registered-instances + Name *string + + noSmithyDocumentSerde +} + +// Information about a listener. +// +// For information about the protocols and the ports supported by Elastic Load +// Balancing, see [Listeners for Your Classic Load Balancer]in the Classic Load Balancers Guide. +// +// [Listeners for Your Classic Load Balancer]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html +type Listener struct { + + // The port on which the instance is listening. + // + // This member is required. + InstancePort *int32 + + // The port on which the load balancer is listening. On EC2-VPC, you can specify + // any port from the range 1-65535. On EC2-Classic, you can specify any port from + // the following list: 25, 80, 443, 465, 587, 1024-65535. + // + // This member is required. + LoadBalancerPort int32 + + // The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or + // SSL. + // + // This member is required. + Protocol *string + + // The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or SSL. + // + // If the front-end protocol is TCP or SSL, the back-end protocol must be TCP or + // SSL. If the front-end protocol is HTTP or HTTPS, the back-end protocol must be + // HTTP or HTTPS. + // + // If there is another listener with the same InstancePort whose InstanceProtocol + // is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure. + // + // If there is another listener with the same InstancePort whose InstanceProtocol + // is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP. + InstanceProtocol *string + + // The Amazon Resource Name (ARN) of the server certificate. + SSLCertificateId *string + + noSmithyDocumentSerde +} + +// The policies enabled for a listener. +type ListenerDescription struct { + + // The listener. + Listener *Listener + + // The policies. If there are no policies enabled, the list is empty. + PolicyNames []string + + noSmithyDocumentSerde +} + +// The attributes for a load balancer. +type LoadBalancerAttributes struct { + + // If enabled, the load balancer captures detailed information of all requests and + // delivers the information to the Amazon S3 bucket that you specify. + // + // For more information, see [Enable Access Logs] in the Classic Load Balancers Guide. + // + // [Enable Access Logs]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html + AccessLog *AccessLog + + // Any additional attributes. + AdditionalAttributes []AdditionalAttribute + + // If enabled, the load balancer allows existing requests to complete before the + // load balancer shifts traffic away from a deregistered or unhealthy instance. + // + // For more information, see [Configure Connection Draining] in the Classic Load Balancers Guide. + // + // [Configure Connection Draining]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html + ConnectionDraining *ConnectionDraining + + // If enabled, the load balancer allows the connections to remain idle (no data is + // sent over the connection) for the specified duration. + // + // By default, Elastic Load Balancing maintains a 60-second idle connection + // timeout for both front-end and back-end connections of your load balancer. For + // more information, see [Configure Idle Connection Timeout]in the Classic Load Balancers Guide. + // + // [Configure Idle Connection Timeout]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html + ConnectionSettings *ConnectionSettings + + // If enabled, the load balancer routes the request traffic evenly across all + // instances regardless of the Availability Zones. + // + // For more information, see [Configure Cross-Zone Load Balancing] in the Classic Load Balancers Guide. + // + // [Configure Cross-Zone Load Balancing]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html + CrossZoneLoadBalancing *CrossZoneLoadBalancing + + noSmithyDocumentSerde +} + +// Information about a load balancer. +type LoadBalancerDescription struct { + + // The Availability Zones for the load balancer. + AvailabilityZones []string + + // Information about your EC2 instances. + BackendServerDescriptions []BackendServerDescription + + // The DNS name of the load balancer. + // + // For more information, see [Configure a Custom Domain Name] in the Classic Load Balancers Guide. + // + // [Configure a Custom Domain Name]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html + CanonicalHostedZoneName *string + + // The ID of the Amazon Route 53 hosted zone for the load balancer. + CanonicalHostedZoneNameID *string + + // The date and time the load balancer was created. + CreatedTime *time.Time + + // The DNS name of the load balancer. + DNSName *string + + // Information about the health checks conducted on the load balancer. + HealthCheck *HealthCheck + + // The IDs of the instances for the load balancer. + Instances []Instance + + // The listeners for the load balancer. + ListenerDescriptions []ListenerDescription + + // The name of the load balancer. + LoadBalancerName *string + + // The policies defined for the load balancer. + Policies *Policies + + // The type of load balancer. Valid only for load balancers in a VPC. + // + // If Scheme is internet-facing , the load balancer has a public DNS name that + // resolves to a public IP address. + // + // If Scheme is internal , the load balancer has a public DNS name that resolves to + // a private IP address. + Scheme *string + + // The security groups for the load balancer. Valid only for load balancers in a + // VPC. + SecurityGroups []string + + // The security group for the load balancer, which you can use as part of your + // inbound rules for your registered instances. To only allow traffic from load + // balancers, add a security group rule that specifies this source security group + // as the inbound source. + SourceSecurityGroup *SourceSecurityGroup + + // The IDs of the subnets for the load balancer. + Subnets []string + + // The ID of the VPC for the load balancer. + VPCId *string + + noSmithyDocumentSerde +} + +// The policies for a load balancer. +type Policies struct { + + // The stickiness policies created using CreateAppCookieStickinessPolicy. + AppCookieStickinessPolicies []AppCookieStickinessPolicy + + // The stickiness policies created using CreateLBCookieStickinessPolicy. + LBCookieStickinessPolicies []LBCookieStickinessPolicy + + // The policies other than the stickiness policies. + OtherPolicies []string + + noSmithyDocumentSerde +} + +// Information about a policy attribute. +type PolicyAttribute struct { + + // The name of the attribute. + AttributeName *string + + // The value of the attribute. + AttributeValue *string + + noSmithyDocumentSerde +} + +// Information about a policy attribute. +type PolicyAttributeDescription struct { + + // The name of the attribute. + AttributeName *string + + // The value of the attribute. + AttributeValue *string + + noSmithyDocumentSerde +} + +// Information about a policy attribute type. +type PolicyAttributeTypeDescription struct { + + // The name of the attribute. + AttributeName *string + + // The type of the attribute. For example, Boolean or Integer . + AttributeType *string + + // The cardinality of the attribute. + // + // Valid values: + // + // - ONE(1) : Single value required + // + // - ZERO_OR_ONE(0..1) : Up to one value is allowed + // + // - ZERO_OR_MORE(0..*) : Optional. Multiple values are allowed + // + // - ONE_OR_MORE(1..*0) : Required. Multiple values are allowed + Cardinality *string + + // The default value of the attribute, if applicable. + DefaultValue *string + + // A description of the attribute. + Description *string + + noSmithyDocumentSerde +} + +// Information about a policy. +type PolicyDescription struct { + + // The policy attributes. + PolicyAttributeDescriptions []PolicyAttributeDescription + + // The name of the policy. + PolicyName *string + + // The name of the policy type. + PolicyTypeName *string + + noSmithyDocumentSerde +} + +// Information about a policy type. +type PolicyTypeDescription struct { + + // A description of the policy type. + Description *string + + // The description of the policy attributes associated with the policies defined + // by Elastic Load Balancing. + PolicyAttributeTypeDescriptions []PolicyAttributeTypeDescription + + // The name of the policy type. + PolicyTypeName *string + + noSmithyDocumentSerde +} + +// Information about a source security group. +type SourceSecurityGroup struct { + + // The name of the security group. + GroupName *string + + // The owner of the security group. + OwnerAlias *string + + noSmithyDocumentSerde +} + +// Information about a tag. +type Tag struct { + + // The key of the tag. + // + // This member is required. + Key *string + + // The value of the tag. + Value *string + + noSmithyDocumentSerde +} + +// The tags associated with a load balancer. +type TagDescription struct { + + // The name of the load balancer. + LoadBalancerName *string + + // The tags. + Tags []Tag + + noSmithyDocumentSerde +} + +// The key of a tag. +type TagKeyOnly struct { + + // The name of the key. + Key *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/validators.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/validators.go new file mode 100644 index 000000000..8997c82e0 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/validators.go @@ -0,0 +1,1260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAddTags struct { +} + +func (*validateOpAddTags) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddTagsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddTagsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpApplySecurityGroupsToLoadBalancer struct { +} + +func (*validateOpApplySecurityGroupsToLoadBalancer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpApplySecurityGroupsToLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ApplySecurityGroupsToLoadBalancerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpApplySecurityGroupsToLoadBalancerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAttachLoadBalancerToSubnets struct { +} + +func (*validateOpAttachLoadBalancerToSubnets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAttachLoadBalancerToSubnets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AttachLoadBalancerToSubnetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAttachLoadBalancerToSubnetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpConfigureHealthCheck struct { +} + +func (*validateOpConfigureHealthCheck) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpConfigureHealthCheck) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ConfigureHealthCheckInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpConfigureHealthCheckInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAppCookieStickinessPolicy struct { +} + +func (*validateOpCreateAppCookieStickinessPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAppCookieStickinessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAppCookieStickinessPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAppCookieStickinessPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateLBCookieStickinessPolicy struct { +} + +func (*validateOpCreateLBCookieStickinessPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLBCookieStickinessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLBCookieStickinessPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLBCookieStickinessPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateLoadBalancer struct { +} + +func (*validateOpCreateLoadBalancer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLoadBalancerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLoadBalancerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateLoadBalancerListeners struct { +} + +func (*validateOpCreateLoadBalancerListeners) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLoadBalancerListeners) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLoadBalancerListenersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLoadBalancerListenersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateLoadBalancerPolicy struct { +} + +func (*validateOpCreateLoadBalancerPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLoadBalancerPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLoadBalancerPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLoadBalancerPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteLoadBalancer struct { +} + +func (*validateOpDeleteLoadBalancer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLoadBalancerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLoadBalancerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteLoadBalancerListeners struct { +} + +func (*validateOpDeleteLoadBalancerListeners) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLoadBalancerListeners) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLoadBalancerListenersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLoadBalancerListenersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteLoadBalancerPolicy struct { +} + +func (*validateOpDeleteLoadBalancerPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLoadBalancerPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLoadBalancerPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLoadBalancerPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeregisterInstancesFromLoadBalancer struct { +} + +func (*validateOpDeregisterInstancesFromLoadBalancer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterInstancesFromLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterInstancesFromLoadBalancerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterInstancesFromLoadBalancerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeInstanceHealth struct { +} + +func (*validateOpDescribeInstanceHealth) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeInstanceHealth) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeInstanceHealthInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeInstanceHealthInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeLoadBalancerAttributes struct { +} + +func (*validateOpDescribeLoadBalancerAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeLoadBalancerAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeLoadBalancerAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeLoadBalancerAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeTags struct { +} + +func (*validateOpDescribeTags) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeTagsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeTagsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDetachLoadBalancerFromSubnets struct { +} + +func (*validateOpDetachLoadBalancerFromSubnets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDetachLoadBalancerFromSubnets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DetachLoadBalancerFromSubnetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDetachLoadBalancerFromSubnetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisableAvailabilityZonesForLoadBalancer struct { +} + +func (*validateOpDisableAvailabilityZonesForLoadBalancer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisableAvailabilityZonesForLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisableAvailabilityZonesForLoadBalancerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisableAvailabilityZonesForLoadBalancerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpEnableAvailabilityZonesForLoadBalancer struct { +} + +func (*validateOpEnableAvailabilityZonesForLoadBalancer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEnableAvailabilityZonesForLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EnableAvailabilityZonesForLoadBalancerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEnableAvailabilityZonesForLoadBalancerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyLoadBalancerAttributes struct { +} + +func (*validateOpModifyLoadBalancerAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyLoadBalancerAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyLoadBalancerAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyLoadBalancerAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterInstancesWithLoadBalancer struct { +} + +func (*validateOpRegisterInstancesWithLoadBalancer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterInstancesWithLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterInstancesWithLoadBalancerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterInstancesWithLoadBalancerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRemoveTags struct { +} + +func (*validateOpRemoveTags) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveTagsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveTagsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetLoadBalancerListenerSSLCertificate struct { +} + +func (*validateOpSetLoadBalancerListenerSSLCertificate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetLoadBalancerListenerSSLCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetLoadBalancerListenerSSLCertificateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetLoadBalancerListenerSSLCertificateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetLoadBalancerPoliciesForBackendServer struct { +} + +func (*validateOpSetLoadBalancerPoliciesForBackendServer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetLoadBalancerPoliciesForBackendServer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetLoadBalancerPoliciesForBackendServerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetLoadBalancerPoliciesForBackendServerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSetLoadBalancerPoliciesOfListener struct { +} + +func (*validateOpSetLoadBalancerPoliciesOfListener) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSetLoadBalancerPoliciesOfListener) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SetLoadBalancerPoliciesOfListenerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSetLoadBalancerPoliciesOfListenerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAddTagsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddTags{}, middleware.After) +} + +func addOpApplySecurityGroupsToLoadBalancerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpApplySecurityGroupsToLoadBalancer{}, middleware.After) +} + +func addOpAttachLoadBalancerToSubnetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAttachLoadBalancerToSubnets{}, middleware.After) +} + +func addOpConfigureHealthCheckValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpConfigureHealthCheck{}, middleware.After) +} + +func addOpCreateAppCookieStickinessPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAppCookieStickinessPolicy{}, middleware.After) +} + +func addOpCreateLBCookieStickinessPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLBCookieStickinessPolicy{}, middleware.After) +} + +func addOpCreateLoadBalancerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLoadBalancer{}, middleware.After) +} + +func addOpCreateLoadBalancerListenersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLoadBalancerListeners{}, middleware.After) +} + +func addOpCreateLoadBalancerPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLoadBalancerPolicy{}, middleware.After) +} + +func addOpDeleteLoadBalancerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLoadBalancer{}, middleware.After) +} + +func addOpDeleteLoadBalancerListenersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLoadBalancerListeners{}, middleware.After) +} + +func addOpDeleteLoadBalancerPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLoadBalancerPolicy{}, middleware.After) +} + +func addOpDeregisterInstancesFromLoadBalancerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterInstancesFromLoadBalancer{}, middleware.After) +} + +func addOpDescribeInstanceHealthValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeInstanceHealth{}, middleware.After) +} + +func addOpDescribeLoadBalancerAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeLoadBalancerAttributes{}, middleware.After) +} + +func addOpDescribeTagsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeTags{}, middleware.After) +} + +func addOpDetachLoadBalancerFromSubnetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDetachLoadBalancerFromSubnets{}, middleware.After) +} + +func addOpDisableAvailabilityZonesForLoadBalancerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisableAvailabilityZonesForLoadBalancer{}, middleware.After) +} + +func addOpEnableAvailabilityZonesForLoadBalancerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEnableAvailabilityZonesForLoadBalancer{}, middleware.After) +} + +func addOpModifyLoadBalancerAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyLoadBalancerAttributes{}, middleware.After) +} + +func addOpRegisterInstancesWithLoadBalancerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterInstancesWithLoadBalancer{}, middleware.After) +} + +func addOpRemoveTagsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveTags{}, middleware.After) +} + +func addOpSetLoadBalancerListenerSSLCertificateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetLoadBalancerListenerSSLCertificate{}, middleware.After) +} + +func addOpSetLoadBalancerPoliciesForBackendServerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetLoadBalancerPoliciesForBackendServer{}, middleware.After) +} + +func addOpSetLoadBalancerPoliciesOfListenerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSetLoadBalancerPoliciesOfListener{}, middleware.After) +} + +func validateAccessLog(v *types.AccessLog) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AccessLog"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConnectionDraining(v *types.ConnectionDraining) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConnectionDraining"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConnectionSettings(v *types.ConnectionSettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConnectionSettings"} + if v.IdleTimeout == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdleTimeout")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCrossZoneLoadBalancing(v *types.CrossZoneLoadBalancing) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CrossZoneLoadBalancing"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateHealthCheck(v *types.HealthCheck) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "HealthCheck"} + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } + if v.Interval == nil { + invalidParams.Add(smithy.NewErrParamRequired("Interval")) + } + if v.Timeout == nil { + invalidParams.Add(smithy.NewErrParamRequired("Timeout")) + } + if v.UnhealthyThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("UnhealthyThreshold")) + } + if v.HealthyThreshold == nil { + invalidParams.Add(smithy.NewErrParamRequired("HealthyThreshold")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateListener(v *types.Listener) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Listener"} + if v.Protocol == nil { + invalidParams.Add(smithy.NewErrParamRequired("Protocol")) + } + if v.InstancePort == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstancePort")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateListeners(v []types.Listener) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Listeners"} + for i := range v { + if err := validateListener(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLoadBalancerAttributes(v *types.LoadBalancerAttributes) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LoadBalancerAttributes"} + if v.CrossZoneLoadBalancing != nil { + if err := validateCrossZoneLoadBalancing(v.CrossZoneLoadBalancing); err != nil { + invalidParams.AddNested("CrossZoneLoadBalancing", err.(smithy.InvalidParamsError)) + } + } + if v.AccessLog != nil { + if err := validateAccessLog(v.AccessLog); err != nil { + invalidParams.AddNested("AccessLog", err.(smithy.InvalidParamsError)) + } + } + if v.ConnectionDraining != nil { + if err := validateConnectionDraining(v.ConnectionDraining); err != nil { + invalidParams.AddNested("ConnectionDraining", err.(smithy.InvalidParamsError)) + } + } + if v.ConnectionSettings != nil { + if err := validateConnectionSettings(v.ConnectionSettings); err != nil { + invalidParams.AddNested("ConnectionSettings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagList(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagList"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAddTagsInput(v *AddTagsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddTagsInput"} + if v.LoadBalancerNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerNames")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } else if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpApplySecurityGroupsToLoadBalancerInput(v *ApplySecurityGroupsToLoadBalancerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ApplySecurityGroupsToLoadBalancerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.SecurityGroups == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecurityGroups")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAttachLoadBalancerToSubnetsInput(v *AttachLoadBalancerToSubnetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AttachLoadBalancerToSubnetsInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.Subnets == nil { + invalidParams.Add(smithy.NewErrParamRequired("Subnets")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpConfigureHealthCheckInput(v *ConfigureHealthCheckInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConfigureHealthCheckInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.HealthCheck == nil { + invalidParams.Add(smithy.NewErrParamRequired("HealthCheck")) + } else if v.HealthCheck != nil { + if err := validateHealthCheck(v.HealthCheck); err != nil { + invalidParams.AddNested("HealthCheck", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAppCookieStickinessPolicyInput(v *CreateAppCookieStickinessPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAppCookieStickinessPolicyInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if v.CookieName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CookieName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLBCookieStickinessPolicyInput(v *CreateLBCookieStickinessPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLBCookieStickinessPolicyInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLoadBalancerInput(v *CreateLoadBalancerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLoadBalancerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.Listeners == nil { + invalidParams.Add(smithy.NewErrParamRequired("Listeners")) + } else if v.Listeners != nil { + if err := validateListeners(v.Listeners); err != nil { + invalidParams.AddNested("Listeners", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLoadBalancerListenersInput(v *CreateLoadBalancerListenersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLoadBalancerListenersInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.Listeners == nil { + invalidParams.Add(smithy.NewErrParamRequired("Listeners")) + } else if v.Listeners != nil { + if err := validateListeners(v.Listeners); err != nil { + invalidParams.AddNested("Listeners", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLoadBalancerPolicyInput(v *CreateLoadBalancerPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLoadBalancerPolicyInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if v.PolicyTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyTypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteLoadBalancerInput(v *DeleteLoadBalancerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLoadBalancerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteLoadBalancerListenersInput(v *DeleteLoadBalancerListenersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLoadBalancerListenersInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.LoadBalancerPorts == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerPorts")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteLoadBalancerPolicyInput(v *DeleteLoadBalancerPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLoadBalancerPolicyInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeregisterInstancesFromLoadBalancerInput(v *DeregisterInstancesFromLoadBalancerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterInstancesFromLoadBalancerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.Instances == nil { + invalidParams.Add(smithy.NewErrParamRequired("Instances")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeInstanceHealthInput(v *DescribeInstanceHealthInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeInstanceHealthInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeLoadBalancerAttributesInput(v *DescribeLoadBalancerAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeLoadBalancerAttributesInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeTagsInput(v *DescribeTagsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeTagsInput"} + if v.LoadBalancerNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDetachLoadBalancerFromSubnetsInput(v *DetachLoadBalancerFromSubnetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DetachLoadBalancerFromSubnetsInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.Subnets == nil { + invalidParams.Add(smithy.NewErrParamRequired("Subnets")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisableAvailabilityZonesForLoadBalancerInput(v *DisableAvailabilityZonesForLoadBalancerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisableAvailabilityZonesForLoadBalancerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.AvailabilityZones == nil { + invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZones")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpEnableAvailabilityZonesForLoadBalancerInput(v *EnableAvailabilityZonesForLoadBalancerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EnableAvailabilityZonesForLoadBalancerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.AvailabilityZones == nil { + invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZones")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyLoadBalancerAttributesInput(v *ModifyLoadBalancerAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyLoadBalancerAttributesInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.LoadBalancerAttributes == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerAttributes")) + } else if v.LoadBalancerAttributes != nil { + if err := validateLoadBalancerAttributes(v.LoadBalancerAttributes); err != nil { + invalidParams.AddNested("LoadBalancerAttributes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterInstancesWithLoadBalancerInput(v *RegisterInstancesWithLoadBalancerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterInstancesWithLoadBalancerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.Instances == nil { + invalidParams.Add(smithy.NewErrParamRequired("Instances")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveTagsInput(v *RemoveTagsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveTagsInput"} + if v.LoadBalancerNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerNames")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetLoadBalancerListenerSSLCertificateInput(v *SetLoadBalancerListenerSSLCertificateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetLoadBalancerListenerSSLCertificateInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.SSLCertificateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SSLCertificateId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetLoadBalancerPoliciesForBackendServerInput(v *SetLoadBalancerPoliciesForBackendServerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetLoadBalancerPoliciesForBackendServerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.InstancePort == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstancePort")) + } + if v.PolicyNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSetLoadBalancerPoliciesOfListenerInput(v *SetLoadBalancerPoliciesOfListenerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SetLoadBalancerPoliciesOfListenerInput"} + if v.LoadBalancerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName")) + } + if v.PolicyNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyNames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/helper_aws.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/helper_aws.go new file mode 100644 index 000000000..de8658dc4 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/helper_aws.go @@ -0,0 +1,277 @@ +/* +Copyright 2025 The Kubernetes Authors. + +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. +*/ +package e2e + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/ec2" + + elb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" + elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" + elbv2types "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" + + "k8s.io/apimachinery/pkg/util/wait" + clientset "k8s.io/client-go/kubernetes" + "k8s.io/kubernetes/test/e2e/framework" +) + +// awsHelper provides AWS API operations for e2e tests +type E2ETestHelperAWS struct { + ctx context.Context + + ec2Client *ec2.Client + elbClient *elb.Client + elbv2Client *elbv2.Client +} + +// NewAWSHelper creates a new AWS helper with configured clients +func NewAWSHelper(ctx context.Context, cs clientset.Interface) (*E2ETestHelperAWS, error) { + cfg, err := config.LoadDefaultConfig(ctx) + framework.ExpectNoError(err, "unable to load AWS config") + + // Configure custom retryer to handle transient AWS API errors and credential failures. + // AWS API limits for ELB are generous (400 TPS for DescribeLoadBalancers), + // so aggressive retries are safe and necessary for CI stability. + customRetryer := retry.NewStandard(func(o *retry.StandardOptions) { + o.MaxAttempts = 10 // Handle IMDS timeouts and transient errors + o.MaxBackoff = 30 * time.Second // Cap backoff to avoid excessive wait + }) + + // Create AWS clients with custom retryer + h := &E2ETestHelperAWS{ + ctx: ctx, + ec2Client: ec2.NewFromConfig(cfg, func(o *ec2.Options) { o.Retryer = customRetryer }), + elbClient: elb.NewFromConfig(cfg, func(o *elb.Options) { o.Retryer = customRetryer }), + elbv2Client: elbv2.NewFromConfig(cfg, func(o *elbv2.Options) { o.Retryer = customRetryer }), + } + + // framework.Logf("Discovering cluster tag") + // framework.ExpectNoError(h.discoverClusterTag(cs), "unable to find cluster tag") + // // framework.Logf("Cluster tag discovered: %s", h.clusterTag) + + return h, nil +} + +func (h *E2ETestHelperAWS) GetEC2Client() *ec2.Client { + return h.ec2Client +} + +func (h *E2ETestHelperAWS) GetELBV2Client() *elbv2.Client { + return h.elbv2Client +} + +// // discoverClusterTag discovers the cluster tag from a cluster. +// // The discover is done by looking up the EC2 instance tags with tag:Name prefix kubernetes.io/cluster. +// // The EC2 Instance ID is discovered from a cluster node object. +// // The cluster ID, VPC ID and cluster tag are discovered from the EC2 instance tags. +// // If is any error is found, the function returns an error. +// func (h *E2ETestHelperAWS) discoverClusterTag(cs clientset.Interface) error { +// nodes, err := cs.CoreV1().Nodes().List(h.ctx, metav1.ListOptions{}) +// if err != nil { +// return fmt.Errorf("failed to list nodes: %v", err) +// } + +// var instanceID string +// for _, node := range nodes.Items { +// providerID := node.Spec.ProviderID +// if providerID == "" { +// continue +// } +// providerID = strings.Replace(providerID, "aws:///", "", 1) +// if len(strings.Split(providerID, "/")) < 2 { +// continue +// } +// // h.awsRegion = strings.Split(providerID, "/")[0] +// instanceID = strings.Split(providerID, "/")[1] +// if !strings.HasPrefix(instanceID, "i-") { +// continue +// } +// break +// } + +// instance, err := h.ec2Client.DescribeInstances(h.ctx, &ec2.DescribeInstancesInput{ +// InstanceIds: []string{instanceID}, +// }) +// if err != nil { +// return fmt.Errorf("failed to describe instances: %v", err) +// } + +// clusterTagFound := false +// for _, reservation := range instance.Reservations { +// for _, tag := range reservation.Instances[0].Tags { +// if strings.HasPrefix(aws.ToString(tag.Key), "kubernetes.io/cluster") { +// // h.clusterTag = aws.ToString(tag.Key) +// // h.clusterTagValue = aws.ToString(tag.Value) +// clusterTagFound = true +// break +// } +// } +// if clusterTagFound { +// break +// } +// } + +// if !clusterTagFound { +// return fmt.Errorf("cluster tag not found in the instance %s", instanceID) +// } + +// // h.clusterName = strings.Split(h.clusterTag, "/")[2] +// // if h.clusterName == "" { +// // return fmt.Errorf("cluster name not found in the cluster tag %s", h.clusterTag) +// // } + +// // extract VPC ID from the Instance +// // for _, networkInterface := range instance.Reservations[0].Instances[0].NetworkInterfaces { +// // h.vpcID = aws.ToString(networkInterface.VpcId) +// // break +// // } + +// // if h.vpcID == "" { +// // return fmt.Errorf("VPC ID not found in the instance %s", instanceID) +// // } + +// return nil +// } + +// GetLBTargetCount verifies the number of registered targets for a given LBv2 DNS name matches the expected count. +// The steps includes: +// - Get Load Balancer ARN from DNS name extracted from service Status.LoadBalancer.Ingress[0].Hostname +// - List listeners for the load balancer +// - Get target groups attached to listeners +// - Count registered targets in target groups +// - Verify count matches number of worker nodes +func (h *E2ETestHelperAWS) GetLBTargetCount(lbDNSName string, expectedTargets int) error { + // Get Load Balancer ARN from DNS name + foundLB, err := h.GetLoadBalancerFromDNSNameWithRetry(lbDNSName, 10*time.Minute) + if err != nil { + return fmt.Errorf("failed to get load balancer from DNS name: %v", err) + } + lbARN := aws.ToString(foundLB.LoadBalancerArn) + + // List listeners for the load balancer + listenersOut, err := h.elbv2Client.DescribeListeners(h.ctx, &elbv2.DescribeListenersInput{ + LoadBalancerArn: aws.String(lbARN), + }) + if err != nil { + return fmt.Errorf("failed to describe listeners: %v", err) + } + + // Get target groups attached to listeners + targetGroupARNs := map[string]struct{}{} + for _, listener := range listenersOut.Listeners { + if len(targetGroupARNs) > 0 { + break + } + for _, action := range listener.DefaultActions { + if action.TargetGroupArn != nil { + targetGroupARNs[aws.ToString(action.TargetGroupArn)] = struct{}{} + break + } + } + } + if len(targetGroupARNs) == 0 { + return fmt.Errorf("no target groups found for LB: %s", lbARN) + } + + // Count registered targets in target groups + totalTargets := 0 + for tgARN := range targetGroupARNs { + tgHealth, err := h.elbv2Client.DescribeTargetHealth(h.ctx, &elbv2.DescribeTargetHealthInput{ + TargetGroupArn: aws.String(tgARN), + }) + if err != nil { + return fmt.Errorf("failed to describe target health for TG %s: %v", tgARN, err) + } + totalTargets += len(tgHealth.TargetHealthDescriptions) + } + + // Verify count matches number of worker nodes + if totalTargets != expectedTargets { + return fmt.Errorf("target count mismatch: expected %d, got %d", expectedTargets, totalTargets) + } + return nil +} + +// GetLoadBalancerFromDNSName describes a load balancers filtered by DNS name. +func (h *E2ETestHelperAWS) GetLoadBalancerFromDNSName(lbDNSName string) (*elbv2types.LoadBalancer, error) { + var foundLB *elbv2types.LoadBalancer + framework.Logf("describing load balancers with DNS %s", lbDNSName) + + paginator := elbv2.NewDescribeLoadBalancersPaginator(h.elbv2Client, &elbv2.DescribeLoadBalancersInput{}) + for paginator.HasMorePages() { + page, err := paginator.NextPage(h.ctx) + if err != nil { + return nil, fmt.Errorf("failed to describe load balancers: %v", err) + } + + framework.Logf("found %d load balancers in page", len(page.LoadBalancers)) + // Search for the load balancer with matching DNS name in this page + for i := range page.LoadBalancers { + if aws.ToString(page.LoadBalancers[i].DNSName) == lbDNSName { + foundLB = &page.LoadBalancers[i] + framework.Logf("found load balancer with DNS %s", aws.ToString(foundLB.DNSName)) + break + } + } + if foundLB != nil { + break + } + } + + if foundLB == nil { + return nil, fmt.Errorf("no load balancer found with DNS name: %s", lbDNSName) + } + + return foundLB, nil +} + +// GetLoadBalancerFromDNSNameWithRetry describes a load balancers filtered by DNS name with retry using +// exponential backoff. +func (h *E2ETestHelperAWS) GetLoadBalancerFromDNSNameWithRetry(lbDNSName string, timeout time.Duration) (*elbv2types.LoadBalancer, error) { + var foundLB *elbv2types.LoadBalancer + + ctx, cancel := context.WithTimeout(h.ctx, timeout) + defer cancel() + + backoff := wait.Backoff{ + Duration: 2 * time.Second, // Start slightly slower + Factor: 2.0, + Jitter: 0.1, + Steps: 22, // Covers ~9.5 minutes + Cap: 30 * time.Second, + } + + err := wait.ExponentialBackoffWithContext(ctx, backoff, func(ctx context.Context) (bool, error) { + var err error + foundLB, err = h.GetLoadBalancerFromDNSName(lbDNSName) + if err != nil { + return false, nil + } + return true, nil + }) + + if err != nil { + return nil, fmt.Errorf("failed to find load balancer %s within timeout: %v", lbDNSName, err) + } + + return foundLB, nil +} diff --git a/cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/helper_e2e.go b/cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/helper_e2e.go new file mode 100644 index 000000000..b967153f8 --- /dev/null +++ b/cmd/cloud-controller-manager-aws-tests-ext/vendor/k8s.io/cloud-provider-aws/tests/e2e/helper_e2e.go @@ -0,0 +1,859 @@ +/* +Copyright 2025 The Kubernetes Authors. + +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. +*/ +package e2e + +import ( + "context" + "fmt" + "os" + "sort" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/apimachinery/pkg/util/wait" + clientset "k8s.io/client-go/kubernetes" + + g "github.com/onsi/gomega" + appsv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/kubernetes/test/e2e/framework" + e2eservice "k8s.io/kubernetes/test/e2e/framework/service" + imageutils "k8s.io/kubernetes/test/utils/image" +) + +// E2ETestHelper provides a helper for e2e tests. +type E2ETestHelper struct { + ctx context.Context + kubeClient clientset.Interface + + // AWS helper + awsHelper *E2ETestHelperAWS + + // service configuration + cfgPortCount int + cfgPodPort uint16 + cfgPodProtocol v1.Protocol + cfgDefaultAnnotations map[string]string + LBJig *e2eservice.TestJig + + // service instance + svc *v1.Service + + // node discovery + nodeSelector string + nodeCount int + sampleNodeName string +} + +// NewE2ETestHelper creates a new E2ETestHelper instance. +func NewE2ETestHelper(ctx context.Context, cs clientset.Interface) (*E2ETestHelper, error) { + var cancel context.CancelFunc + if ctx == nil || ctx == context.Background() { + // Create a context with a reasonable timeout for e2e tests when no context is provided + // E2E tests can take several minutes for load balancer provisioning and configuration + ctx, cancel = context.WithTimeout(context.Background(), 25*time.Minute) + _ = cancel // We'll let the test framework handle cleanup + } + + awsHelper, err := NewAWSHelper(ctx, cs) + if err != nil { + return nil, fmt.Errorf("failed to create AWS E2E test helper: %v", err) + } + + return &E2ETestHelper{ + kubeClient: cs, + cfgPortCount: 2, + ctx: ctx, + cfgPodPort: 8080, + cfgPodProtocol: v1.ProtocolTCP, + cfgDefaultAnnotations: map[string]string{ + "aws-load-balancer-backend-protocol": "http", + "aws-load-balancer-ssl-ports": "https", + }, + awsHelper: awsHelper, + }, nil +} + +func (e2e *E2ETestHelper) GetAWSHelper() *E2ETestHelperAWS { + return e2e.awsHelper +} + +func (e2e *E2ETestHelper) GetContext() context.Context { + return e2e.ctx +} + +func (e2e *E2ETestHelper) GetKubeClient() clientset.Interface { + return e2e.kubeClient +} + +// buildService creates a service instance with custom annotations. +func (e2e *E2ETestHelper) buildService(portCount int, extraAnnotations map[string]string) *v1.Service { + svc := &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: e2e.LBJig.Namespace, + Name: e2e.LBJig.Name, + Labels: e2e.LBJig.Labels, + Annotations: make(map[string]string, len(e2e.cfgDefaultAnnotations)+len(extraAnnotations)), + }, + Spec: v1.ServiceSpec{ + Type: v1.ServiceTypeLoadBalancer, + SessionAffinity: v1.ServiceAffinityNone, + Selector: e2e.LBJig.Labels, + }, + } + if portCount == 0 { + portCount = e2e.cfgPortCount + } + for i := 0; i < portCount; i++ { + svc.Spec.Ports = append(svc.Spec.Ports, v1.ServicePort{ + Name: fmt.Sprintf("port-%d", i), + Protocol: v1.ProtocolTCP, + Port: int32(80 + i), + TargetPort: intstr.FromInt(int(e2e.cfgPodPort)), + }) + } + + // add default annotations - can be overriden by extra annotations + for aK, aV := range e2e.cfgDefaultAnnotations { + svc.Annotations[aK] = aV + } + + // append test case annotations to the service + for aK, aV := range extraAnnotations { + svc.Annotations[aK] = aV + } + + // Defensive: ensure Annotations is not nil + if svc.Annotations == nil { + svc.Annotations = map[string]string{} + } + + return svc +} + +// cleanup cleans up the e2e resources. +func (e *E2ETestHelper) cleanup() { + framework.Logf("Cleaning up e2e resources") + // TODO cleanup resources created by the test helper +} + +// buildDeployment creates a deployment configuration to the network load balancer test framework. +// buildDeployment is based on newDTemplate() from the e2e test framework, which not provide +// customization to bind in non-privileged ports. +func (e2e *E2ETestHelper) buildDeployment(affinity bool) func(deployment *appsv1.Deployment) { + return func(deployment *appsv1.Deployment) { + var replicas int32 = 1 + var grace int64 = 3 + deployment.ObjectMeta = metav1.ObjectMeta{ + Namespace: e2e.LBJig.Namespace, + Name: e2e.LBJig.Name, + Labels: e2e.LBJig.Labels, + } + deployment.Spec = appsv1.DeploymentSpec{ + Replicas: &replicas, + Selector: &metav1.LabelSelector{ + MatchLabels: e2e.LBJig.Labels, + }, + Template: v1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: e2e.LBJig.Labels, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "netexec", + Image: imageutils.GetE2EImage(imageutils.Agnhost), + Args: []string{ + "netexec", + fmt.Sprintf("--http-port=%d", e2e.cfgPodPort), + fmt.Sprintf("--udp-port=%d", e2e.cfgPodPort), + }, + ReadinessProbe: &v1.Probe{ + PeriodSeconds: 3, + ProbeHandler: v1.ProbeHandler{ + HTTPGet: &v1.HTTPGetAction{ + Port: intstr.FromInt(int(e2e.cfgPodPort)), + Path: "/hostName", + }, + }, + }, + }, + }, + TerminationGracePeriodSeconds: &grace, + }, + }, + } + if affinity { + deployment.Spec.Template.Spec.Affinity = &v1.Affinity{ + NodeAffinity: &v1.NodeAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ + NodeSelectorTerms: []v1.NodeSelectorTerm{ + { + MatchExpressions: []v1.NodeSelectorRequirement{ + { + Key: "kubernetes.io/hostname", + Operator: v1.NodeSelectorOpIn, + Values: []string{e2e.sampleNodeName}, + }, + }, + }, + }, + }, + }, + } + } + } +} + +// isNodeSchedulable checks if a node is schedulable by checking if it has any taints that prevent scheduling pods. +func (e2e *E2ETestHelper) isNodeSchedulable(node *v1.Node) bool { + if node == nil { + return false + } + if len(node.Spec.Taints) == 0 { + return true + } + for _, taint := range node.Spec.Taints { + if node.Spec.Unschedulable || taint.Effect == v1.TaintEffectNoSchedule || taint.Effect == v1.TaintEffectNoExecute { + return false + } + } + return true +} + +// discoverClusterWorkerNode identifies and selects worker nodes in the cluster based on predefined node label selectors. +// It returns a ClusterNodeDiscovery struct with the discovered information. +func (e2e *E2ETestHelper) discoverClusterWorkerNode() { + var workerNodeList []string + framework.Logf("discovering node label used in the kubernetes distributions") + for _, selector := range lookupNodeSelectors { + var nodeList *v1.NodeList + var err error + g.Eventually(e2e.ctx, func(ctx context.Context) error { + nodeList, err = e2e.kubeClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{ + LabelSelector: selector, + }) + if err != nil { + return fmt.Errorf("failed to list worker nodes: %v", err) + } + if len(nodeList.Items) == 0 { + return fmt.Errorf("no worker nodes found") + } + return nil + }, 2*time.Minute, 5*time.Second).Should(g.Succeed(), "failed to list worker nodes") + g.Expect(nodeList).NotTo(g.BeNil(), "found worker nodes is nil") + + e2e.nodeCount = len(nodeList.Items) + if len(nodeList.Items) > 0 { + for i := range nodeList.Items { + node := &nodeList.Items[i] + if !e2e.isNodeSchedulable(node) { + framework.Logf("skipping node %s because it has taints: %v", node.Name, node.Spec.Taints) + continue + } + workerNodeList = append(workerNodeList, node.Name) + } + // Save the first worker node in the list to be used in cases. + sort.Strings(workerNodeList) + e2e.sampleNodeName = workerNodeList[0] + e2e.nodeSelector = selector + return + } + } + framework.ExpectNoError(fmt.Errorf("unable to find node selector for %v", lookupNodeSelectors)) +} + +// inClusterTestReachableHTTP creates a pod within the cluster to test HTTP connectivity to a target IP and port. +// It schedules a client pod on the specified node using node affinity to test the hairpin scenario. +// The client pod uses a curl-based container to perform the HTTP request to the target server (behind the load balancer) +// and validates the response. +// The function waits for the client pod to complete its execution and inspects its exit code to determine success or failure. +// +// Parameters: +// - target: The IP address or Hostname of the target HTTP server. +// - targetPort: The port number of the target HTTP server. +// +// Returns: +// - error: Returns an error if the pod creation, execution, or cleanup fails, or if the HTTP test fails unexpectedly. +// +// Behavior: +// - The function creates a client pod with a curl-based container to perform the HTTP request. +// - The client pod is scheduled on the specified node using node affinity. +// - Logs are periodically collected during the client pod's execution for troubleshooting. +// - Events are inspected if the client pod remains in a pending state for too long. +// - The function waits for the client pod to complete and inspects its exit code to determine success or failure. +// +// Acknowledgement: +// Documentation generated by Cursor AI, reviewed by Human. +// Function generated by Human, reviewed and verbosity increased by Cursor AI. +func (e2e *E2ETestHelper) inClusterTestReachableHTTP(target string, targetPort int) error { + podName := "http-test-pod" + + // Enhanced curl configuration for better resilience + // Total timeout calculation: 30 retries * 30s delay + 15min curl max time = ~25 minutes + // This aligns with the 25-minute polling timeout below + default_max_time := "900" // 15 minutes max for curl operations + if os.Getenv("CCM_E2E_OVERRIDE_MAX_TIME") != "" { + default_max_time = os.Getenv("CCM_E2E_OVERRIDE_MAX_TIME") + } + curlArgs := []string{ + "--retry", "30", // Increase retries for new LBs + "--retry-delay", "30", // Longer delay for DNS propagation + "--retry-max-time", default_max_time, // max time for curl operations + "--retry-all-errors", // Retry on all errors including DNS + "--retry-connrefused", // Explicitly retry connection refused + "--connect-timeout", "30", // 30s connection timeout + "--max-time", default_max_time, // 45s per individual request + "--trace-time", // Include timestamps for debugging + "--verbose", // More detailed output for troubleshooting + "-w", "\"\\nCURL_SUMMARY: HTTPCode=%{http_code} Time=%{time_total}s ConnectTime=%{time_connect}s DNSTime=%{time_namelookup}s\\n\"", + fmt.Sprintf("http://%s:%d/echo?msg=hello", target, targetPort), + } + + // client http test (curl) pod spec. + pod := &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: podName, + Namespace: e2e.svc.Namespace, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "curl", + Image: imageutils.GetE2EImage(imageutils.Agnhost), + Command: []string{"curl"}, + Args: curlArgs, + SecurityContext: &v1.SecurityContext{ + AllowPrivilegeEscalation: aws.Bool(false), + Capabilities: &v1.Capabilities{ + Drop: []v1.Capability{"ALL"}, + }, + ReadOnlyRootFilesystem: aws.Bool(true), + }, + }, + }, + SecurityContext: &v1.PodSecurityContext{ + RunAsNonRoot: aws.Bool(true), + RunAsUser: aws.Int64(1000), + RunAsGroup: aws.Int64(1000), + SeccompProfile: &v1.SeccompProfile{ + Type: v1.SeccompProfileTypeRuntimeDefault, // Enforces runtime default seccomp profile for syscall filtering. + }, + }, + RestartPolicy: v1.RestartPolicyNever, // Prevents the pod from restarting automatically. + Affinity: &v1.Affinity{ + NodeAffinity: &v1.NodeAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ + NodeSelectorTerms: []v1.NodeSelectorTerm{ + { + MatchExpressions: []v1.NodeSelectorRequirement{ + { + Key: "kubernetes.io/hostname", + Operator: v1.NodeSelectorOpIn, + Values: []string{e2e.sampleNodeName}, + }, + }, + }, + }, + }, + }, + }, + }, + } + ct := pod.Spec.Containers[0] + framework.Logf("In-Cluster test PodSpec Image=%v Command=%v Args=%v", ct.Image, ct.Command, ct.Args) + + // Create the pod + _, err := e2e.kubeClient.CoreV1().Pods(e2e.svc.Namespace).Create(e2e.ctx, pod, metav1.CreateOptions{}) + if err != nil { + return fmt.Errorf("failed to create HTTP test pod: %v", err) + } + // Clean up the pod + defer func() { + err = e2e.kubeClient.CoreV1().Pods(e2e.svc.Namespace).Delete(e2e.ctx, podName, metav1.DeleteOptions{}) + if err != nil { + framework.Logf("Failed to delete pod %s: %v", podName, err) + } + }() + + // Wait for the test pod to complete. Align timeout with curl retry configuration + // Curl timeout: 30 retries * 30s delay + 900s max = ~1800s (~25-30 minutes) + // Pod polling timeout: 25 minutes + buffer = ~30 minutes + waitCount := 0 + pendingCount := 0 + consecutiveErrorCount := 0 + maxConsecutiveErrors := 3 + lastLoggedPhase := "" + podPollingTimeout := 30 * time.Minute + + framework.Logf("=== STARTING POD MONITORING ===") + framework.Logf("Pod polling timeout: %v (aligned with curl timeout)", podPollingTimeout) + + err = wait.PollUntilContextTimeout(e2e.ctx, 15*time.Second, podPollingTimeout, true, func(ctx context.Context) (bool, error) { + p, err := e2e.kubeClient.CoreV1().Pods(e2e.svc.Namespace).Get(ctx, podName, metav1.GetOptions{}) + if err != nil { + consecutiveErrorCount++ + framework.Logf("Error getting pod %s (attempt %d/%d): %v", podName, consecutiveErrorCount, maxConsecutiveErrors, err) + + // Debugging information for CI troubleshooting + if consecutiveErrorCount == 1 { + framework.Logf("=== CI Environment Debug Info ===") + framework.Logf("Namespace: %s, PodName: %s, NodeName: %s", e2e.svc.Namespace, podName, e2e.sampleNodeName) + framework.Logf("Error type: %T", err) + framework.Logf("Error details: %v", err) + framework.Logf("API server connectivity issue detected in CI environment") + } + + // Check if this is a retriable error (API server issues, network problems, etc.) + if isRetriableKubernetesError(err) && consecutiveErrorCount < maxConsecutiveErrors { + framework.Logf("Treating as transient API server error, will retry in 15 seconds...") + return false, nil // Continue polling, don't fail immediately + } + + // If we've had too many consecutive errors or this is a non-retriable error, fail + framework.Logf("Permanent error or too many consecutive errors (%d), failing test", consecutiveErrorCount) + return false, err + } + + consecutiveErrorCount = 0 + + // Log phase changes + if string(p.Status.Phase) != lastLoggedPhase { + framework.Logf("Pod %s phase changed: %s -> %s", podName, lastLoggedPhase, p.Status.Phase) + lastLoggedPhase = string(p.Status.Phase) + } + + podFinished := p.Status.Phase == v1.PodSucceeded || p.Status.Phase == v1.PodFailed + + if p.Status.Phase == v1.PodFailed { + framework.Logf("Pod entered Failed state - performing detailed analysis:") + framework.Logf("%s", analyzePodFailure(p)) + framework.Logf("Recent logs from failed pod:\n%s", gatherPodLogs(e2e, podName, 50)) + } + + // Troubleshoot pending pods + if p.Status.Phase == v1.PodPending { + pendingCount++ + } + if pendingCount%10 == 0 && pendingCount > 0 { + framework.Logf("Pod %s is pending for too long, checking events...", podName) + + // Collect pod-specific events + events, errE := e2e.kubeClient.CoreV1().Events(e2e.svc.Namespace).List(ctx, metav1.ListOptions{ + FieldSelector: fmt.Sprintf("involvedObject.name=%s", podName), + }) + if errE != nil { + framework.Logf("Failed to list events for pod %s: %v", podName, errE) + } else { + framework.Logf("Pod-specific events:") + for _, event := range events.Items { + framework.Logf(" [%s] %s: %s (Count: %d)", + event.Type, event.Reason, event.Message, event.Count) + } + } + + // Collect node-level events if pod is scheduled + if p.Spec.NodeName != "" { + nodeEvents, errNE := e2e.kubeClient.CoreV1().Events(e2e.svc.Namespace).List(ctx, metav1.ListOptions{ + FieldSelector: fmt.Sprintf("involvedObject.name=%s", p.Spec.NodeName), + }) + if errNE != nil { + framework.Logf("Failed to list events for node %s: %v", p.Spec.NodeName, errNE) + } else if len(nodeEvents.Items) > 0 { + framework.Logf("Node %s recent events:", p.Spec.NodeName) + for _, event := range nodeEvents.Items { + framework.Logf(" [%s] %s: %s", event.Type, event.Reason, event.Message) + } + } + } + + framework.Logf("Preliminary analysis for pending pod:") + framework.Logf("%s", analyzePodFailure(p)) + } + // frequently collect logs. + if waitCount > 0 && waitCount%4 == 0 { + framework.Logf("Tail logs for HTTP test pod:\n%s", gatherPodLogs(e2e, podName, 5)) + } + if podFinished { + framework.Logf("Tail logs for HTTP test pod:\n%s", gatherPodLogs(e2e, podName, 0)) + } + waitCount++ + return podFinished, nil + }) + if err != nil { + return fmt.Errorf("error waiting for pod %s to complete: %v", podName, err) + } + + // Inspect the pod's container status for exit code + pod, errS := e2e.kubeClient.CoreV1().Pods(e2e.svc.Namespace).Get(e2e.ctx, podName, metav1.GetOptions{}) + if errS != nil { + return fmt.Errorf("failed to get pod %s: %v", podName, errS) + } + + framework.Logf("=== FINAL POD STATUS ANALYSIS ===") + framework.Logf("Final pod phase: %s", pod.Status.Phase) + + if len(pod.Status.ContainerStatuses) == 0 { + framework.Logf("WARNING: No container statuses found - this indicates a scheduling or node issue") + framework.Logf("%s", analyzePodFailure(pod)) + return fmt.Errorf("no container statuses found for pod %s - check pod failure analysis above", podName) + } + + containerStatus := pod.Status.ContainerStatuses[0] + framework.Logf("Container state analysis:") + framework.Logf(" Ready: %t", containerStatus.Ready) + framework.Logf(" Restart count: %d", containerStatus.RestartCount) + + // Detailed termination analysis + if containerStatus.State.Terminated != nil { + termination := containerStatus.State.Terminated + exitCode := termination.ExitCode + framework.Logf(" Termination reason: %s", termination.Reason) + framework.Logf(" Exit code: %d", exitCode) + framework.Logf(" Termination message: %s", termination.Message) + + if exitCode != 0 { + // Gather comprehensive failure information + framework.Logf("=== CURL TEST FAILURE ANALYSIS ===") + framework.Logf("Exit code %d indicates curl command failed", exitCode) + framework.Logf("Common exit codes:") + framework.Logf(" 6: Couldn't resolve host") + framework.Logf(" 7: Failed to connect to host") + framework.Logf(" 28: Operation timeout") + framework.Logf(" 52: Empty reply from server") + framework.Logf(" 56: Failure in receiving network data") + + finalLogs := gatherPodLogs(e2e, podName, 0) + framework.Logf("Final container logs:\n%s", finalLogs) + + // Provide specific guidance based on exit code + var guidance string + switch exitCode { + case 6: + guidance = "DNS resolution failure - check if target hostname is resolvable" + case 7: + guidance = "Connection refused - check if target service is accessible and load balancer is working" + case 28: + guidance = "Timeout - check if target service is responding or increase curl timeout" + case 52: + guidance = "Empty reply - target service might be misconfigured or not running" + case 56: + guidance = "Network data receive failure - possible network connectivity issues" + default: + guidance = "Check curl logs above for specific error details" + } + + errmsg := fmt.Errorf("HTTP connectivity test failed: pod %s exited with code %d. Guidance: %s", podName, exitCode, guidance) + framework.Logf("CONNECTIVITY TEST RESULT: FAILED - %s", errmsg.Error()) + return errmsg + } + } else if containerStatus.State.Waiting != nil { + framework.Logf("Container still waiting: %s - %s", + containerStatus.State.Waiting.Reason, containerStatus.State.Waiting.Message) + framework.Logf("%s", analyzePodFailure(pod)) + return fmt.Errorf("pod %s container never started properly - check failure analysis above", podName) + } else if containerStatus.State.Running != nil { + framework.Logf("WARNING: Container still running - this shouldn't happen with RestartPolicy=Never") + return fmt.Errorf("pod %s container still running after timeout - unexpected state", podName) + } + + // Validate HTTP response format with enhanced checking + // Expected format: CURL_SUMMARY: HTTPCode=200 Time=