From d27ee9947da7d21e7105aaaacc52873b1282a662 Mon Sep 17 00:00:00 2001 From: skotambkar Date: Tue, 27 Oct 2020 16:03:53 -0700 Subject: [PATCH] uncomment xmlns attr addition for putBucketAccelerateConfigration operation --- .../integrationtest/route53/smoke_test.go | 64 ++++++++++++++++++- service/s3/serializers.go | 2 +- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/service/internal/integrationtest/route53/smoke_test.go b/service/internal/integrationtest/route53/smoke_test.go index e630dc41499..17e6763d7e8 100644 --- a/service/internal/integrationtest/route53/smoke_test.go +++ b/service/internal/integrationtest/route53/smoke_test.go @@ -1,5 +1,3 @@ -// +build integration - package route53 import ( @@ -11,6 +9,8 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/internal/integrationtest" "github.com/aws/aws-sdk-go-v2/service/route53" + "github.com/aws/aws-sdk-go-v2/service/route53/types" + "github.com/awslabs/smithy-go" ) @@ -60,3 +60,63 @@ func TestInteg_01_GetHostedZone(t *testing.T) { t.Errorf("expect non-empty error message") } } + +func TestInteg_02_ChangeResourceRecordSets(t *testing.T) { + cases := map[string]struct { + action types.ChangeAction + }{ + "Create": { + action: types.ChangeActionCreate, + }, + "Upsert": { + action: types.ChangeActionUpsert, + }, + "Delete": { + action: types.ChangeActionDelete, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) + defer cancelFn() + + cfg, err := integrationtest.LoadConfigWithDefaultRegion("us-east-1") + if err != nil { + t.Fatalf("failed to load config, %v", err) + } + + client := route53.NewFromConfig(cfg) + + zoneID := "Z0985815JOOYDBSVBJT6" + params := &route53.ChangeResourceRecordSetsInput{ + ChangeBatch: &types.ChangeBatch{ + Changes: []*types.Change{ + { + Action: c.action, + ResourceRecordSet: &types.ResourceRecordSet{ + Name: aws.String("mockname"), + ResourceRecords: []*types.ResourceRecord{ + { + Value: aws.String("127.0.0.1"), + }, + }, + TTL: aws.Int64(60), + Type: types.RRTypeA, + }, + }, + }, + Comment: aws.String("Register instance"), + }, + HostedZoneId: aws.String(zoneID), + } + + resp, err := client.ChangeResourceRecordSets(ctx, params) + if err != nil { + t.Errorf("expect no error, got %v", err) + } + + t.Fatalf("%v", resp) + }) + } +} diff --git a/service/s3/serializers.go b/service/s3/serializers.go index 5789c430459..6e7a8654f34 100644 --- a/service/s3/serializers.go +++ b/service/s3/serializers.go @@ -5427,7 +5427,7 @@ func (m *awsRestxml_serializeOpPutBucketAccelerateConfiguration) HandleSerialize }, Attr: payloadRootAttr, } - // payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) + payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) if err := awsRestxml_serializeDocumentAccelerateConfiguration(input.AccelerateConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} }