diff --git a/.changelog/4d9631720e984e8faffd2dfa7e50b3e2.json b/.changelog/4d9631720e984e8faffd2dfa7e50b3e2.json new file mode 100644 index 00000000000..32c28bee337 --- /dev/null +++ b/.changelog/4d9631720e984e8faffd2dfa7e50b3e2.json @@ -0,0 +1,8 @@ +{ + "id": "4d963172-0e98-4e8f-affd-2dfa7e50b3e2", + "type": "feature", + "description": "With this release, Bedrock Evaluation will now support latency-optimized inference for foundation models.", + "modules": [ + "service/bedrock" + ] +} \ No newline at end of file diff --git a/.changelog/c32d3b03247345279488492b01f7d860.json b/.changelog/c32d3b03247345279488492b01f7d860.json new file mode 100644 index 00000000000..cb1b42ec433 --- /dev/null +++ b/.changelog/c32d3b03247345279488492b01f7d860.json @@ -0,0 +1,8 @@ +{ + "id": "c32d3b03-2473-4527-9488-492b01f7d860", + "type": "feature", + "description": "This update provides tagging support for Transcribe's Call Analytics Jobs and Call Analytics Categories.", + "modules": [ + "service/transcribe" + ] +} \ No newline at end of file diff --git a/.changelog/c9a62f09e1134ed48a2d5b9d13cbfacd.json b/.changelog/c9a62f09e1134ed48a2d5b9d13cbfacd.json new file mode 100644 index 00000000000..a9d2b50e992 --- /dev/null +++ b/.changelog/c9a62f09e1134ed48a2d5b9d13cbfacd.json @@ -0,0 +1,8 @@ +{ + "id": "c9a62f09-e113-4ed4-8a2d-5b9d13cbfacd", + "type": "feature", + "description": "Support updating connector configuration via UpdateConnector API. Release Operations API to monitor the status of the connector operation.", + "modules": [ + "service/kafkaconnect" + ] +} \ No newline at end of file diff --git a/.changelog/db6cb38d7aa04cbe92de91fd44160b66.json b/.changelog/db6cb38d7aa04cbe92de91fd44160b66.json new file mode 100644 index 00000000000..19ed60eb5bf --- /dev/null +++ b/.changelog/db6cb38d7aa04cbe92de91fd44160b66.json @@ -0,0 +1,8 @@ +{ + "id": "db6cb38d-7aa0-4cbe-92de-91fd44160b66", + "type": "feature", + "description": "Support resolving regional API calls to partition's leader region endpoint.", + "modules": [ + "service/artifact" + ] +} \ No newline at end of file diff --git a/.changelog/e603d1daf0314049a5ae3f816d2a54ab.json b/.changelog/e603d1daf0314049a5ae3f816d2a54ab.json new file mode 100644 index 00000000000..5f8064b60dc --- /dev/null +++ b/.changelog/e603d1daf0314049a5ae3f816d2a54ab.json @@ -0,0 +1,8 @@ +{ + "id": "e603d1da-f031-4049-a5ae-3f816d2a54ab", + "type": "feature", + "description": "Add support for DisconnectOnSessionTimeout flag in CreateClientVpnEndpoint and ModifyClientVpnEndpoint requests and DescribeClientVpnEndpoints responses", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/service/artifact/endpoints.go b/service/artifact/endpoints.go index 60af3779f0d..4b3f23f53a4 100644 --- a/service/artifact/endpoints.go +++ b/service/artifact/endpoints.go @@ -12,6 +12,7 @@ import ( "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/artifact/internal/endpoints" + smithy "github.com/aws/smithy-go" smithyauth "github.com/aws/smithy-go/auth" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" @@ -227,14 +228,6 @@ func bindRegion(region string) *string { // 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. // @@ -261,6 +254,14 @@ type EndpointParameters struct { // // SDK::Endpoint Endpoint *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string } // ValidateRequired validates required parameters are set. @@ -364,7 +365,7 @@ func (r *resolver) ResolveEndpoint( uriString := func() string { var out strings.Builder out.WriteString("https://artifact-fips.") - out.WriteString(_Region) + out.WriteString(_PartitionResult.ImplicitGlobalRegion) out.WriteString(".") out.WriteString(_PartitionResult.DualStackDnsSuffix) return out.String() @@ -378,6 +379,20 @@ func (r *resolver) ResolveEndpoint( return smithyendpoints.Endpoint{ URI: *uri, Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) + return sp + }(), + }, + }) + return out + }(), }, nil } } @@ -385,55 +400,87 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - uriString := func() string { - var out strings.Builder - out.WriteString("https://artifact-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) - } + if _UseDualStack == false { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://artifact-fips.") + out.WriteString(_PartitionResult.ImplicitGlobalRegion) + 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 smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") } - 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://artifact.") - 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) - } + if _UseFIPS == false { + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://artifact.") + out.WriteString(_PartitionResult.ImplicitGlobalRegion) + 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 smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") } - 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://artifact.") - out.WriteString(_Region) + out.WriteString(_PartitionResult.ImplicitGlobalRegion) out.WriteString(".") out.WriteString(_PartitionResult.DnsSuffix) return out.String() @@ -447,6 +494,20 @@ func (r *resolver) ResolveEndpoint( return smithyendpoints.Endpoint{ URI: *uri, Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) + return sp + }(), + }, + }) + return out + }(), }, nil } return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") @@ -461,10 +522,10 @@ type endpointParamsBinder interface { 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 + params.Region = bindRegion(options.Region) if b, ok := input.(endpointParamsBinder); ok { b.bindEndpointParams(params) diff --git a/service/artifact/endpoints_test.go b/service/artifact/endpoints_test.go index b207b020920..e1af3a5609d 100644 --- a/service/artifact/endpoints_test.go +++ b/service/artifact/endpoints_test.go @@ -5,8 +5,10 @@ package artifact import ( "context" smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" "reflect" @@ -14,8 +16,83 @@ import ( "testing" ) -// For region us-east-1 with FIPS enabled and DualStack enabled +// For custom endpoint with region not set and fips disabled func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -33,9 +110,22 @@ func TestEndpointCase0(t *testing.T) { uri, _ := url.Parse("https://artifact-fips.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -52,7 +142,7 @@ func TestEndpointCase0(t *testing.T) { } // For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase1(t *testing.T) { +func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -70,9 +160,22 @@ func TestEndpointCase1(t *testing.T) { uri, _ := url.Parse("https://artifact-fips.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -89,7 +192,7 @@ func TestEndpointCase1(t *testing.T) { } // For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase2(t *testing.T) { +func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -107,9 +210,22 @@ func TestEndpointCase2(t *testing.T) { uri, _ := url.Parse("https://artifact.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -126,7 +242,7 @@ func TestEndpointCase2(t *testing.T) { } // For region us-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase3(t *testing.T) { +func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -144,9 +260,22 @@ func TestEndpointCase3(t *testing.T) { uri, _ := url.Parse("https://artifact.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -162,10 +291,10 @@ func TestEndpointCase3(t *testing.T) { } } -// For region cn-north-1 with FIPS enabled and DualStack enabled -func TestEndpointCase4(t *testing.T) { +// For region cn-northwest-1 with FIPS enabled and DualStack enabled +func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), + Region: ptr.String("cn-northwest-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -178,12 +307,25 @@ func TestEndpointCase4(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact-fips.cn-north-1.api.amazonwebservices.com.cn") + uri, _ := url.Parse("https://artifact-fips.cn-northwest-1.api.amazonwebservices.com.cn") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -199,10 +341,10 @@ func TestEndpointCase4(t *testing.T) { } } -// For region cn-north-1 with FIPS enabled and DualStack disabled -func TestEndpointCase5(t *testing.T) { +// For region cn-northwest-1 with FIPS enabled and DualStack disabled +func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), + Region: ptr.String("cn-northwest-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -215,12 +357,25 @@ func TestEndpointCase5(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact-fips.cn-north-1.amazonaws.com.cn") + uri, _ := url.Parse("https://artifact-fips.cn-northwest-1.amazonaws.com.cn") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -236,10 +391,10 @@ func TestEndpointCase5(t *testing.T) { } } -// For region cn-north-1 with FIPS disabled and DualStack enabled -func TestEndpointCase6(t *testing.T) { +// For region cn-northwest-1 with FIPS disabled and DualStack enabled +func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), + Region: ptr.String("cn-northwest-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -252,12 +407,25 @@ func TestEndpointCase6(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact.cn-north-1.api.amazonwebservices.com.cn") + uri, _ := url.Parse("https://artifact.cn-northwest-1.api.amazonwebservices.com.cn") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -273,10 +441,10 @@ func TestEndpointCase6(t *testing.T) { } } -// For region cn-north-1 with FIPS disabled and DualStack disabled -func TestEndpointCase7(t *testing.T) { +// For region cn-northwest-1 with FIPS disabled and DualStack disabled +func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), + Region: ptr.String("cn-northwest-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -289,12 +457,25 @@ func TestEndpointCase7(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact.cn-north-1.amazonaws.com.cn") + uri, _ := url.Parse("https://artifact.cn-northwest-1.amazonaws.com.cn") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -310,10 +491,10 @@ func TestEndpointCase7(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase8(t *testing.T) { +// For region us-gov-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), + Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -326,12 +507,25 @@ func TestEndpointCase8(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact-fips.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://artifact-fips.us-gov-west-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -347,10 +541,10 @@ func TestEndpointCase8(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase9(t *testing.T) { +// For region us-gov-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), + Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -363,12 +557,25 @@ func TestEndpointCase9(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://artifact-fips.us-gov-west-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -384,10 +591,10 @@ func TestEndpointCase9(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase10(t *testing.T) { +// For region us-gov-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), + Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -400,12 +607,25 @@ func TestEndpointCase10(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://artifact.us-gov-west-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -421,10 +641,10 @@ func TestEndpointCase10(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase11(t *testing.T) { +// For region us-gov-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), + Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -437,12 +657,25 @@ func TestEndpointCase11(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://artifact.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://artifact.us-gov-west-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -459,7 +692,7 @@ func TestEndpointCase11(t *testing.T) { } // For region us-iso-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase12(t *testing.T) { +func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), @@ -479,7 +712,7 @@ func TestEndpointCase12(t *testing.T) { } // For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase13(t *testing.T) { +func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), @@ -497,9 +730,22 @@ func TestEndpointCase13(t *testing.T) { uri, _ := url.Parse("https://artifact-fips.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-iso-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -516,7 +762,7 @@ func TestEndpointCase13(t *testing.T) { } // For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase14(t *testing.T) { +func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), @@ -536,7 +782,7 @@ func TestEndpointCase14(t *testing.T) { } // For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase15(t *testing.T) { +func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), @@ -554,9 +800,22 @@ func TestEndpointCase15(t *testing.T) { uri, _ := url.Parse("https://artifact.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-iso-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -573,7 +832,7 @@ func TestEndpointCase15(t *testing.T) { } // For region us-isob-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase16(t *testing.T) { +func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), @@ -593,7 +852,7 @@ func TestEndpointCase16(t *testing.T) { } // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase17(t *testing.T) { +func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), @@ -611,9 +870,22 @@ func TestEndpointCase17(t *testing.T) { uri, _ := url.Parse("https://artifact-fips.us-isob-east-1.sc2s.sgov.gov") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isob-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -630,7 +902,7 @@ func TestEndpointCase17(t *testing.T) { } // For region us-isob-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase18(t *testing.T) { +func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), @@ -650,7 +922,7 @@ func TestEndpointCase18(t *testing.T) { } // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase19(t *testing.T) { +func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), @@ -668,9 +940,22 @@ func TestEndpointCase19(t *testing.T) { uri, _ := url.Parse("https://artifact.us-isob-east-1.sc2s.sgov.gov") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isob-east-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -686,13 +971,32 @@ func TestEndpointCase19(t *testing.T) { } } -// For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase20(t *testing.T) { +// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), } resolver := NewDefaultEndpointResolverV2() @@ -703,12 +1007,25 @@ func TestEndpointCase20(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://example.com") + uri, _ := url.Parse("https://artifact-fips.eu-isoe-west-1.cloud.adc-e.uk") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "eu-isoe-west-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -724,12 +1041,32 @@ func TestEndpointCase20(t *testing.T) { } } -// For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase21(t *testing.T) { +// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase26(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), } resolver := NewDefaultEndpointResolverV2() @@ -740,12 +1077,25 @@ func TestEndpointCase21(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://example.com") + uri, _ := url.Parse("https://artifact.eu-isoe-west-1.cloud.adc-e.uk") expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "eu-isoe-west-1") + return sp + }(), + }, + }) + return out + }(), } if e, a := expectEndpoint.URI, result.URI; e != a { @@ -761,13 +1111,12 @@ func TestEndpointCase21(t *testing.T) { } } -// For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase22(t *testing.T) { +// For region us-isof-south-1 with FIPS enabled and DualStack enabled +func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("us-isof-south-1"), UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -777,18 +1126,67 @@ func TestEndpointCase22(t *testing.T) { if err == nil { t.Fatalf("expect error, got none") } - if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { t.Errorf("expect %v error in %v", e, a) } } -// For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase23(t *testing.T) { +// For region us-isof-south-1 with FIPS enabled and DualStack disabled +func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://artifact-fips.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack enabled +func TestEndpointCase29(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), - Endpoint: ptr.String("https://example.com"), } resolver := NewDefaultEndpointResolverV2() @@ -798,13 +1196,63 @@ func TestEndpointCase23(t *testing.T) { if err == nil { t.Fatalf("expect error, got none") } - if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { t.Errorf("expect %v error in %v", e, a) } } +// For region us-isof-south-1 with FIPS disabled and DualStack disabled +func TestEndpointCase30(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://artifact.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + // Missing region -func TestEndpointCase24(t *testing.T) { +func TestEndpointCase31(t *testing.T) { var params = EndpointParameters{} resolver := NewDefaultEndpointResolverV2() diff --git a/service/bedrock/deserializers.go b/service/bedrock/deserializers.go index 23fd6642975..a030982aab8 100644 --- a/service/bedrock/deserializers.go +++ b/service/bedrock/deserializers.go @@ -11142,6 +11142,11 @@ func awsRestjson1_deserializeDocumentEvaluationBedrockModel(v **types.Evaluation sv.ModelIdentifier = ptr.String(jtv) } + case "performanceConfig": + if err := awsRestjson1_deserializeDocumentPerformanceConfiguration(&sv.PerformanceConfig, value); err != nil { + return err + } + default: _, _ = key, value @@ -15952,6 +15957,46 @@ func awsRestjson1_deserializeDocumentOutputDataConfig(v **types.OutputDataConfig return nil } +func awsRestjson1_deserializeDocumentPerformanceConfiguration(v **types.PerformanceConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PerformanceConfiguration + if *v == nil { + sv = &types.PerformanceConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "latency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PerformanceConfigLatency to be of type string, got %T instead", value) + } + sv.Latency = types.PerformanceConfigLatency(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPromptRouterSummaries(v *[]types.PromptRouterSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/bedrock/serializers.go b/service/bedrock/serializers.go index f3e5160abc7..ca31890cd56 100644 --- a/service/bedrock/serializers.go +++ b/service/bedrock/serializers.go @@ -5203,6 +5203,13 @@ func awsRestjson1_serializeDocumentEvaluationBedrockModel(v *types.EvaluationBed ok.String(*v.ModelIdentifier) } + if v.PerformanceConfig != nil { + ok := object.Key("performanceConfig") + if err := awsRestjson1_serializeDocumentPerformanceConfiguration(v.PerformanceConfig, ok); err != nil { + return err + } + } + return nil } @@ -6388,6 +6395,18 @@ func awsRestjson1_serializeDocumentOutputDataConfig(v *types.OutputDataConfig, v return nil } +func awsRestjson1_serializeDocumentPerformanceConfiguration(v *types.PerformanceConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Latency) > 0 { + ok := object.Key("latency") + ok.String(string(v.Latency)) + } + + return nil +} + func awsRestjson1_serializeDocumentPromptTemplate(v *types.PromptTemplate, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/bedrock/types/enums.go b/service/bedrock/types/enums.go index 5a1e5c00d21..1b48768ba2d 100644 --- a/service/bedrock/types/enums.go +++ b/service/bedrock/types/enums.go @@ -642,6 +642,25 @@ func (ModelModality) Values() []ModelModality { } } +type PerformanceConfigLatency string + +// Enum values for PerformanceConfigLatency +const ( + PerformanceConfigLatencyStandard PerformanceConfigLatency = "standard" + PerformanceConfigLatencyOptimized PerformanceConfigLatency = "optimized" +) + +// Values returns all known values for PerformanceConfigLatency. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (PerformanceConfigLatency) Values() []PerformanceConfigLatency { + return []PerformanceConfigLatency{ + "standard", + "optimized", + } +} + type PromptRouterStatus string // Enum values for PromptRouterStatus diff --git a/service/bedrock/types/types.go b/service/bedrock/types/types.go index 2e968e68bbb..99d0dc7dd54 100644 --- a/service/bedrock/types/types.go +++ b/service/bedrock/types/types.go @@ -228,6 +228,9 @@ type EvaluationBedrockModel struct { // model behaves during inference. InferenceParams *string + // Specifies performance settings for the model or inference profile. + PerformanceConfig *PerformanceConfiguration + noSmithyDocumentSerde } @@ -2225,6 +2228,16 @@ type OutputDataConfig struct { noSmithyDocumentSerde } +// Contains performance settings for a model. +type PerformanceConfiguration struct { + + // Specifies whether to use the latency-optimized or standard version of a model + // or inference profile. + Latency PerformanceConfigLatency + + noSmithyDocumentSerde +} + // Details about a prompt router. type PromptRouterSummary struct { diff --git a/service/ec2/api_op_CancelCapacityReservation.go b/service/ec2/api_op_CancelCapacityReservation.go index 7d800237b27..88661628c4e 100644 --- a/service/ec2/api_op_CancelCapacityReservation.go +++ b/service/ec2/api_op_CancelCapacityReservation.go @@ -21,6 +21,8 @@ import ( // elapsed. You can't cancel a future-dated Capacity Reservation during the // commitment duration. // +// You can't modify or cancel a Capacity Block. For more information, see [Capacity Blocks for ML]. +// // If a future-dated Capacity Reservation enters the delayed state, the commitment // duration is waived, and you can cancel it as soon as it enters the active state. // @@ -29,6 +31,8 @@ import ( // launch. Modify these instances to either target a different Capacity // Reservation, launch On-Demand Instance capacity, or run in any open Capacity // Reservation that has matching attributes and sufficient capacity. +// +// [Capacity Blocks for ML]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-blocks.html func (c *Client) CancelCapacityReservation(ctx context.Context, params *CancelCapacityReservationInput, optFns ...func(*Options)) (*CancelCapacityReservationOutput, error) { if params == nil { params = &CancelCapacityReservationInput{} diff --git a/service/ec2/api_op_CopySnapshot.go b/service/ec2/api_op_CopySnapshot.go index bd79455cc63..d8f3f35b8e3 100644 --- a/service/ec2/api_op_CopySnapshot.go +++ b/service/ec2/api_op_CopySnapshot.go @@ -30,7 +30,7 @@ import ( // Snapshots copied to an Outpost are encrypted by default using the default // encryption key for the Region, or a different key that you specify in the // request using KmsKeyId. Outposts do not support unencrypted snapshots. For more -// information, [Amazon EBS local snapshots on Outposts]in the Amazon EBS User Guide. +// information, see [Amazon EBS local snapshots on Outposts]in the Amazon EBS User Guide. // // Snapshots created by copying another snapshot have an arbitrary volume ID that // should not be used for any purpose. diff --git a/service/ec2/api_op_CreateClientVpnEndpoint.go b/service/ec2/api_op_CreateClientVpnEndpoint.go index 1340aed3efc..c63420b5040 100644 --- a/service/ec2/api_op_CreateClientVpnEndpoint.go +++ b/service/ec2/api_op_CreateClientVpnEndpoint.go @@ -85,6 +85,12 @@ type CreateClientVpnEndpointInput struct { // A brief description of the Client VPN endpoint. Description *string + // Indicates whether the client VPN session is disconnected after the maximum + // timeout specified in SessionTimeoutHours is reached. If true , users are + // prompted to reconnect client VPN. If false , client VPN attempts to reconnect + // automatically. The default value is false . + DisconnectOnSessionTimeout *bool + // Information about the DNS servers to be used for DNS resolution. A Client VPN // endpoint can have up to two DNS servers. If no DNS server is specified, the DNS // address configured on the device is used for the DNS server. diff --git a/service/ec2/api_op_CreateSnapshot.go b/service/ec2/api_op_CreateSnapshot.go index e1a59604f33..e187cae8053 100644 --- a/service/ec2/api_op_CreateSnapshot.go +++ b/service/ec2/api_op_CreateSnapshot.go @@ -23,7 +23,7 @@ import ( // same Region as the volume. // // - If the source volume is in a Local Zone, you can create the snapshot in the -// same Local Zone or in parent Amazon Web Services Region. +// same Local Zone or in its parent Amazon Web Services Region. // // - If the source volume is on an Outpost, you can create the snapshot on the // same Outpost or in its parent Amazon Web Services Region. @@ -47,7 +47,7 @@ import ( // Snapshots that are taken from encrypted volumes are automatically encrypted. // Volumes that are created from encrypted snapshots are also automatically // encrypted. Your encrypted volumes and any associated snapshots always remain -// protected. For more information, [Amazon EBS encryption]in the Amazon EBS User Guide. +// protected. For more information, see [Amazon EBS encryption]in the Amazon EBS User Guide. // // [Amazon EBS encryption]: https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html func (c *Client) CreateSnapshot(ctx context.Context, params *CreateSnapshotInput, optFns ...func(*Options)) (*CreateSnapshotOutput, error) { diff --git a/service/ec2/api_op_CreateSnapshots.go b/service/ec2/api_op_CreateSnapshots.go index 02db596189a..db82a7174d6 100644 --- a/service/ec2/api_op_CreateSnapshots.go +++ b/service/ec2/api_op_CreateSnapshots.go @@ -25,7 +25,7 @@ import ( // same Region as the instance. // // - If the source instance is in a Local Zone, you can create the snapshots in -// the same Local Zone or in parent Amazon Web Services Region. +// the same Local Zone or in its parent Amazon Web Services Region. // // - If the source instance is on an Outpost, you can create the snapshots on // the same Outpost or in its parent Amazon Web Services Region. diff --git a/service/ec2/api_op_DeleteSnapshot.go b/service/ec2/api_op_DeleteSnapshot.go index 30f413865a0..6ab49f457a3 100644 --- a/service/ec2/api_op_DeleteSnapshot.go +++ b/service/ec2/api_op_DeleteSnapshot.go @@ -20,7 +20,7 @@ import ( // needed to restore the volume. // // You cannot delete a snapshot of the root device of an EBS volume used by a -// registered AMI. You must first de-register the AMI before you can delete the +// registered AMI. You must first deregister the AMI before you can delete the // snapshot. // // For more information, see [Delete an Amazon EBS snapshot] in the Amazon EBS User Guide. diff --git a/service/ec2/api_op_DescribeCapacityBlockOfferings.go b/service/ec2/api_op_DescribeCapacityBlockOfferings.go index 716140f3ca6..7855a8dfaac 100644 --- a/service/ec2/api_op_DescribeCapacityBlockOfferings.go +++ b/service/ec2/api_op_DescribeCapacityBlockOfferings.go @@ -15,6 +15,14 @@ import ( // Describes Capacity Block offerings available for purchase in the Amazon Web // Services Region that you're currently using. With Capacity Blocks, you purchase // a specific instance type for a period of time. +// +// To search for an available Capacity Block offering, you specify a reservation +// duration and instance count. You must select one of the following options. +// +// - For reservation durations 1-day increments up 14 days and 7-day increments +// up to 182 days total +// +// - For instance count 1, 2, 4, 8, 16, 32, or 64 instances func (c *Client) DescribeCapacityBlockOfferings(ctx context.Context, params *DescribeCapacityBlockOfferingsInput, optFns ...func(*Options)) (*DescribeCapacityBlockOfferingsOutput, error) { if params == nil { params = &DescribeCapacityBlockOfferingsInput{} diff --git a/service/ec2/api_op_DescribeInstanceTopology.go b/service/ec2/api_op_DescribeInstanceTopology.go index 235d7d8f45d..af4ad0552e2 100644 --- a/service/ec2/api_op_DescribeInstanceTopology.go +++ b/service/ec2/api_op_DescribeInstanceTopology.go @@ -33,7 +33,8 @@ import ( // - p3dn.24xlarge | p4d.24xlarge | p4de.24xlarge | p5.48xlarge | p5e.48xlarge | // p5en.48xlarge // -// - trn1.2xlarge | trn1.32xlarge | trn1n.32xlarge +// - trn1.2xlarge | trn1.32xlarge | trn1n.32xlarge | trn2.48xlarge | +// trn2u.48xlarge // // For more information, see [Amazon EC2 instance topology] in the Amazon EC2 User Guide. // diff --git a/service/ec2/api_op_DescribeNetworkInterfaces.go b/service/ec2/api_op_DescribeNetworkInterfaces.go index 68b379cfac1..de391af27ba 100644 --- a/service/ec2/api_op_DescribeNetworkInterfaces.go +++ b/service/ec2/api_op_DescribeNetworkInterfaces.go @@ -118,6 +118,12 @@ type DescribeNetworkInterfacesInput struct { // // - network-interface-id - The ID of the network interface. // + // - operator.managed - A Boolean that indicates whether this is a managed + // network interface. + // + // - operator.principal - The principal that manages the network interface. Only + // valid for managed network interfaces, where managed is true . + // // - owner-id - The Amazon Web Services account ID of the network interface owner. // // - private-dns-name - The private DNS name of the network interface (IPv4). diff --git a/service/ec2/api_op_ModifyClientVpnEndpoint.go b/service/ec2/api_op_ModifyClientVpnEndpoint.go index 86c315e4f0b..d928a0ca683 100644 --- a/service/ec2/api_op_ModifyClientVpnEndpoint.go +++ b/service/ec2/api_op_ModifyClientVpnEndpoint.go @@ -59,6 +59,12 @@ type ModifyClientVpnEndpointInput struct { // A brief description of the Client VPN endpoint. Description *string + // Indicates whether the client VPN session is disconnected after the maximum + // timeout specified in sessionTimeoutHours is reached. If true , users are + // prompted to reconnect client VPN. If false , client VPN attempts to reconnect + // automatically. The default value is false . + DisconnectOnSessionTimeout *bool + // Information about the DNS servers to be used by Client VPN connections. A // Client VPN endpoint can have up to two DNS servers. DnsServers *types.DnsServersOptionsModifyStructure diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 9c0525646e5..0933465723d 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -71960,6 +71960,22 @@ func awsEc2query_deserializeDocumentClientVpnEndpoint(v **types.ClientVpnEndpoin sv.Description = ptr.String(xtv) } + case strings.EqualFold("disconnectOnSessionTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.DisconnectOnSessionTimeout = ptr.Bool(xtv) + } + case strings.EqualFold("dnsName", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index b57f10c9078..8aa724869ae 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -58557,6 +58557,11 @@ func awsEc2query_serializeOpDocumentCreateClientVpnEndpointInput(v *CreateClient objectKey.String(*v.Description) } + if v.DisconnectOnSessionTimeout != nil { + objectKey := object.Key("DisconnectOnSessionTimeout") + objectKey.Boolean(*v.DisconnectOnSessionTimeout) + } + if v.DnsServers != nil { objectKey := object.FlatKey("DnsServers") if err := awsEc2query_serializeDocumentValueStringList(v.DnsServers, objectKey); err != nil { @@ -72564,6 +72569,11 @@ func awsEc2query_serializeOpDocumentModifyClientVpnEndpointInput(v *ModifyClient objectKey.String(*v.Description) } + if v.DisconnectOnSessionTimeout != nil { + objectKey := object.Key("DisconnectOnSessionTimeout") + objectKey.Boolean(*v.DisconnectOnSessionTimeout) + } + if v.DnsServers != nil { objectKey := object.Key("DnsServers") if err := awsEc2query_serializeDocumentDnsServersOptionsModifyStructure(v.DnsServers, objectKey); err != nil { diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 7ea991bc3ba..cd9fe507814 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -2254,6 +2254,12 @@ type ClientVpnEndpoint struct { // A brief description of the endpoint. Description *string + // Indicates whether the client VPN session is disconnected after the maximum + // sessionTimeoutHours is reached. If true , users are prompted to reconnect client + // VPN. If false , client VPN attempts to reconnect automatically. The default + // value is false . + DisconnectOnSessionTimeout *bool + // The DNS name to be used by clients when connecting to the Client VPN endpoint. DnsName *string @@ -7089,7 +7095,7 @@ type InstanceBlockDeviceMappingSpecification struct { // launched. Ebs *EbsInstanceBlockDeviceSpecification - // suppress the specified device included in the block device mapping. + // Suppresses the specified device included in the block device mapping. NoDevice *string // The virtual device name. @@ -7837,12 +7843,9 @@ type InstanceNetworkInterfaceSpecification struct { // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html PrivateIpAddresses []PrivateIpAddressSpecification - // The number of secondary private IPv4 addresses. You can't specify this option - // and specify more than one private IP address using the private IP addresses - // option. You cannot specify this option if you're launching more than one - // instance in a [RunInstances]request. - // - // [RunInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html + // The number of secondary private IPv4 addresses. You can’t specify this + // parameter and also specify a secondary private IP address using the + // PrivateIpAddress parameter. SecondaryPrivateIpAddressCount *int32 // The ID of the subnet associated with the network interface. Applies only if diff --git a/service/identitystore/internal/endpoints/endpoints.go b/service/identitystore/internal/endpoints/endpoints.go index c541f1d0226..6af5c3f9820 100644 --- a/service/identitystore/internal/endpoints/endpoints.go +++ b/service/identitystore/internal/endpoints/endpoints.go @@ -172,6 +172,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, diff --git a/service/kafkaconnect/api_op_DescribeConnectorOperation.go b/service/kafkaconnect/api_op_DescribeConnectorOperation.go new file mode 100644 index 00000000000..2466c43fb82 --- /dev/null +++ b/service/kafkaconnect/api_op_DescribeConnectorOperation.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kafkaconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/kafkaconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns information about the specified connector's operations. +func (c *Client) DescribeConnectorOperation(ctx context.Context, params *DescribeConnectorOperationInput, optFns ...func(*Options)) (*DescribeConnectorOperationOutput, error) { + if params == nil { + params = &DescribeConnectorOperationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeConnectorOperation", params, optFns, c.addOperationDescribeConnectorOperationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeConnectorOperationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeConnectorOperationInput struct { + + // ARN of the connector operation to be described. + // + // This member is required. + ConnectorOperationArn *string + + noSmithyDocumentSerde +} + +type DescribeConnectorOperationOutput struct { + + // The Amazon Resource Name (ARN) of the connector. + ConnectorArn *string + + // The Amazon Resource Name (ARN) of the connector operation. + ConnectorOperationArn *string + + // The state of the connector operation. + ConnectorOperationState types.ConnectorOperationState + + // The type of connector operation performed. + ConnectorOperationType types.ConnectorOperationType + + // The time when the operation was created. + CreationTime *time.Time + + // The time when the operation ended. + EndTime *time.Time + + // Details about the state of a resource. + ErrorInfo *types.StateDescription + + // The array of operation steps taken. + OperationSteps []types.ConnectorOperationStep + + // The origin connector configuration. + OriginConnectorConfiguration map[string]string + + // The origin worker setting. + OriginWorkerSetting *types.WorkerSetting + + // The target connector configuration. + TargetConnectorConfiguration map[string]string + + // The target worker setting. + TargetWorkerSetting *types.WorkerSetting + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeConnectorOperationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeConnectorOperation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeConnectorOperation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeConnectorOperation"); 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 = addOpDescribeConnectorOperationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConnectorOperation(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 = 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_opDescribeConnectorOperation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeConnectorOperation", + } +} diff --git a/service/kafkaconnect/api_op_ListConnectorOperations.go b/service/kafkaconnect/api_op_ListConnectorOperations.go new file mode 100644 index 00000000000..b1ae01532f3 --- /dev/null +++ b/service/kafkaconnect/api_op_ListConnectorOperations.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kafkaconnect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/kafkaconnect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists information about a connector's operation(s). +func (c *Client) ListConnectorOperations(ctx context.Context, params *ListConnectorOperationsInput, optFns ...func(*Options)) (*ListConnectorOperationsOutput, error) { + if params == nil { + params = &ListConnectorOperationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListConnectorOperations", params, optFns, c.addOperationListConnectorOperationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListConnectorOperationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListConnectorOperationsInput struct { + + // The Amazon Resource Name (ARN) of the connector for which to list operations. + // + // This member is required. + ConnectorArn *string + + // Maximum number of connector operations to fetch in one get request. + MaxResults *int32 + + // If the response is truncated, it includes a NextToken. Send this NextToken in a + // subsequent request to continue listing from where it left off. + NextToken *string + + noSmithyDocumentSerde +} + +type ListConnectorOperationsOutput struct { + + // An array of connector operation descriptions. + ConnectorOperations []types.ConnectorOperationSummary + + // If the response is truncated, it includes a NextToken. Send this NextToken in a + // subsequent request to continue listing from where it left off. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListConnectorOperationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListConnectorOperations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConnectorOperations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListConnectorOperations"); 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 = addOpListConnectorOperationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListConnectorOperations(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 = 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 +} + +// ListConnectorOperationsPaginatorOptions is the paginator options for +// ListConnectorOperations +type ListConnectorOperationsPaginatorOptions struct { + // Maximum number of connector operations to fetch in one get request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListConnectorOperationsPaginator is a paginator for ListConnectorOperations +type ListConnectorOperationsPaginator struct { + options ListConnectorOperationsPaginatorOptions + client ListConnectorOperationsAPIClient + params *ListConnectorOperationsInput + nextToken *string + firstPage bool +} + +// NewListConnectorOperationsPaginator returns a new +// ListConnectorOperationsPaginator +func NewListConnectorOperationsPaginator(client ListConnectorOperationsAPIClient, params *ListConnectorOperationsInput, optFns ...func(*ListConnectorOperationsPaginatorOptions)) *ListConnectorOperationsPaginator { + if params == nil { + params = &ListConnectorOperationsInput{} + } + + options := ListConnectorOperationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListConnectorOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConnectorOperationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListConnectorOperations page. +func (p *ListConnectorOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConnectorOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListConnectorOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListConnectorOperationsAPIClient is a client that implements the +// ListConnectorOperations operation. +type ListConnectorOperationsAPIClient interface { + ListConnectorOperations(context.Context, *ListConnectorOperationsInput, ...func(*Options)) (*ListConnectorOperationsOutput, error) +} + +var _ ListConnectorOperationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListConnectorOperations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListConnectorOperations", + } +} diff --git a/service/kafkaconnect/api_op_ListConnectors.go b/service/kafkaconnect/api_op_ListConnectors.go index 64f4da3dba7..1327a4fc330 100644 --- a/service/kafkaconnect/api_op_ListConnectors.go +++ b/service/kafkaconnect/api_op_ListConnectors.go @@ -35,7 +35,7 @@ type ListConnectorsInput struct { ConnectorNamePrefix *string // The maximum number of connectors to list in one response. - MaxResults int32 + MaxResults *int32 // If the response of a ListConnectors operation is truncated, it will include a // NextToken. Send this NextToken in a subsequent request to continue listing from @@ -184,8 +184,8 @@ func NewListConnectorsPaginator(client ListConnectorsAPIClient, params *ListConn } options := ListConnectorsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -215,7 +215,11 @@ func (p *ListConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(* params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit optFns = append([]func(*Options){ addIsPaginatorUserAgent, diff --git a/service/kafkaconnect/api_op_ListCustomPlugins.go b/service/kafkaconnect/api_op_ListCustomPlugins.go index 32951f41dc4..b6ae709326f 100644 --- a/service/kafkaconnect/api_op_ListCustomPlugins.go +++ b/service/kafkaconnect/api_op_ListCustomPlugins.go @@ -30,7 +30,7 @@ func (c *Client) ListCustomPlugins(ctx context.Context, params *ListCustomPlugin type ListCustomPluginsInput struct { // The maximum number of custom plugins to list in one response. - MaxResults int32 + MaxResults *int32 // Lists custom plugin names that start with the specified text string. NamePrefix *string @@ -182,8 +182,8 @@ func NewListCustomPluginsPaginator(client ListCustomPluginsAPIClient, params *Li } options := ListCustomPluginsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -213,7 +213,11 @@ func (p *ListCustomPluginsPaginator) NextPage(ctx context.Context, optFns ...fun params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit optFns = append([]func(*Options){ addIsPaginatorUserAgent, diff --git a/service/kafkaconnect/api_op_ListWorkerConfigurations.go b/service/kafkaconnect/api_op_ListWorkerConfigurations.go index 529ab97aa82..a10944afee6 100644 --- a/service/kafkaconnect/api_op_ListWorkerConfigurations.go +++ b/service/kafkaconnect/api_op_ListWorkerConfigurations.go @@ -30,7 +30,7 @@ func (c *Client) ListWorkerConfigurations(ctx context.Context, params *ListWorke type ListWorkerConfigurationsInput struct { // The maximum number of worker configurations to list in one response. - MaxResults int32 + MaxResults *int32 // Lists worker configuration names that start with the specified text string. NamePrefix *string @@ -184,8 +184,8 @@ func NewListWorkerConfigurationsPaginator(client ListWorkerConfigurationsAPIClie } options := ListWorkerConfigurationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -215,7 +215,11 @@ func (p *ListWorkerConfigurationsPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit optFns = append([]func(*Options){ addIsPaginatorUserAgent, diff --git a/service/kafkaconnect/api_op_UpdateConnector.go b/service/kafkaconnect/api_op_UpdateConnector.go index 4ebe6935114..cebc17051c0 100644 --- a/service/kafkaconnect/api_op_UpdateConnector.go +++ b/service/kafkaconnect/api_op_UpdateConnector.go @@ -29,11 +29,6 @@ func (c *Client) UpdateConnector(ctx context.Context, params *UpdateConnectorInp type UpdateConnectorInput struct { - // The target capacity. - // - // This member is required. - Capacity *types.CapacityUpdate - // The Amazon Resource Name (ARN) of the connector that you want to update. // // This member is required. @@ -44,6 +39,12 @@ type UpdateConnectorInput struct { // This member is required. CurrentVersion *string + // The target capacity. + Capacity *types.CapacityUpdate + + // A map of keys to values that represent the configuration for the connector. + ConnectorConfiguration map[string]string + noSmithyDocumentSerde } @@ -52,6 +53,9 @@ type UpdateConnectorOutput struct { // The Amazon Resource Name (ARN) of the connector. ConnectorArn *string + // The Amazon Resource Name (ARN) of the connector operation. + ConnectorOperationArn *string + // The state of the connector. ConnectorState types.ConnectorState diff --git a/service/kafkaconnect/deserializers.go b/service/kafkaconnect/deserializers.go index 5066d0ad8c2..b439e67a26a 100644 --- a/service/kafkaconnect/deserializers.go +++ b/service/kafkaconnect/deserializers.go @@ -1365,7 +1365,7 @@ func awsRestjson1_deserializeOpDocumentDescribeConnectorOutput(v **DescribeConne } case "connectorConfiguration": - if err := awsRestjson1_deserializeDocument__sensitive__mapOf__string(&sv.ConnectorConfiguration, value); err != nil { + if err := awsRestjson1_deserializeDocumentConnectorConfiguration(&sv.ConnectorConfiguration, value); err != nil { return err } @@ -1480,6 +1480,263 @@ func awsRestjson1_deserializeOpDocumentDescribeConnectorOutput(v **DescribeConne return nil } +type awsRestjson1_deserializeOpDescribeConnectorOperation struct { +} + +func (*awsRestjson1_deserializeOpDescribeConnectorOperation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeConnectorOperation) 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, awsRestjson1_deserializeOpErrorDescribeConnectorOperation(response, &metadata) + } + output := &DescribeConnectorOperationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDescribeConnectorOperationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeConnectorOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeConnectorOperationOutput(v **DescribeConnectorOperationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeConnectorOperationOutput + if *v == nil { + sv = &DescribeConnectorOperationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ConnectorArn = ptr.String(jtv) + } + + case "connectorOperationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ConnectorOperationArn = ptr.String(jtv) + } + + case "connectorOperationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectorOperationState to be of type string, got %T instead", value) + } + sv.ConnectorOperationState = types.ConnectorOperationState(jtv) + } + + case "connectorOperationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectorOperationType to be of type string, got %T instead", value) + } + sv.ConnectorOperationType = types.ConnectorOperationType(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) + } + + case "errorInfo": + if err := awsRestjson1_deserializeDocumentStateDescription(&sv.ErrorInfo, value); err != nil { + return err + } + + case "operationSteps": + if err := awsRestjson1_deserializeDocument__listOfConnectorOperationStep(&sv.OperationSteps, value); err != nil { + return err + } + + case "originConnectorConfiguration": + if err := awsRestjson1_deserializeDocumentConnectorConfiguration(&sv.OriginConnectorConfiguration, value); err != nil { + return err + } + + case "originWorkerSetting": + if err := awsRestjson1_deserializeDocumentWorkerSetting(&sv.OriginWorkerSetting, value); err != nil { + return err + } + + case "targetConnectorConfiguration": + if err := awsRestjson1_deserializeDocumentConnectorConfiguration(&sv.TargetConnectorConfiguration, value); err != nil { + return err + } + + case "targetWorkerSetting": + if err := awsRestjson1_deserializeDocumentWorkerSetting(&sv.TargetWorkerSetting, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDescribeCustomPlugin struct { } @@ -1923,6 +2180,185 @@ func awsRestjson1_deserializeOpDocumentDescribeWorkerConfigurationOutput(v **Des return nil } +type awsRestjson1_deserializeOpListConnectorOperations struct { +} + +func (*awsRestjson1_deserializeOpListConnectorOperations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListConnectorOperations) 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, awsRestjson1_deserializeOpErrorListConnectorOperations(response, &metadata) + } + output := &ListConnectorOperationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListConnectorOperationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListConnectorOperations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InternalServerErrorException", errorCode): + return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListConnectorOperationsOutput(v **ListConnectorOperationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListConnectorOperationsOutput + if *v == nil { + sv = &ListConnectorOperationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectorOperations": + if err := awsRestjson1_deserializeDocument__listOfConnectorOperationSummary(&sv.ConnectorOperations, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListConnectors struct { } @@ -3010,6 +3446,15 @@ func awsRestjson1_deserializeOpDocumentUpdateConnectorOutput(v **UpdateConnector sv.ConnectorArn = ptr.String(jtv) } + case "connectorOperationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ConnectorOperationArn = ptr.String(jtv) + } + case "connectorState": if value != nil { jtv, ok := value.(string) @@ -3299,24 +3744,94 @@ func awsRestjson1_deserializeErrorUnauthorizedException(response *smithyhttp.Res return err } - err := awsRestjson1_deserializeDocumentUnauthorizedException(&output, shape) + err := awsRestjson1_deserializeDocumentUnauthorizedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocument__listOf__string(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocument__listOfConnectorOperationStep(v *[]types.ConnectorOperationStep, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + var cv []types.ConnectorOperationStep + if *v == nil { + cv = []types.ConnectorOperationStep{} + } else { + cv = *v } - errorBody.Seek(0, io.SeekStart) + for _, value := range shape { + var col types.ConnectorOperationStep + destAddr := &col + if err := awsRestjson1_deserializeDocumentConnectorOperationStep(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) - return output + } + *v = cv + return nil } -func awsRestjson1_deserializeDocument__listOf__string(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocument__listOfConnectorOperationSummary(v *[]types.ConnectorOperationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3329,22 +3844,20 @@ func awsRestjson1_deserializeDocument__listOf__string(v *[]string, value interfa return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.ConnectorOperationSummary if *v == nil { - cv = []string{} + cv = []types.ConnectorOperationSummary{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - col = jtv + var col types.ConnectorOperationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentConnectorOperationSummary(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -3488,42 +4001,6 @@ func awsRestjson1_deserializeDocument__listOfWorkerConfigurationSummary(v *[]typ return nil } -func awsRestjson1_deserializeDocument__sensitive__mapOf__string(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - func awsRestjson1_deserializeDocumentApacheKafkaClusterDescription(v **types.ApacheKafkaClusterDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3819,6 +4296,175 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsRestjson1_deserializeDocumentConnectorConfiguration(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentConnectorOperationStep(v **types.ConnectorOperationStep, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConnectorOperationStep + if *v == nil { + sv = &types.ConnectorOperationStep{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "stepState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectorOperationStepState to be of type string, got %T instead", value) + } + sv.StepState = types.ConnectorOperationStepState(jtv) + } + + case "stepType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectorOperationStepType to be of type string, got %T instead", value) + } + sv.StepType = types.ConnectorOperationStepType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConnectorOperationSummary(v **types.ConnectorOperationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConnectorOperationSummary + if *v == nil { + sv = &types.ConnectorOperationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectorOperationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ConnectorOperationArn = ptr.String(jtv) + } + + case "connectorOperationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectorOperationState to be of type string, got %T instead", value) + } + sv.ConnectorOperationState = types.ConnectorOperationState(jtv) + } + + case "connectorOperationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectorOperationType to be of type string, got %T instead", value) + } + sv.ConnectorOperationType = types.ConnectorOperationType(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentConnectorSummary(v **types.ConnectorSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5461,3 +6107,39 @@ func awsRestjson1_deserializeDocumentWorkerLogDeliveryDescription(v **types.Work *v = sv return nil } + +func awsRestjson1_deserializeDocumentWorkerSetting(v **types.WorkerSetting, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WorkerSetting + if *v == nil { + sv = &types.WorkerSetting{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "capacity": + if err := awsRestjson1_deserializeDocumentCapacityDescription(&sv.Capacity, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/kafkaconnect/generated.json b/service/kafkaconnect/generated.json index 596ca89af5a..b0ba2d80953 100644 --- a/service/kafkaconnect/generated.json +++ b/service/kafkaconnect/generated.json @@ -15,8 +15,10 @@ "api_op_DeleteCustomPlugin.go", "api_op_DeleteWorkerConfiguration.go", "api_op_DescribeConnector.go", + "api_op_DescribeConnectorOperation.go", "api_op_DescribeCustomPlugin.go", "api_op_DescribeWorkerConfiguration.go", + "api_op_ListConnectorOperations.go", "api_op_ListConnectors.go", "api_op_ListCustomPlugins.go", "api_op_ListTagsForResource.go", diff --git a/service/kafkaconnect/serializers.go b/service/kafkaconnect/serializers.go index 13e19957c1d..1e11b932987 100644 --- a/service/kafkaconnect/serializers.go +++ b/service/kafkaconnect/serializers.go @@ -97,7 +97,7 @@ func awsRestjson1_serializeOpDocumentCreateConnectorInput(v *CreateConnectorInpu if v.ConnectorConfiguration != nil { ok := object.Key("connectorConfiguration") - if err := awsRestjson1_serializeDocument__sensitive__mapOf__string(v.ConnectorConfiguration, ok); err != nil { + if err := awsRestjson1_serializeDocumentConnectorConfiguration(v.ConnectorConfiguration, ok); err != nil { return err } } @@ -665,6 +665,77 @@ func awsRestjson1_serializeOpHttpBindingsDescribeConnectorInput(v *DescribeConne return nil } +type awsRestjson1_serializeOpDescribeConnectorOperation struct { +} + +func (*awsRestjson1_serializeOpDescribeConnectorOperation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeConnectorOperation) 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.(*DescribeConnectorOperationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/connectorOperations/{connectorOperationArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeConnectorOperationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribeConnectorOperationInput(v *DescribeConnectorOperationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectorOperationArn == nil || len(*v.ConnectorOperationArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectorOperationArn must not be empty")} + } + if v.ConnectorOperationArn != nil { + if err := encoder.SetURI("connectorOperationArn").String(*v.ConnectorOperationArn); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeCustomPlugin struct { } @@ -807,6 +878,85 @@ func awsRestjson1_serializeOpHttpBindingsDescribeWorkerConfigurationInput(v *Des return nil } +type awsRestjson1_serializeOpListConnectorOperations struct { +} + +func (*awsRestjson1_serializeOpListConnectorOperations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListConnectorOperations) 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.(*ListConnectorOperationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/connectors/{connectorArn}/operations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListConnectorOperationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListConnectorOperationsInput(v *ListConnectorOperationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectorArn == nil || len(*v.ConnectorArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member connectorArn must not be empty")} + } + if v.ConnectorArn != nil { + if err := encoder.SetURI("connectorArn").String(*v.ConnectorArn); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListConnectors struct { } @@ -870,8 +1020,8 @@ func awsRestjson1_serializeOpHttpBindingsListConnectorsInput(v *ListConnectorsIn encoder.SetQuery("connectorNamePrefix").String(*v.ConnectorNamePrefix) } - if v.MaxResults != 0 { - encoder.SetQuery("maxResults").Integer(v.MaxResults) + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { @@ -940,8 +1090,8 @@ func awsRestjson1_serializeOpHttpBindingsListCustomPluginsInput(v *ListCustomPlu return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MaxResults != 0 { - encoder.SetQuery("maxResults").Integer(v.MaxResults) + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NamePrefix != nil { @@ -1085,8 +1235,8 @@ func awsRestjson1_serializeOpHttpBindingsListWorkerConfigurationsInput(v *ListWo return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MaxResults != 0 { - encoder.SetQuery("maxResults").Integer(v.MaxResults) + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NamePrefix != nil { @@ -1370,6 +1520,13 @@ func awsRestjson1_serializeOpDocumentUpdateConnectorInput(v *UpdateConnectorInpu } } + if v.ConnectorConfiguration != nil { + ok := object.Key("connectorConfiguration") + if err := awsRestjson1_serializeDocumentConnectorConfigurationUpdate(v.ConnectorConfiguration, ok); err != nil { + return err + } + } + return nil } @@ -1397,17 +1554,6 @@ func awsRestjson1_serializeDocument__listOfPlugin(v []types.Plugin, value smithy return nil } -func awsRestjson1_serializeDocument__sensitive__mapOf__string(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - func awsRestjson1_serializeDocumentApacheKafkaCluster(v *types.ApacheKafkaCluster, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1558,6 +1704,28 @@ func awsRestjson1_serializeDocumentCloudWatchLogsLogDelivery(v *types.CloudWatch return nil } +func awsRestjson1_serializeDocumentConnectorConfiguration(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentConnectorConfigurationUpdate(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + func awsRestjson1_serializeDocumentCustomPlugin(v *types.CustomPlugin, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/kafkaconnect/snapshot/api_op_DescribeConnectorOperation.go.snap b/service/kafkaconnect/snapshot/api_op_DescribeConnectorOperation.go.snap new file mode 100644 index 00000000000..e16c822b946 --- /dev/null +++ b/service/kafkaconnect/snapshot/api_op_DescribeConnectorOperation.go.snap @@ -0,0 +1,41 @@ +DescribeConnectorOperation + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/kafkaconnect/snapshot/api_op_ListConnectorOperations.go.snap b/service/kafkaconnect/snapshot/api_op_ListConnectorOperations.go.snap new file mode 100644 index 00000000000..1f82537e6b8 --- /dev/null +++ b/service/kafkaconnect/snapshot/api_op_ListConnectorOperations.go.snap @@ -0,0 +1,41 @@ +ListConnectorOperations + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/kafkaconnect/snapshot_test.go b/service/kafkaconnect/snapshot_test.go index 03d6538d9f0..b3de2c37838 100644 --- a/service/kafkaconnect/snapshot_test.go +++ b/service/kafkaconnect/snapshot_test.go @@ -146,6 +146,18 @@ func TestCheckSnapshot_DescribeConnector(t *testing.T) { } } +func TestCheckSnapshot_DescribeConnectorOperation(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeConnectorOperation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeConnectorOperation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeCustomPlugin(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeCustomPlugin(context.Background(), nil, func(o *Options) { @@ -170,6 +182,18 @@ func TestCheckSnapshot_DescribeWorkerConfiguration(t *testing.T) { } } +func TestCheckSnapshot_ListConnectorOperations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConnectorOperations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListConnectorOperations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListConnectors(t *testing.T) { svc := New(Options{}) _, err := svc.ListConnectors(context.Background(), nil, func(o *Options) { @@ -337,6 +361,18 @@ func TestUpdateSnapshot_DescribeConnector(t *testing.T) { } } +func TestUpdateSnapshot_DescribeConnectorOperation(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeConnectorOperation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeConnectorOperation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeCustomPlugin(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeCustomPlugin(context.Background(), nil, func(o *Options) { @@ -361,6 +397,18 @@ func TestUpdateSnapshot_DescribeWorkerConfiguration(t *testing.T) { } } +func TestUpdateSnapshot_ListConnectorOperations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConnectorOperations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListConnectorOperations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListConnectors(t *testing.T) { svc := New(Options{}) _, err := svc.ListConnectors(context.Background(), nil, func(o *Options) { diff --git a/service/kafkaconnect/types/enums.go b/service/kafkaconnect/types/enums.go index b3740d9276d..a0035dcb070 100644 --- a/service/kafkaconnect/types/enums.go +++ b/service/kafkaconnect/types/enums.go @@ -2,6 +2,108 @@ package types +type ConnectorOperationState string + +// Enum values for ConnectorOperationState +const ( + ConnectorOperationStatePending ConnectorOperationState = "PENDING" + ConnectorOperationStateUpdateInProgress ConnectorOperationState = "UPDATE_IN_PROGRESS" + ConnectorOperationStateUpdateComplete ConnectorOperationState = "UPDATE_COMPLETE" + ConnectorOperationStateUpdateFailed ConnectorOperationState = "UPDATE_FAILED" + ConnectorOperationStateRollbackInProgress ConnectorOperationState = "ROLLBACK_IN_PROGRESS" + ConnectorOperationStateRollbackFailed ConnectorOperationState = "ROLLBACK_FAILED" + ConnectorOperationStateRollbackComplete ConnectorOperationState = "ROLLBACK_COMPLETE" +) + +// Values returns all known values for ConnectorOperationState. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ConnectorOperationState) Values() []ConnectorOperationState { + return []ConnectorOperationState{ + "PENDING", + "UPDATE_IN_PROGRESS", + "UPDATE_COMPLETE", + "UPDATE_FAILED", + "ROLLBACK_IN_PROGRESS", + "ROLLBACK_FAILED", + "ROLLBACK_COMPLETE", + } +} + +type ConnectorOperationStepState string + +// Enum values for ConnectorOperationStepState +const ( + ConnectorOperationStepStatePending ConnectorOperationStepState = "PENDING" + ConnectorOperationStepStateInProgress ConnectorOperationStepState = "IN_PROGRESS" + ConnectorOperationStepStateCompleted ConnectorOperationStepState = "COMPLETED" + ConnectorOperationStepStateFailed ConnectorOperationStepState = "FAILED" + ConnectorOperationStepStateCancelled ConnectorOperationStepState = "CANCELLED" +) + +// Values returns all known values for ConnectorOperationStepState. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ConnectorOperationStepState) Values() []ConnectorOperationStepState { + return []ConnectorOperationStepState{ + "PENDING", + "IN_PROGRESS", + "COMPLETED", + "FAILED", + "CANCELLED", + } +} + +type ConnectorOperationStepType string + +// Enum values for ConnectorOperationStepType +const ( + ConnectorOperationStepTypeInitializeUpdate ConnectorOperationStepType = "INITIALIZE_UPDATE" + ConnectorOperationStepTypeFinalizeUpdate ConnectorOperationStepType = "FINALIZE_UPDATE" + ConnectorOperationStepTypeUpdateWorkerSetting ConnectorOperationStepType = "UPDATE_WORKER_SETTING" + ConnectorOperationStepTypeUpdateConnectorConfiguration ConnectorOperationStepType = "UPDATE_CONNECTOR_CONFIGURATION" + ConnectorOperationStepTypeValidateUpdate ConnectorOperationStepType = "VALIDATE_UPDATE" +) + +// Values returns all known values for ConnectorOperationStepType. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ConnectorOperationStepType) Values() []ConnectorOperationStepType { + return []ConnectorOperationStepType{ + "INITIALIZE_UPDATE", + "FINALIZE_UPDATE", + "UPDATE_WORKER_SETTING", + "UPDATE_CONNECTOR_CONFIGURATION", + "VALIDATE_UPDATE", + } +} + +type ConnectorOperationType string + +// Enum values for ConnectorOperationType +const ( + ConnectorOperationTypeUpdateWorkerSetting ConnectorOperationType = "UPDATE_WORKER_SETTING" + ConnectorOperationTypeUpdateConnectorConfiguration ConnectorOperationType = "UPDATE_CONNECTOR_CONFIGURATION" + ConnectorOperationTypeIsolateConnector ConnectorOperationType = "ISOLATE_CONNECTOR" + ConnectorOperationTypeRestoreConnector ConnectorOperationType = "RESTORE_CONNECTOR" +) + +// Values returns all known values for ConnectorOperationType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ConnectorOperationType) Values() []ConnectorOperationType { + return []ConnectorOperationType{ + "UPDATE_WORKER_SETTING", + "UPDATE_CONNECTOR_CONFIGURATION", + "ISOLATE_CONNECTOR", + "RESTORE_CONNECTOR", + } +} + type ConnectorState string // Enum values for ConnectorState diff --git a/service/kafkaconnect/types/types.go b/service/kafkaconnect/types/types.go index 9b7973137c3..53c44ac47db 100644 --- a/service/kafkaconnect/types/types.go +++ b/service/kafkaconnect/types/types.go @@ -183,6 +183,39 @@ type CloudWatchLogsLogDeliveryDescription struct { noSmithyDocumentSerde } +// Details of a step that is involved in a connector's operation. +type ConnectorOperationStep struct { + + // The step state of the operation. + StepState ConnectorOperationStepState + + // The step type of the operation. + StepType ConnectorOperationStepType + + noSmithyDocumentSerde +} + +// Summary of a connector operation. +type ConnectorOperationSummary struct { + + // The Amazon Resource Name (ARN) of the connector operation. + ConnectorOperationArn *string + + // The state of the connector operation. + ConnectorOperationState ConnectorOperationState + + // The type of connector operation performed. + ConnectorOperationType ConnectorOperationType + + // The time when operation was created. + CreationTime *time.Time + + // The time when operation ended. + EndTime *time.Time + + noSmithyDocumentSerde +} + // Summary of a connector. type ConnectorSummary struct { @@ -825,4 +858,13 @@ type WorkerLogDeliveryDescription struct { noSmithyDocumentSerde } +// Details about worker setting of a connector +type WorkerSetting struct { + + // A description of the connector's capacity. + Capacity *CapacityDescription + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/kafkaconnect/validators.go b/service/kafkaconnect/validators.go index 9d7439a7164..ed1180e2fb0 100644 --- a/service/kafkaconnect/validators.go +++ b/service/kafkaconnect/validators.go @@ -150,6 +150,26 @@ func (m *validateOpDescribeConnector) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDescribeConnectorOperation struct { +} + +func (*validateOpDescribeConnectorOperation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeConnectorOperation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeConnectorOperationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeConnectorOperationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeCustomPlugin struct { } @@ -190,6 +210,26 @@ func (m *validateOpDescribeWorkerConfiguration) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpListConnectorOperations struct { +} + +func (*validateOpListConnectorOperations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListConnectorOperations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListConnectorOperationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListConnectorOperationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -298,6 +338,10 @@ func addOpDescribeConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConnector{}, middleware.After) } +func addOpDescribeConnectorOperationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeConnectorOperation{}, middleware.After) +} + func addOpDescribeCustomPluginValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCustomPlugin{}, middleware.After) } @@ -306,6 +350,10 @@ func addOpDescribeWorkerConfigurationValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpDescribeWorkerConfiguration{}, middleware.After) } +func addOpListConnectorOperationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListConnectorOperations{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -929,6 +977,21 @@ func validateOpDescribeConnectorInput(v *DescribeConnectorInput) error { } } +func validateOpDescribeConnectorOperationInput(v *DescribeConnectorOperationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeConnectorOperationInput"} + if v.ConnectorOperationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectorOperationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeCustomPluginInput(v *DescribeCustomPluginInput) error { if v == nil { return nil @@ -959,6 +1022,21 @@ func validateOpDescribeWorkerConfigurationInput(v *DescribeWorkerConfigurationIn } } +func validateOpListConnectorOperationsInput(v *ListConnectorOperationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListConnectorOperationsInput"} + if v.ConnectorArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectorArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -1015,9 +1093,7 @@ func validateOpUpdateConnectorInput(v *UpdateConnectorInput) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateConnectorInput"} - if v.Capacity == nil { - invalidParams.Add(smithy.NewErrParamRequired("Capacity")) - } else if v.Capacity != nil { + if v.Capacity != nil { if err := validateCapacityUpdate(v.Capacity); err != nil { invalidParams.AddNested("Capacity", err.(smithy.InvalidParamsError)) } diff --git a/service/snowball/internal/endpoints/endpoints.go b/service/snowball/internal/endpoints/endpoints.go index 3b0700c1133..f1e9af62c79 100644 --- a/service/snowball/internal/endpoints/endpoints.go +++ b/service/snowball/internal/endpoints/endpoints.go @@ -148,6 +148,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.af-south-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.af-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.af-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, @@ -157,6 +169,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, @@ -166,6 +190,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-northeast-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-northeast-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-northeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, @@ -175,6 +211,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-northeast-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-northeast-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-northeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, @@ -184,6 +232,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-northeast-3.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-northeast-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-northeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, @@ -193,6 +253,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-south-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, @@ -202,6 +274,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-southeast-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-southeast-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-southeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, @@ -211,6 +295,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-southeast-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-southeast-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-southeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, @@ -220,6 +316,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ap-southeast-3.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ap-southeast-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ap-southeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, @@ -229,6 +337,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.ca-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.ca-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, @@ -238,6 +358,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.eu-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.eu-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.eu-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, @@ -247,6 +379,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.eu-north-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.eu-north-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.eu-north-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, @@ -256,6 +400,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.eu-south-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.eu-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.eu-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, @@ -265,6 +421,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.eu-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.eu-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.eu-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, @@ -274,6 +442,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.eu-west-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.eu-west-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, @@ -283,6 +463,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.eu-west-3.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.eu-west-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.eu-west-3.api.aws", + }, endpoints.EndpointKey{ Region: "fips-af-south-1", }: endpoints.Endpoint{ @@ -499,6 +691,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.il-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.il-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.il-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, @@ -508,6 +712,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.me-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "me-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.me-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "me-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.me-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, @@ -517,6 +733,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.sa-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.sa-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.sa-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, @@ -526,6 +754,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.us-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.us-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, @@ -535,6 +775,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.us-east-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.us-east-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -544,6 +796,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.us-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.us-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, @@ -553,6 +817,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "snowball-fips.us-west-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "snowball-fips.us-west-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "snowball.us-west-2.api.aws", + }, }, }, { diff --git a/service/transcribe/api_op_CreateCallAnalyticsCategory.go b/service/transcribe/api_op_CreateCallAnalyticsCategory.go index 10e84601572..ab6c09f82a7 100644 --- a/service/transcribe/api_op_CreateCallAnalyticsCategory.go +++ b/service/transcribe/api_op_CreateCallAnalyticsCategory.go @@ -83,6 +83,14 @@ type CreateCallAnalyticsCategoryInput struct { // category by default. InputType types.InputType + // Adds one or more custom tags, each in the form of a key:value pair, to a new + // call analytics category at the time you start this new job. + // + // To learn more about using tags with Amazon Transcribe, refer to [Tagging resources]. + // + // [Tagging resources]: https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html + Tags []types.Tag + noSmithyDocumentSerde } diff --git a/service/transcribe/api_op_StartCallAnalyticsJob.go b/service/transcribe/api_op_StartCallAnalyticsJob.go index ccc01b98d23..b056a5fcc12 100644 --- a/service/transcribe/api_op_StartCallAnalyticsJob.go +++ b/service/transcribe/api_op_StartCallAnalyticsJob.go @@ -171,6 +171,14 @@ type StartCallAnalyticsJobInput struct { // custom vocabularies to your Call Analytics job. Settings *types.CallAnalyticsJobSettings + // Adds one or more custom tags, each in the form of a key:value pair, to a new + // call analytics job at the time you start this new job. + // + // To learn more about using tags with Amazon Transcribe, refer to [Tagging resources]. + // + // [Tagging resources]: https://docs.aws.amazon.com/transcribe/latest/dg/tagging.html + Tags []types.Tag + noSmithyDocumentSerde } diff --git a/service/transcribe/deserializers.go b/service/transcribe/deserializers.go index 61edfa8f554..3779397174b 100644 --- a/service/transcribe/deserializers.go +++ b/service/transcribe/deserializers.go @@ -5499,6 +5499,11 @@ func awsAwsjson11_deserializeDocumentCallAnalyticsJob(v **types.CallAnalyticsJob } } + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + case "Transcript": if err := awsAwsjson11_deserializeDocumentTranscript(&sv.Transcript, value); err != nil { return err @@ -5959,6 +5964,11 @@ func awsAwsjson11_deserializeDocumentCategoryProperties(v **types.CategoryProper return err } + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + default: _, _ = key, value diff --git a/service/transcribe/serializers.go b/service/transcribe/serializers.go index b3ec14a3af3..a7de90aa85d 100644 --- a/service/transcribe/serializers.go +++ b/service/transcribe/serializers.go @@ -3475,6 +3475,13 @@ func awsAwsjson11_serializeOpDocumentCreateCallAnalyticsCategoryInput(v *CreateC } } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + return nil } @@ -4126,6 +4133,13 @@ func awsAwsjson11_serializeOpDocumentStartCallAnalyticsJobInput(v *StartCallAnal } } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + return nil } diff --git a/service/transcribe/types/types.go b/service/transcribe/types/types.go index 629aabd81fe..5abd651ab9b 100644 --- a/service/transcribe/types/types.go +++ b/service/transcribe/types/types.go @@ -180,6 +180,10 @@ type CallAnalyticsJob struct { // processing at 12:32 PM UTC-7 on May 4, 2022. StartTime *time.Time + // The tags, each in the form of a key:value pair, assigned to the specified call + // analytics job. + Tags []Tag + // Provides you with the Amazon S3 URI you can use to access your transcript. Transcript *Transcript @@ -401,6 +405,10 @@ type CategoryProperties struct { // between 1 and 20 rules. Rules []Rule + // The tags, each in the form of a key:value pair, assigned to the specified call + // analytics category. + Tags []Tag + noSmithyDocumentSerde } diff --git a/service/transcribe/validators.go b/service/transcribe/validators.go index 371ca77170d..eff812efe07 100644 --- a/service/transcribe/validators.go +++ b/service/transcribe/validators.go @@ -1087,6 +1087,11 @@ func validateOpCreateCallAnalyticsCategoryInput(v *CreateCallAnalyticsCategoryIn invalidParams.AddNested("Rules", 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 { @@ -1500,6 +1505,11 @@ func validateOpStartCallAnalyticsJobInput(v *StartCallAnalyticsJobInput) error { invalidParams.AddNested("Settings", 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 {