From 70f736c5dc0b8652c5fe5c387b2165c3b9beddb1 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 30 Jan 2025 19:38:10 +0000 Subject: [PATCH] Regenerated Clients --- .../2b525fd08a9340278f0c7e70b9707ba6.json | 8 + .../355afaca142b43d39b0cd7b6cb210101.json | 8 + .../619a6e9b6a79468cb78d669cb86e16ef.json | 8 + .../a7916fd8764c4a2e8fca8c665953c658.json | 8 + .../cb88ccc2b28d4c35b0b173ee0fb5f7a5.json | 8 + .../cbf1afe1dce84b43a494ed0a8544af56.json | 8 + .../e1b2ea069ebc4c87984e4650427ed505.json | 8 + .../f7e2474d52b54f6e94ab6818cb3dcb51.json | 8 + service/appstream/deserializers.go | 5 + service/appstream/serializers.go | 7 + service/appstream/types/types.go | 5 + .../api_op_RetrieveAndGenerateStream.go | 2 + service/bedrockagentruntime/deserializers.go | 9 + service/bedrockagentruntime/types/errors.go | 2 + service/ecr/endpoints.go | 95 - service/ecr/endpoints_test.go | 1975 ++--------------- service/ecrpublic/endpoints.go | 19 - service/ecrpublic/endpoints_test.go | 109 +- ...p_ConfigureLogsForPlaybackConfiguration.go | 5 +- .../api_op_GetPlaybackConfiguration.go | 9 +- .../api_op_PutPlaybackConfiguration.go | 15 +- service/mediatailor/deserializers.go | 55 + service/mediatailor/serializers.go | 19 + service/mediatailor/types/enums.go | 20 + service/mediatailor/types/types.go | 37 +- service/mediatailor/validators.go | 20 + .../qbusiness/api_op_AssociatePermission.go | 18 +- .../qbusiness/api_op_CancelSubscription.go | 172 ++ .../qbusiness/api_op_CreateDataAccessor.go | 20 +- .../qbusiness/api_op_CreateSubscription.go | 225 ++ .../qbusiness/api_op_DeleteDataAccessor.go | 6 +- .../api_op_DisassociatePermission.go | 4 +- service/qbusiness/api_op_GetDataAccessor.go | 10 +- service/qbusiness/api_op_GetPolicy.go | 8 +- service/qbusiness/api_op_ListDataAccessors.go | 10 +- service/qbusiness/api_op_ListSubscriptions.go | 264 +++ service/qbusiness/api_op_PutGroup.go | 10 +- .../qbusiness/api_op_SearchRelevantContent.go | 16 +- .../qbusiness/api_op_UpdateDataAccessor.go | 2 +- .../qbusiness/api_op_UpdateSubscription.go | 180 ++ service/qbusiness/deserializers.go | 1115 +++++++++- service/qbusiness/generated.json | 4 + service/qbusiness/serializers.go | 388 ++++ .../api_op_CancelSubscription.go.snap | 41 + .../api_op_CreateSubscription.go.snap | 42 + .../snapshot/api_op_ListSubscriptions.go.snap | 41 + .../api_op_UpdateSubscription.go.snap | 41 + service/qbusiness/snapshot_test.go | 96 + service/qbusiness/types/types.go | 77 +- .../qbusiness/types/types_exported_test.go | 22 + service/qbusiness/validators.go | 171 ++ service/s3tables/api_op_CreateNamespace.go | 8 +- service/s3tables/api_op_CreateTable.go | 14 +- service/s3tables/api_op_CreateTableBucket.go | 8 +- service/s3tables/api_op_DeleteNamespace.go | 8 +- service/s3tables/api_op_DeleteTable.go | 8 +- service/s3tables/api_op_DeleteTableBucket.go | 8 +- .../api_op_DeleteTableBucketPolicy.go | 10 +- service/s3tables/api_op_DeleteTablePolicy.go | 10 +- service/s3tables/api_op_GetNamespace.go | 8 +- service/s3tables/api_op_GetTable.go | 8 +- service/s3tables/api_op_GetTableBucket.go | 8 +- ..._GetTableBucketMaintenanceConfiguration.go | 8 +- .../s3tables/api_op_GetTableBucketPolicy.go | 12 +- ...api_op_GetTableMaintenanceConfiguration.go | 8 +- .../api_op_GetTableMaintenanceJobStatus.go | 8 +- .../api_op_GetTableMetadataLocation.go | 3 + service/s3tables/api_op_GetTablePolicy.go | 12 +- service/s3tables/api_op_ListNamespaces.go | 8 +- service/s3tables/api_op_ListTableBuckets.go | 8 +- service/s3tables/api_op_ListTables.go | 10 +- ..._PutTableBucketMaintenanceConfiguration.go | 8 +- .../s3tables/api_op_PutTableBucketPolicy.go | 12 +- ...api_op_PutTableMaintenanceConfiguration.go | 8 +- service/s3tables/api_op_PutTablePolicy.go | 12 +- service/s3tables/api_op_RenameTable.go | 8 +- .../api_op_UpdateTableMetadataLocation.go | 10 +- service/s3tables/serializers.go | 88 + service/s3tables/types/types.go | 69 +- service/s3tables/types/types_exported_test.go | 18 + service/s3tables/validators.go | 98 + service/sqs/internal/endpoints/endpoints.go | 30 + service/verifiedpermissions/deserializers.go | 12 + service/verifiedpermissions/serializers.go | 8 + service/verifiedpermissions/types/types.go | 34 + .../types/types_exported_test.go | 8 + 86 files changed, 3842 insertions(+), 2211 deletions(-) create mode 100644 .changelog/2b525fd08a9340278f0c7e70b9707ba6.json create mode 100644 .changelog/355afaca142b43d39b0cd7b6cb210101.json create mode 100644 .changelog/619a6e9b6a79468cb78d669cb86e16ef.json create mode 100644 .changelog/a7916fd8764c4a2e8fca8c665953c658.json create mode 100644 .changelog/cb88ccc2b28d4c35b0b173ee0fb5f7a5.json create mode 100644 .changelog/cbf1afe1dce84b43a494ed0a8544af56.json create mode 100644 .changelog/e1b2ea069ebc4c87984e4650427ed505.json create mode 100644 .changelog/f7e2474d52b54f6e94ab6818cb3dcb51.json create mode 100644 service/qbusiness/api_op_CancelSubscription.go create mode 100644 service/qbusiness/api_op_CreateSubscription.go create mode 100644 service/qbusiness/api_op_ListSubscriptions.go create mode 100644 service/qbusiness/api_op_UpdateSubscription.go create mode 100644 service/qbusiness/snapshot/api_op_CancelSubscription.go.snap create mode 100644 service/qbusiness/snapshot/api_op_CreateSubscription.go.snap create mode 100644 service/qbusiness/snapshot/api_op_ListSubscriptions.go.snap create mode 100644 service/qbusiness/snapshot/api_op_UpdateSubscription.go.snap diff --git a/.changelog/2b525fd08a9340278f0c7e70b9707ba6.json b/.changelog/2b525fd08a9340278f0c7e70b9707ba6.json new file mode 100644 index 00000000000..6d205b1502d --- /dev/null +++ b/.changelog/2b525fd08a9340278f0c7e70b9707ba6.json @@ -0,0 +1,8 @@ +{ + "id": "2b525fd0-8a93-4027-8f0c-7e70b9707ba6", + "type": "feature", + "description": "Temporarily updating dualstack endpoint support", + "modules": [ + "service/ecrpublic" + ] +} \ No newline at end of file diff --git a/.changelog/355afaca142b43d39b0cd7b6cb210101.json b/.changelog/355afaca142b43d39b0cd7b6cb210101.json new file mode 100644 index 00000000000..69926f9be37 --- /dev/null +++ b/.changelog/355afaca142b43d39b0cd7b6cb210101.json @@ -0,0 +1,8 @@ +{ + "id": "355afaca-142b-43d3-9b0c-d7b6cb210101", + "type": "feature", + "description": "Add support for managing admin consent requirement on selected domains for OneDrive Storage Connectors in AppStream2.0.", + "modules": [ + "service/appstream" + ] +} \ No newline at end of file diff --git a/.changelog/619a6e9b6a79468cb78d669cb86e16ef.json b/.changelog/619a6e9b6a79468cb78d669cb86e16ef.json new file mode 100644 index 00000000000..5e38027ebdd --- /dev/null +++ b/.changelog/619a6e9b6a79468cb78d669cb86e16ef.json @@ -0,0 +1,8 @@ +{ + "id": "619a6e9b-6a79-468c-b78d-669cb86e16ef", + "type": "feature", + "description": "Added APIs to manage QBusiness user subscriptions", + "modules": [ + "service/qbusiness" + ] +} \ No newline at end of file diff --git a/.changelog/a7916fd8764c4a2e8fca8c665953c658.json b/.changelog/a7916fd8764c4a2e8fca8c665953c658.json new file mode 100644 index 00000000000..b9c14d0f1b4 --- /dev/null +++ b/.changelog/a7916fd8764c4a2e8fca8c665953c658.json @@ -0,0 +1,8 @@ +{ + "id": "a7916fd8-764c-4a2e-8fca-8c665953c658", + "type": "feature", + "description": "Temporarily updating dualstack endpoint support", + "modules": [ + "service/ecr" + ] +} \ No newline at end of file diff --git a/.changelog/cb88ccc2b28d4c35b0b173ee0fb5f7a5.json b/.changelog/cb88ccc2b28d4c35b0b173ee0fb5f7a5.json new file mode 100644 index 00000000000..9a44d80e23e --- /dev/null +++ b/.changelog/cb88ccc2b28d4c35b0b173ee0fb5f7a5.json @@ -0,0 +1,8 @@ +{ + "id": "cb88ccc2-b28d-4c35-b0b1-73ee0fb5f7a5", + "type": "feature", + "description": "Add a 'reason' field to InternalServerException", + "modules": [ + "service/bedrockagentruntime" + ] +} \ No newline at end of file diff --git a/.changelog/cbf1afe1dce84b43a494ed0a8544af56.json b/.changelog/cbf1afe1dce84b43a494ed0a8544af56.json new file mode 100644 index 00000000000..2ed181f13c2 --- /dev/null +++ b/.changelog/cbf1afe1dce84b43a494ed0a8544af56.json @@ -0,0 +1,8 @@ +{ + "id": "cbf1afe1-dce8-4b43-a494-ed0a8544af56", + "type": "feature", + "description": "Adds Cedar JSON format support for entities and context data in authorization requests", + "modules": [ + "service/verifiedpermissions" + ] +} \ No newline at end of file diff --git a/.changelog/e1b2ea069ebc4c87984e4650427ed505.json b/.changelog/e1b2ea069ebc4c87984e4650427ed505.json new file mode 100644 index 00000000000..da238238899 --- /dev/null +++ b/.changelog/e1b2ea069ebc4c87984e4650427ed505.json @@ -0,0 +1,8 @@ +{ + "id": "e1b2ea06-9ebc-4c87-984e-4650427ed505", + "type": "feature", + "description": "Adds options for configuring how MediaTailor conditions ads before inserting them into the content stream. Based on the new settings, MediaTailor will either transcode ads to match the content stream as it has in the past, or it will insert ads without first transcoding them.", + "modules": [ + "service/mediatailor" + ] +} \ No newline at end of file diff --git a/.changelog/f7e2474d52b54f6e94ab6818cb3dcb51.json b/.changelog/f7e2474d52b54f6e94ab6818cb3dcb51.json new file mode 100644 index 00000000000..8edae278de3 --- /dev/null +++ b/.changelog/f7e2474d52b54f6e94ab6818cb3dcb51.json @@ -0,0 +1,8 @@ +{ + "id": "f7e2474d-52b5-4f6e-94ab-6818cb3dcb51", + "type": "feature", + "description": "You can now use the CreateTable API operation to create tables with schemas by adding an optional metadata argument.", + "modules": [ + "service/s3tables" + ] +} \ No newline at end of file diff --git a/service/appstream/deserializers.go b/service/appstream/deserializers.go index b87986e4466..9b6e0c38058 100644 --- a/service/appstream/deserializers.go +++ b/service/appstream/deserializers.go @@ -14228,6 +14228,11 @@ func awsAwsjson11_deserializeDocumentStorageConnector(v **types.StorageConnector return err } + case "DomainsRequireAdminConsent": + if err := awsAwsjson11_deserializeDocumentDomainList(&sv.DomainsRequireAdminConsent, value); err != nil { + return err + } + case "ResourceIdentifier": if value != nil { jtv, ok := value.(string) diff --git a/service/appstream/serializers.go b/service/appstream/serializers.go index 0fa47a08ade..5f12538b0a0 100644 --- a/service/appstream/serializers.go +++ b/service/appstream/serializers.go @@ -5190,6 +5190,13 @@ func awsAwsjson11_serializeDocumentStorageConnector(v *types.StorageConnector, v } } + if v.DomainsRequireAdminConsent != nil { + ok := object.Key("DomainsRequireAdminConsent") + if err := awsAwsjson11_serializeDocumentDomainList(v.DomainsRequireAdminConsent, ok); err != nil { + return err + } + } + if v.ResourceIdentifier != nil { ok := object.Key("ResourceIdentifier") ok.String(*v.ResourceIdentifier) diff --git a/service/appstream/types/types.go b/service/appstream/types/types.go index 014be5935a9..ef4d62067b9 100644 --- a/service/appstream/types/types.go +++ b/service/appstream/types/types.go @@ -1289,6 +1289,11 @@ type StorageConnector struct { // The names of the domains for the account. Domains []string + // The OneDrive for Business domains where you require admin consent when users + // try to link their OneDrive account to AppStream 2.0. The attribute can only be + // specified when ConnectorType=ONE_DRIVE. + DomainsRequireAdminConsent []string + // The ARN of the storage connector. ResourceIdentifier *string diff --git a/service/bedrockagentruntime/api_op_RetrieveAndGenerateStream.go b/service/bedrockagentruntime/api_op_RetrieveAndGenerateStream.go index 482d5057922..b846c927939 100644 --- a/service/bedrockagentruntime/api_op_RetrieveAndGenerateStream.go +++ b/service/bedrockagentruntime/api_op_RetrieveAndGenerateStream.go @@ -17,6 +17,8 @@ import ( // // The CLI doesn't support streaming operations in Amazon Bedrock, including // InvokeModelWithResponseStream . +// +// This operation requires permission for the bedrock:RetrieveAndGenerate action. func (c *Client) RetrieveAndGenerateStream(ctx context.Context, params *RetrieveAndGenerateStreamInput, optFns ...func(*Options)) (*RetrieveAndGenerateStreamOutput, error) { if params == nil { params = &RetrieveAndGenerateStreamInput{} diff --git a/service/bedrockagentruntime/deserializers.go b/service/bedrockagentruntime/deserializers.go index 03b3eb2aaa4..92a20794795 100644 --- a/service/bedrockagentruntime/deserializers.go +++ b/service/bedrockagentruntime/deserializers.go @@ -5154,6 +5154,15 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS sv.Message = ptr.String(jtv) } + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Reason = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/bedrockagentruntime/types/errors.go b/service/bedrockagentruntime/types/errors.go index e8bbbd8fcdc..76d04b807d9 100644 --- a/service/bedrockagentruntime/types/errors.go +++ b/service/bedrockagentruntime/types/errors.go @@ -124,6 +124,8 @@ type InternalServerException struct { ErrorCodeOverride *string + Reason *string + noSmithyDocumentSerde } diff --git a/service/ecr/endpoints.go b/service/ecr/endpoints.go index e61e54695cd..c593447cd6f 100644 --- a/service/ecr/endpoints.go +++ b/service/ecr/endpoints.go @@ -361,44 +361,6 @@ func (r *resolver) ResolveEndpoint( if _UseDualStack == true { if true == _PartitionResult.SupportsFIPS { if true == _PartitionResult.SupportsDualStack { - if "aws" == _PartitionResult.Name { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr-fips.") - out.WriteString(_Region) - out.WriteString(".api.aws") - 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 - } - if "aws-us-gov" == _PartitionResult.Name { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr-fips.") - out.WriteString(_Region) - out.WriteString(".api.aws") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://api.ecr-fips.") @@ -485,63 +447,6 @@ func (r *resolver) ResolveEndpoint( } if _UseDualStack == true { if true == _PartitionResult.SupportsDualStack { - if "aws" == _PartitionResult.Name { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr.") - out.WriteString(_Region) - out.WriteString(".api.aws") - 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 - } - if "aws-cn" == _PartitionResult.Name { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr.") - out.WriteString(_Region) - out.WriteString(".api.amazonwebservices.com.cn") - 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 - } - if "aws-us-gov" == _PartitionResult.Name { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr.") - out.WriteString(_Region) - out.WriteString(".api.aws") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://api.ecr.") diff --git a/service/ecr/endpoints_test.go b/service/ecr/endpoints_test.go index 84d9ec3267f..febabd8fcf4 100644 --- a/service/ecr/endpoints_test.go +++ b/service/ecr/endpoints_test.go @@ -51,45 +51,8 @@ func TestEndpointCase0(t *testing.T) { } } -// For region af-south-1 with FIPS disabled and DualStack enabled -func TestEndpointCase1(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("af-south-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.af-south-1.api.aws") - - 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 region ap-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase2(t *testing.T) { +func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-east-1"), UseFIPS: ptr.Bool(false), @@ -125,45 +88,8 @@ func TestEndpointCase2(t *testing.T) { } } -// For region ap-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase3(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-east-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-east-1.api.aws") - - 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 region ap-northeast-1 with FIPS disabled and DualStack disabled -func TestEndpointCase4(t *testing.T) { +func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-1"), UseFIPS: ptr.Bool(false), @@ -199,45 +125,8 @@ func TestEndpointCase4(t *testing.T) { } } -// For region ap-northeast-1 with FIPS disabled and DualStack enabled -func TestEndpointCase5(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-northeast-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-northeast-1.api.aws") - - 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 region ap-northeast-2 with FIPS disabled and DualStack disabled -func TestEndpointCase6(t *testing.T) { +func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-2"), UseFIPS: ptr.Bool(false), @@ -273,45 +162,8 @@ func TestEndpointCase6(t *testing.T) { } } -// For region ap-northeast-2 with FIPS disabled and DualStack enabled -func TestEndpointCase7(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-northeast-2"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-northeast-2.api.aws") - - 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 region ap-northeast-3 with FIPS disabled and DualStack disabled -func TestEndpointCase8(t *testing.T) { +func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-3"), UseFIPS: ptr.Bool(false), @@ -347,45 +199,8 @@ func TestEndpointCase8(t *testing.T) { } } -// For region ap-northeast-3 with FIPS disabled and DualStack enabled -func TestEndpointCase9(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-northeast-3"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-northeast-3.api.aws") - - 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 region ap-south-1 with FIPS disabled and DualStack disabled -func TestEndpointCase10(t *testing.T) { +func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-south-1"), UseFIPS: ptr.Bool(false), @@ -421,1454 +236,11 @@ func TestEndpointCase10(t *testing.T) { } } -// For region ap-south-1 with FIPS disabled and DualStack enabled -func TestEndpointCase11(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-south-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-south-1.api.aws") - - 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 region ap-south-2 with FIPS disabled and DualStack disabled -func TestEndpointCase12(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-south-2"), - 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://api.ecr.ap-south-2.amazonaws.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 region ap-south-2 with FIPS disabled and DualStack enabled -func TestEndpointCase13(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-south-2"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-south-2.api.aws") - - 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 region ap-southeast-1 with FIPS disabled and DualStack disabled -func TestEndpointCase14(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-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://api.ecr.ap-southeast-1.amazonaws.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 region ap-southeast-1 with FIPS disabled and DualStack enabled -func TestEndpointCase15(t *testing.T) { +// For region ap-southeast-1 with FIPS disabled and DualStack disabled +func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-southeast-1.api.aws") - - 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 region ap-southeast-2 with FIPS disabled and DualStack disabled -func TestEndpointCase16(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-2"), - 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://api.ecr.ap-southeast-2.amazonaws.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 region ap-southeast-2 with FIPS disabled and DualStack enabled -func TestEndpointCase17(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-2"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-southeast-2.api.aws") - - 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 region ap-southeast-3 with FIPS disabled and DualStack disabled -func TestEndpointCase18(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-3"), - 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://api.ecr.ap-southeast-3.amazonaws.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 region ap-southeast-3 with FIPS disabled and DualStack enabled -func TestEndpointCase19(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-3"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-southeast-3.api.aws") - - 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 region ap-southeast-4 with FIPS disabled and DualStack disabled -func TestEndpointCase20(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-4"), - 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://api.ecr.ap-southeast-4.amazonaws.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 region ap-southeast-4 with FIPS disabled and DualStack enabled -func TestEndpointCase21(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-4"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-southeast-4.api.aws") - - 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 region ap-southeast-5 with FIPS disabled and DualStack disabled -func TestEndpointCase22(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-5"), - 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://api.ecr.ap-southeast-5.amazonaws.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 region ap-southeast-5 with FIPS disabled and DualStack enabled -func TestEndpointCase23(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-5"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-southeast-5.api.aws") - - 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 region ap-southeast-7 with FIPS disabled and DualStack disabled -func TestEndpointCase24(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-7"), - 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://api.ecr.ap-southeast-7.amazonaws.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 region ap-southeast-7 with FIPS disabled and DualStack enabled -func TestEndpointCase25(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-southeast-7"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ap-southeast-7.api.aws") - - 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 region ca-central-1 with FIPS disabled and DualStack disabled -func TestEndpointCase26(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ca-central-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://api.ecr.ca-central-1.amazonaws.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 region ca-central-1 with FIPS disabled and DualStack enabled -func TestEndpointCase27(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ca-central-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ca-central-1.api.aws") - - 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 region ca-west-1 with FIPS disabled and DualStack disabled -func TestEndpointCase28(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ca-west-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://api.ecr.ca-west-1.amazonaws.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 region ca-west-1 with FIPS disabled and DualStack enabled -func TestEndpointCase29(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ca-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.ca-west-1.api.aws") - - 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 region eu-central-1 with FIPS disabled and DualStack disabled -func TestEndpointCase30(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-central-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://api.ecr.eu-central-1.amazonaws.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 region eu-central-1 with FIPS disabled and DualStack enabled -func TestEndpointCase31(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-central-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-central-1.api.aws") - - 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 region eu-central-2 with FIPS disabled and DualStack disabled -func TestEndpointCase32(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-central-2"), - 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://api.ecr.eu-central-2.amazonaws.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 region eu-central-2 with FIPS disabled and DualStack enabled -func TestEndpointCase33(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-central-2"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-central-2.api.aws") - - 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 region eu-north-1 with FIPS disabled and DualStack disabled -func TestEndpointCase34(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-north-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://api.ecr.eu-north-1.amazonaws.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 region eu-north-1 with FIPS disabled and DualStack enabled -func TestEndpointCase35(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-north-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-north-1.api.aws") - - 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 region eu-south-1 with FIPS disabled and DualStack disabled -func TestEndpointCase36(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-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://api.ecr.eu-south-1.amazonaws.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 region eu-south-1 with FIPS disabled and DualStack enabled -func TestEndpointCase37(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-south-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-south-1.api.aws") - - 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 region eu-south-2 with FIPS disabled and DualStack disabled -func TestEndpointCase38(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-south-2"), - 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://api.ecr.eu-south-2.amazonaws.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 region eu-south-2 with FIPS disabled and DualStack enabled -func TestEndpointCase39(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-south-2"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-south-2.api.aws") - - 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 region eu-west-1 with FIPS disabled and DualStack disabled -func TestEndpointCase40(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-west-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://api.ecr.eu-west-1.amazonaws.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 region eu-west-1 with FIPS disabled and DualStack enabled -func TestEndpointCase41(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-west-1.api.aws") - - 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 region eu-west-2 with FIPS disabled and DualStack disabled -func TestEndpointCase42(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-west-2"), - 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://api.ecr.eu-west-2.amazonaws.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 region eu-west-2 with FIPS disabled and DualStack enabled -func TestEndpointCase43(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-west-2"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-west-2.api.aws") - - 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 region eu-west-3 with FIPS disabled and DualStack disabled -func TestEndpointCase44(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-west-3"), - 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://api.ecr.eu-west-3.amazonaws.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 region eu-west-3 with FIPS disabled and DualStack enabled -func TestEndpointCase45(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-west-3"), - 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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.eu-west-3.api.aws") - - 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 region il-central-1 with FIPS disabled and DualStack disabled -func TestEndpointCase46(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("il-central-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://api.ecr.il-central-1.amazonaws.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 region il-central-1 with FIPS disabled and DualStack enabled -func TestEndpointCase47(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("il-central-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.il-central-1.api.aws") - - 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 region me-central-1 with FIPS disabled and DualStack disabled -func TestEndpointCase48(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("me-central-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://api.ecr.me-central-1.amazonaws.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 region me-central-1 with FIPS disabled and DualStack enabled -func TestEndpointCase49(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("me-central-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr.me-central-1.api.aws") - - 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 region me-south-1 with FIPS disabled and DualStack disabled -func TestEndpointCase50(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("me-south-1"), - UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1880,7 +252,7 @@ func TestEndpointCase50(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.me-south-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.ap-southeast-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1901,12 +273,12 @@ func TestEndpointCase50(t *testing.T) { } } -// For region me-south-1 with FIPS disabled and DualStack enabled -func TestEndpointCase51(t *testing.T) { +// For region ap-southeast-2 with FIPS disabled and DualStack disabled +func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("me-south-1"), + Region: ptr.String("ap-southeast-2"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1917,7 +289,7 @@ func TestEndpointCase51(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.me-south-1.api.aws") + uri, _ := url.Parse("https://api.ecr.ap-southeast-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1938,10 +310,10 @@ func TestEndpointCase51(t *testing.T) { } } -// For region sa-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase52(t *testing.T) { +// For region ap-southeast-3 with FIPS disabled and DualStack disabled +func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("sa-east-1"), + Region: ptr.String("ap-southeast-3"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1954,7 +326,7 @@ func TestEndpointCase52(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.sa-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.ap-southeast-3.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1975,12 +347,12 @@ func TestEndpointCase52(t *testing.T) { } } -// For region sa-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase53(t *testing.T) { +// For region ca-central-1 with FIPS disabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("sa-east-1"), + Region: ptr.String("ca-central-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1991,7 +363,7 @@ func TestEndpointCase53(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.sa-east-1.api.aws") + uri, _ := url.Parse("https://api.ecr.ca-central-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2012,10 +384,10 @@ func TestEndpointCase53(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase54(t *testing.T) { +// For region eu-central-1 with FIPS disabled and DualStack disabled +func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("eu-central-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -2028,7 +400,7 @@ func TestEndpointCase54(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.eu-central-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2049,11 +421,11 @@ func TestEndpointCase54(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase55(t *testing.T) { +// For region eu-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("eu-north-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -2065,7 +437,7 @@ func TestEndpointCase55(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.eu-north-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2086,12 +458,12 @@ func TestEndpointCase55(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase56(t *testing.T) { +// For region eu-south-1 with FIPS disabled and DualStack disabled +func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("eu-south-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2102,7 +474,7 @@ func TestEndpointCase56(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.us-east-1.api.aws") + uri, _ := url.Parse("https://api.ecr.eu-south-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2123,12 +495,12 @@ func TestEndpointCase56(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase57(t *testing.T) { +// For region eu-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), + Region: ptr.String("eu-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2139,7 +511,7 @@ func TestEndpointCase57(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-east-1.api.aws") + uri, _ := url.Parse("https://api.ecr.eu-west-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2160,10 +532,10 @@ func TestEndpointCase57(t *testing.T) { } } -// For region us-east-2 with FIPS disabled and DualStack disabled -func TestEndpointCase58(t *testing.T) { +// For region eu-west-2 with FIPS disabled and DualStack disabled +func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-2"), + Region: ptr.String("eu-west-2"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -2176,7 +548,7 @@ func TestEndpointCase58(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.us-east-2.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.eu-west-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2197,11 +569,11 @@ func TestEndpointCase58(t *testing.T) { } } -// For region us-east-2 with FIPS enabled and DualStack disabled -func TestEndpointCase59(t *testing.T) { +// For region eu-west-3 with FIPS disabled and DualStack disabled +func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-2"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("eu-west-3"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -2213,7 +585,7 @@ func TestEndpointCase59(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-east-2.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.eu-west-3.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2234,12 +606,12 @@ func TestEndpointCase59(t *testing.T) { } } -// For region us-east-2 with FIPS disabled and DualStack enabled -func TestEndpointCase60(t *testing.T) { +// For region me-south-1 with FIPS disabled and DualStack disabled +func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-2"), + Region: ptr.String("me-south-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2250,7 +622,7 @@ func TestEndpointCase60(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.us-east-2.api.aws") + uri, _ := url.Parse("https://api.ecr.me-south-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2271,12 +643,12 @@ func TestEndpointCase60(t *testing.T) { } } -// For region us-east-2 with FIPS enabled and DualStack enabled -func TestEndpointCase61(t *testing.T) { +// For region sa-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-2"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), + Region: ptr.String("sa-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2287,7 +659,7 @@ func TestEndpointCase61(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-east-2.api.aws") + uri, _ := url.Parse("https://api.ecr.sa-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2308,10 +680,10 @@ func TestEndpointCase61(t *testing.T) { } } -// For region us-west-1 with FIPS disabled and DualStack disabled -func TestEndpointCase62(t *testing.T) { +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-1"), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -2324,7 +696,7 @@ func TestEndpointCase62(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.us-west-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2345,10 +717,10 @@ func TestEndpointCase62(t *testing.T) { } } -// For region us-west-1 with FIPS enabled and DualStack disabled -func TestEndpointCase63(t *testing.T) { +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-1"), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -2361,7 +733,7 @@ func TestEndpointCase63(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-west-1.amazonaws.com") + uri, _ := url.Parse("https://ecr-fips.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2382,12 +754,12 @@ func TestEndpointCase63(t *testing.T) { } } -// For region us-west-1 with FIPS disabled and DualStack enabled -func TestEndpointCase64(t *testing.T) { +// For region us-east-2 with FIPS disabled and DualStack disabled +func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-1"), + Region: ptr.String("us-east-2"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2398,7 +770,7 @@ func TestEndpointCase64(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.us-west-1.api.aws") + uri, _ := url.Parse("https://api.ecr.us-east-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2419,12 +791,12 @@ func TestEndpointCase64(t *testing.T) { } } -// For region us-west-1 with FIPS enabled and DualStack enabled -func TestEndpointCase65(t *testing.T) { +// For region us-east-2 with FIPS enabled and DualStack disabled +func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-1"), + Region: ptr.String("us-east-2"), UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2435,7 +807,7 @@ func TestEndpointCase65(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-west-1.api.aws") + uri, _ := url.Parse("https://ecr-fips.us-east-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2456,10 +828,10 @@ func TestEndpointCase65(t *testing.T) { } } -// For region us-west-2 with FIPS disabled and DualStack disabled -func TestEndpointCase66(t *testing.T) { +// For region us-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-2"), + Region: ptr.String("us-west-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -2472,7 +844,7 @@ func TestEndpointCase66(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.us-west-2.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.us-west-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2493,10 +865,10 @@ func TestEndpointCase66(t *testing.T) { } } -// For region us-west-2 with FIPS enabled and DualStack disabled -func TestEndpointCase67(t *testing.T) { +// For region us-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-2"), + Region: ptr.String("us-west-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -2509,7 +881,7 @@ func TestEndpointCase67(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-west-2.amazonaws.com") + uri, _ := url.Parse("https://ecr-fips.us-west-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2530,12 +902,12 @@ func TestEndpointCase67(t *testing.T) { } } -// For region us-west-2 with FIPS disabled and DualStack enabled -func TestEndpointCase68(t *testing.T) { +// For region us-west-2 with FIPS disabled and DualStack disabled +func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2546,7 +918,7 @@ func TestEndpointCase68(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.us-west-2.api.aws") + uri, _ := url.Parse("https://api.ecr.us-west-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2567,12 +939,12 @@ func TestEndpointCase68(t *testing.T) { } } -// For region us-west-2 with FIPS enabled and DualStack enabled -func TestEndpointCase69(t *testing.T) { +// For region us-west-2 with FIPS enabled and DualStack disabled +func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2583,7 +955,7 @@ func TestEndpointCase69(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-west-2.api.aws") + uri, _ := url.Parse("https://ecr-fips.us-west-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2604,12 +976,12 @@ func TestEndpointCase69(t *testing.T) { } } -// For region cn-north-1 with FIPS disabled and DualStack disabled -func TestEndpointCase70(t *testing.T) { +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2620,7 +992,7 @@ func TestEndpointCase70(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.cn-north-1.amazonaws.com.cn") + uri, _ := url.Parse("https://api.ecr-fips.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2641,10 +1013,10 @@ func TestEndpointCase70(t *testing.T) { } } -// For region cn-north-1 with FIPS disabled and DualStack enabled -func TestEndpointCase71(t *testing.T) { +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -2657,7 +1029,7 @@ func TestEndpointCase71(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.cn-north-1.api.amazonwebservices.com.cn") + uri, _ := url.Parse("https://api.ecr.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2678,10 +1050,10 @@ func TestEndpointCase71(t *testing.T) { } } -// For region cn-northwest-1 with FIPS disabled and DualStack disabled -func TestEndpointCase72(t *testing.T) { +// For region cn-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-northwest-1"), + Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -2694,7 +1066,7 @@ func TestEndpointCase72(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr.cn-northwest-1.amazonaws.com.cn") + uri, _ := url.Parse("https://api.ecr.cn-north-1.amazonaws.com.cn") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2715,12 +1087,12 @@ func TestEndpointCase72(t *testing.T) { } } -// For region cn-northwest-1 with FIPS disabled and DualStack enabled -func TestEndpointCase73(t *testing.T) { +// For region cn-northwest-1 with FIPS disabled and DualStack disabled +func TestEndpointCase29(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-northwest-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2731,7 +1103,7 @@ func TestEndpointCase73(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.cn-northwest-1.api.amazonwebservices.com.cn") + uri, _ := url.Parse("https://api.ecr.cn-northwest-1.amazonaws.com.cn") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2753,7 +1125,7 @@ func TestEndpointCase73(t *testing.T) { } // For region cn-north-1 with FIPS enabled and DualStack enabled -func TestEndpointCase74(t *testing.T) { +func TestEndpointCase30(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), @@ -2790,7 +1162,7 @@ func TestEndpointCase74(t *testing.T) { } // For region cn-north-1 with FIPS enabled and DualStack disabled -func TestEndpointCase75(t *testing.T) { +func TestEndpointCase31(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), @@ -2826,49 +1198,12 @@ func TestEndpointCase75(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase76(t *testing.T) { +// For region cn-north-1 with FIPS disabled and DualStack enabled +func TestEndpointCase32(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), + Region: ptr.String("cn-north-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://api.ecr.us-gov-east-1.amazonaws.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 region us-gov-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase77(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -2879,7 +1214,7 @@ func TestEndpointCase77(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr.cn-north-1.api.amazonwebservices.com.cn") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2900,12 +1235,12 @@ func TestEndpointCase77(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase78(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase33(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2916,7 +1251,7 @@ func TestEndpointCase78(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://api.ecr.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2937,12 +1272,12 @@ func TestEndpointCase78(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase79(t *testing.T) { +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase34(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -2953,7 +1288,7 @@ func TestEndpointCase79(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://ecr-fips.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -2975,7 +1310,7 @@ func TestEndpointCase79(t *testing.T) { } // For region us-gov-west-1 with FIPS disabled and DualStack disabled -func TestEndpointCase80(t *testing.T) { +func TestEndpointCase35(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(false), @@ -3012,7 +1347,7 @@ func TestEndpointCase80(t *testing.T) { } // For region us-gov-west-1 with FIPS enabled and DualStack disabled -func TestEndpointCase81(t *testing.T) { +func TestEndpointCase36(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(true), @@ -3048,11 +1383,11 @@ func TestEndpointCase81(t *testing.T) { } } -// For region us-gov-west-1 with FIPS disabled and DualStack enabled -func TestEndpointCase82(t *testing.T) { +// For region us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase37(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-west-1"), - UseFIPS: ptr.Bool(false), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -3064,7 +1399,7 @@ func TestEndpointCase82(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr.us-gov-west-1.api.aws") + uri, _ := url.Parse("https://api.ecr-fips.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -3085,11 +1420,11 @@ func TestEndpointCase82(t *testing.T) { } } -// For region us-gov-west-1 with FIPS enabled and DualStack enabled -func TestEndpointCase83(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase38(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-west-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -3101,7 +1436,7 @@ func TestEndpointCase83(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://ecr-fips.us-gov-west-1.api.aws") + uri, _ := url.Parse("https://api.ecr.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -3123,7 +1458,7 @@ func TestEndpointCase83(t *testing.T) { } // For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase84(t *testing.T) { +func TestEndpointCase39(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), @@ -3160,7 +1495,7 @@ func TestEndpointCase84(t *testing.T) { } // For region us-iso-west-1 with FIPS disabled and DualStack disabled -func TestEndpointCase85(t *testing.T) { +func TestEndpointCase40(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-west-1"), UseFIPS: ptr.Bool(false), @@ -3197,7 +1532,7 @@ func TestEndpointCase85(t *testing.T) { } // For region us-iso-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase86(t *testing.T) { +func TestEndpointCase41(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), @@ -3217,7 +1552,7 @@ func TestEndpointCase86(t *testing.T) { } // For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase87(t *testing.T) { +func TestEndpointCase42(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), @@ -3254,7 +1589,7 @@ func TestEndpointCase87(t *testing.T) { } // For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase88(t *testing.T) { +func TestEndpointCase43(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), @@ -3274,7 +1609,7 @@ func TestEndpointCase88(t *testing.T) { } // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase89(t *testing.T) { +func TestEndpointCase44(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), @@ -3311,7 +1646,7 @@ func TestEndpointCase89(t *testing.T) { } // For region us-isob-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase90(t *testing.T) { +func TestEndpointCase45(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), @@ -3331,7 +1666,7 @@ func TestEndpointCase90(t *testing.T) { } // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase91(t *testing.T) { +func TestEndpointCase46(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), @@ -3368,7 +1703,7 @@ func TestEndpointCase91(t *testing.T) { } // For region us-isob-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase92(t *testing.T) { +func TestEndpointCase47(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), @@ -3388,7 +1723,7 @@ func TestEndpointCase92(t *testing.T) { } // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase93(t *testing.T) { +func TestEndpointCase48(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -3426,7 +1761,7 @@ func TestEndpointCase93(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase94(t *testing.T) { +func TestEndpointCase49(t *testing.T) { var params = EndpointParameters{ UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), @@ -3463,7 +1798,7 @@ func TestEndpointCase94(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase95(t *testing.T) { +func TestEndpointCase50(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -3484,7 +1819,7 @@ func TestEndpointCase95(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase96(t *testing.T) { +func TestEndpointCase51(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -3505,7 +1840,7 @@ func TestEndpointCase96(t *testing.T) { } // Missing region -func TestEndpointCase97(t *testing.T) { +func TestEndpointCase52(t *testing.T) { var params = EndpointParameters{} resolver := NewDefaultEndpointResolverV2() diff --git a/service/ecrpublic/endpoints.go b/service/ecrpublic/endpoints.go index 4af6f113882..39d8005662d 100644 --- a/service/ecrpublic/endpoints.go +++ b/service/ecrpublic/endpoints.go @@ -409,25 +409,6 @@ func (r *resolver) ResolveEndpoint( } if _UseDualStack == true { if true == _PartitionResult.SupportsDualStack { - if "aws" == _PartitionResult.Name { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ecr-public.") - out.WriteString(_Region) - out.WriteString(".api.aws") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://api.ecr-public.") diff --git a/service/ecrpublic/endpoints_test.go b/service/ecrpublic/endpoints_test.go index 5c813f5e240..2dcaefb30df 100644 --- a/service/ecrpublic/endpoints_test.go +++ b/service/ecrpublic/endpoints_test.go @@ -14,12 +14,12 @@ import ( "testing" ) -// For region us-east-1 with FIPS disabled and DualStack disabled +// For region us-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -30,7 +30,7 @@ func TestEndpointCase0(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr-public.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr-public-fips.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -51,48 +51,11 @@ func TestEndpointCase0(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack enabled +// For region us-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-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 no error, got %v", err) - } - - uri, _ := url.Parse("https://ecr-public.us-east-1.api.aws") - - 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 region us-west-2 with FIPS disabled and DualStack disabled -func TestEndpointCase2(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-west-2"), - UseFIPS: ptr.Bool(false), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -104,7 +67,7 @@ func TestEndpointCase2(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr-public.us-west-2.amazonaws.com") + uri, _ := url.Parse("https://api.ecr-public-fips.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -125,11 +88,11 @@ func TestEndpointCase2(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase3(t *testing.T) { +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -141,7 +104,7 @@ func TestEndpointCase3(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr-public-fips.us-east-1.api.aws") + uri, _ := url.Parse("https://api.ecr-public.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -162,11 +125,11 @@ func TestEndpointCase3(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase4(t *testing.T) { +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -178,7 +141,7 @@ func TestEndpointCase4(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.ecr-public-fips.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.ecr-public.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -200,7 +163,7 @@ func TestEndpointCase4(t *testing.T) { } // For region cn-north-1 with FIPS enabled and DualStack enabled -func TestEndpointCase5(t *testing.T) { +func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), @@ -237,7 +200,7 @@ func TestEndpointCase5(t *testing.T) { } // For region cn-north-1 with FIPS enabled and DualStack disabled -func TestEndpointCase6(t *testing.T) { +func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), @@ -274,7 +237,7 @@ func TestEndpointCase6(t *testing.T) { } // For region cn-north-1 with FIPS disabled and DualStack enabled -func TestEndpointCase7(t *testing.T) { +func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(false), @@ -311,7 +274,7 @@ func TestEndpointCase7(t *testing.T) { } // For region cn-north-1 with FIPS disabled and DualStack disabled -func TestEndpointCase8(t *testing.T) { +func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(false), @@ -348,7 +311,7 @@ func TestEndpointCase8(t *testing.T) { } // For region us-gov-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase9(t *testing.T) { +func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), @@ -385,7 +348,7 @@ func TestEndpointCase9(t *testing.T) { } // For region us-gov-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase10(t *testing.T) { +func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), @@ -422,7 +385,7 @@ func TestEndpointCase10(t *testing.T) { } // For region us-gov-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase11(t *testing.T) { +func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(false), @@ -459,7 +422,7 @@ func TestEndpointCase11(t *testing.T) { } // For region us-gov-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase12(t *testing.T) { +func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(false), @@ -496,7 +459,7 @@ func TestEndpointCase12(t *testing.T) { } // For region us-iso-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase13(t *testing.T) { +func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), @@ -516,7 +479,7 @@ func TestEndpointCase13(t *testing.T) { } // For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase14(t *testing.T) { +func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), @@ -553,7 +516,7 @@ func TestEndpointCase14(t *testing.T) { } // For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase15(t *testing.T) { +func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), @@ -573,7 +536,7 @@ func TestEndpointCase15(t *testing.T) { } // For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase16(t *testing.T) { +func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), @@ -610,7 +573,7 @@ func TestEndpointCase16(t *testing.T) { } // For region us-isob-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase17(t *testing.T) { +func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), @@ -630,7 +593,7 @@ func TestEndpointCase17(t *testing.T) { } // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase18(t *testing.T) { +func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), @@ -667,7 +630,7 @@ func TestEndpointCase18(t *testing.T) { } // For region us-isob-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase19(t *testing.T) { +func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), @@ -687,7 +650,7 @@ func TestEndpointCase19(t *testing.T) { } // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase20(t *testing.T) { +func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), @@ -724,7 +687,7 @@ func TestEndpointCase20(t *testing.T) { } // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase21(t *testing.T) { +func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -762,7 +725,7 @@ func TestEndpointCase21(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase22(t *testing.T) { +func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), @@ -799,7 +762,7 @@ func TestEndpointCase22(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase23(t *testing.T) { +func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -820,7 +783,7 @@ func TestEndpointCase23(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase24(t *testing.T) { +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -841,7 +804,7 @@ func TestEndpointCase24(t *testing.T) { } // Missing region -func TestEndpointCase25(t *testing.T) { +func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{} resolver := NewDefaultEndpointResolverV2() diff --git a/service/mediatailor/api_op_ConfigureLogsForPlaybackConfiguration.go b/service/mediatailor/api_op_ConfigureLogsForPlaybackConfiguration.go index 4d5b234a9d2..e966a3f08e9 100644 --- a/service/mediatailor/api_op_ConfigureLogsForPlaybackConfiguration.go +++ b/service/mediatailor/api_op_ConfigureLogsForPlaybackConfiguration.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Amazon CloudWatch log settings for a playback configuration. +// Defines where AWS Elemental MediaTailor sends logs for the playback +// configuration. func (c *Client) ConfigureLogsForPlaybackConfiguration(ctx context.Context, params *ConfigureLogsForPlaybackConfigurationInput, optFns ...func(*Options)) (*ConfigureLogsForPlaybackConfigurationOutput, error) { if params == nil { params = &ConfigureLogsForPlaybackConfigurationInput{} @@ -29,7 +30,7 @@ func (c *Client) ConfigureLogsForPlaybackConfiguration(ctx context.Context, para // Configures Amazon CloudWatch log settings for a playback configuration. type ConfigureLogsForPlaybackConfigurationInput struct { - // The percentage of session logs that MediaTailor sends to your Cloudwatch Logs + // The percentage of session logs that MediaTailor sends to your CloudWatch Logs // account. For example, if your playback configuration has 1000 sessions and // percentEnabled is set to 60 , MediaTailor sends logs for 600 of the sessions to // CloudWatch Logs. MediaTailor decides at random which of the playback diff --git a/service/mediatailor/api_op_GetPlaybackConfiguration.go b/service/mediatailor/api_op_GetPlaybackConfiguration.go index b190d47f625..1208c02c6a2 100644 --- a/service/mediatailor/api_op_GetPlaybackConfiguration.go +++ b/service/mediatailor/api_op_GetPlaybackConfiguration.go @@ -42,6 +42,10 @@ type GetPlaybackConfigurationInput struct { type GetPlaybackConfigurationOutput struct { + // The setting that indicates what conditioning MediaTailor will perform on ads + // that the ad decision server (ADS) returns. + AdConditioningConfiguration *types.AdConditioningConfiguration + // The URL for the ad decision server (ADS). This includes the specification of // static parameters and placeholders for dynamic parameters. AWS Elemental // MediaTailor substitutes player-specific and session-specific parameters as @@ -69,7 +73,7 @@ type GetPlaybackConfigurationOutput struct { // The player parameters and aliases used as dynamic variables during session // initialization. For more information, see [Domain Variables]. // - // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domain.html + // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domains.html ConfigurationAliases map[string]map[string]string // The configuration for DASH content. @@ -88,7 +92,8 @@ type GetPlaybackConfigurationOutput struct { // The configuration for pre-roll ad insertion. LivePreRollConfiguration *types.LivePreRollConfiguration - // The Amazon CloudWatch log settings for a playback configuration. + // The configuration that defines where AWS Elemental MediaTailor sends logs for + // the playback configuration. LogConfiguration *types.LogConfiguration // The configuration for manifest processing rules. Manifest processing rules diff --git a/service/mediatailor/api_op_PutPlaybackConfiguration.go b/service/mediatailor/api_op_PutPlaybackConfiguration.go index c432307c957..fbdb0f537c4 100644 --- a/service/mediatailor/api_op_PutPlaybackConfiguration.go +++ b/service/mediatailor/api_op_PutPlaybackConfiguration.go @@ -37,6 +37,10 @@ type PutPlaybackConfigurationInput struct { // This member is required. Name *string + // The setting that indicates what conditioning MediaTailor will perform on ads + // that the ad decision server (ADS) returns. + AdConditioningConfiguration *types.AdConditioningConfiguration + // The URL for the ad decision server (ADS). This includes the specification of // static parameters and placeholders for dynamic parameters. AWS Elemental // MediaTailor substitutes player-specific and session-specific parameters as @@ -64,7 +68,7 @@ type PutPlaybackConfigurationInput struct { // The player parameters and aliases used as dynamic variables during session // initialization. For more information, see [Domain Variables]. // - // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domain.html + // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domains.html ConfigurationAliases map[string]map[string]string // The configuration for DASH content. @@ -125,6 +129,10 @@ type PutPlaybackConfigurationInput struct { type PutPlaybackConfigurationOutput struct { + // The setting that indicates what conditioning MediaTailor will perform on ads + // that the ad decision server (ADS) returns. + AdConditioningConfiguration *types.AdConditioningConfiguration + // The URL for the ad decision server (ADS). This includes the specification of // static parameters and placeholders for dynamic parameters. AWS Elemental // MediaTailor substitutes player-specific and session-specific parameters as @@ -152,7 +160,7 @@ type PutPlaybackConfigurationOutput struct { // The player parameters and aliases used as dynamic variables during session // initialization. For more information, see [Domain Variables]. // - // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domain.html + // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domains.html ConfigurationAliases map[string]map[string]string // The configuration for DASH content. @@ -171,7 +179,8 @@ type PutPlaybackConfigurationOutput struct { // The configuration for pre-roll ad insertion. LivePreRollConfiguration *types.LivePreRollConfiguration - // The Amazon CloudWatch log settings for a playback configuration. + // The configuration that defines where AWS Elemental MediaTailor sends logs for + // the playback configuration. LogConfiguration *types.LogConfiguration // The configuration for manifest processing rules. Manifest processing rules diff --git a/service/mediatailor/deserializers.go b/service/mediatailor/deserializers.go index db43238bd98..43cf50e0ef2 100644 --- a/service/mediatailor/deserializers.go +++ b/service/mediatailor/deserializers.go @@ -3978,6 +3978,11 @@ func awsRestjson1_deserializeOpDocumentGetPlaybackConfigurationOutput(v **GetPla for key, value := range shape { switch key { + case "AdConditioningConfiguration": + if err := awsRestjson1_deserializeDocumentAdConditioningConfiguration(&sv.AdConditioningConfiguration, value); err != nil { + return err + } + case "AdDecisionServerUrl": if value != nil { jtv, ok := value.(string) @@ -5799,6 +5804,11 @@ func awsRestjson1_deserializeOpDocumentPutPlaybackConfigurationOutput(v **PutPla for key, value := range shape { switch key { + case "AdConditioningConfiguration": + if err := awsRestjson1_deserializeDocumentAdConditioningConfiguration(&sv.AdConditioningConfiguration, value); err != nil { + return err + } + case "AdDecisionServerUrl": if value != nil { jtv, ok := value.(string) @@ -8273,6 +8283,46 @@ func awsRestjson1_deserializeDocumentAdBreakOpportunity(v **types.AdBreakOpportu return nil } +func awsRestjson1_deserializeDocumentAdConditioningConfiguration(v **types.AdConditioningConfiguration, 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.AdConditioningConfiguration + if *v == nil { + sv = &types.AdConditioningConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "StreamingMediaFileConditioning": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StreamingMediaFileConditioning to be of type string, got %T instead", value) + } + sv.StreamingMediaFileConditioning = types.StreamingMediaFileConditioning(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAdMarkerPassthrough(v **types.AdMarkerPassthrough, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9859,6 +9909,11 @@ func awsRestjson1_deserializeDocumentPlaybackConfiguration(v **types.PlaybackCon for key, value := range shape { switch key { + case "AdConditioningConfiguration": + if err := awsRestjson1_deserializeDocumentAdConditioningConfiguration(&sv.AdConditioningConfiguration, value); err != nil { + return err + } + case "AdDecisionServerUrl": if value != nil { jtv, ok := value.(string) diff --git a/service/mediatailor/serializers.go b/service/mediatailor/serializers.go index e47474a1520..6c10ff36249 100644 --- a/service/mediatailor/serializers.go +++ b/service/mediatailor/serializers.go @@ -3002,6 +3002,13 @@ func awsRestjson1_serializeOpDocumentPutPlaybackConfigurationInput(v *PutPlaybac object := value.Object() defer object.Close() + if v.AdConditioningConfiguration != nil { + ok := object.Key("AdConditioningConfiguration") + if err := awsRestjson1_serializeDocumentAdConditioningConfiguration(v.AdConditioningConfiguration, ok); err != nil { + return err + } + } + if v.AdDecisionServerUrl != nil { ok := object.Key("AdDecisionServerUrl") ok.String(*v.AdDecisionServerUrl) @@ -4127,6 +4134,18 @@ func awsRestjson1_serializeDocumentAdBreakMetadataList(v []types.KeyValuePair, v return nil } +func awsRestjson1_serializeDocumentAdConditioningConfiguration(v *types.AdConditioningConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.StreamingMediaFileConditioning) > 0 { + ok := object.Key("StreamingMediaFileConditioning") + ok.String(string(v.StreamingMediaFileConditioning)) + } + + return nil +} + func awsRestjson1_serializeDocumentAdMarkerPassthrough(v *types.AdMarkerPassthrough, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/mediatailor/types/enums.go b/service/mediatailor/types/enums.go index 7a0ae155e81..e8bc013bdb6 100644 --- a/service/mediatailor/types/enums.go +++ b/service/mediatailor/types/enums.go @@ -272,6 +272,26 @@ func (ScheduleEntryType) Values() []ScheduleEntryType { } } +type StreamingMediaFileConditioning string + +// Enum values for StreamingMediaFileConditioning +const ( + StreamingMediaFileConditioningTranscode StreamingMediaFileConditioning = "TRANSCODE" + StreamingMediaFileConditioningNone StreamingMediaFileConditioning = "NONE" +) + +// Values returns all known values for StreamingMediaFileConditioning. 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 (StreamingMediaFileConditioning) Values() []StreamingMediaFileConditioning { + return []StreamingMediaFileConditioning{ + "TRANSCODE", + "NONE", + } +} + type Tier string // Enum values for Tier diff --git a/service/mediatailor/types/types.go b/service/mediatailor/types/types.go index 065cfa15b70..29e52de60bf 100644 --- a/service/mediatailor/types/types.go +++ b/service/mediatailor/types/types.go @@ -125,6 +125,25 @@ type AdBreakOpportunity struct { noSmithyDocumentSerde } +// The setting that indicates what conditioning MediaTailor will perform on ads +// that the ad decision server (ADS) returns. +type AdConditioningConfiguration struct { + + // For ads that have media files with streaming delivery, indicates what + // transcoding action MediaTailor it first receives these ads from the ADS. + // TRANSCODE indicates that MediaTailor must transcode the ads. NONE indicates + // that you have already transcoded the ads outside of MediaTailor and don't need + // them transcoded as part of the ad insertion workflow. For more information about + // ad conditioning see [https://docs.aws.amazon.com/precondition-ads.html]. + // + // [https://docs.aws.amazon.com/precondition-ads.html]: https://docs.aws.amazon.com/precondition-ads.html + // + // This member is required. + StreamingMediaFileConditioning StreamingMediaFileConditioning + + noSmithyDocumentSerde +} + // For HLS, when set to true , MediaTailor passes through EXT-X-CUE-IN , // EXT-X-CUE-OUT , and EXT-X-SPLICEPOINT-SCTE35 ad markers from the origin // manifest to the MediaTailor personalized manifest. @@ -635,11 +654,12 @@ type LiveSource struct { noSmithyDocumentSerde } -// Returns Amazon CloudWatch log settings for a playback configuration. +// Defines where AWS Elemental MediaTailor sends logs for the playback +// configuration. type LogConfiguration struct { - // The percentage of session logs that MediaTailor sends to your Cloudwatch Logs - // account. For example, if your playback configuration has 1000 sessions and + // The percentage of session logs that MediaTailor sends to your configured log + // destination. For example, if your playback configuration has 1000 sessions and // percentEnabled is set to 60 , MediaTailor sends logs for 600 of the sessions to // CloudWatch Logs. MediaTailor decides at random which of the playback // configuration sessions to send logs for. If you want to view logs for a specific @@ -686,6 +706,10 @@ type ManifestProcessingRules struct { // [Working with configurations in AWS Elemental MediaTailor]: https://docs.aws.amazon.com/mediatailor/latest/ug/configurations.html type PlaybackConfiguration struct { + // The setting that indicates what conditioning MediaTailor will perform on ads + // that the ad decision server (ADS) returns. + AdConditioningConfiguration *AdConditioningConfiguration + // The URL for the ad decision server (ADS). This includes the specification of // static parameters and placeholders for dynamic parameters. AWS Elemental // MediaTailor substitutes player-specific and session-specific parameters as @@ -713,7 +737,7 @@ type PlaybackConfiguration struct { // The player parameters and aliases used as dynamic variables during session // initialization. For more information, see [Domain Variables]. // - // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domain.html + // [Domain Variables]: https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domains.html ConfigurationAliases map[string]map[string]string // The configuration for a DASH source. @@ -732,7 +756,8 @@ type PlaybackConfiguration struct { // The configuration for pre-roll ad insertion. LivePreRollConfiguration *LivePreRollConfiguration - // The Amazon CloudWatch log settings for a playback configuration. + // Defines where AWS Elemental MediaTailor sends logs for the playback + // configuration. LogConfiguration *LogConfiguration // The configuration for manifest processing rules. Manifest processing rules @@ -811,7 +836,7 @@ type PrefetchConsumption struct { // The time when prefetched ads are considered for use in an ad break. If you // don't specify StartTime , the prefetched ads are available after MediaTailor - // retrives them from the ad decision server. + // retrieves them from the ad decision server. StartTime *time.Time noSmithyDocumentSerde diff --git a/service/mediatailor/validators.go b/service/mediatailor/validators.go index 76f33252f3d..829a3d87d99 100644 --- a/service/mediatailor/validators.go +++ b/service/mediatailor/validators.go @@ -1096,6 +1096,21 @@ func validateAdBreakMetadataList(v []types.KeyValuePair) error { } } +func validateAdConditioningConfiguration(v *types.AdConditioningConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AdConditioningConfiguration"} + if len(v.StreamingMediaFileConditioning) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("StreamingMediaFileConditioning")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAlternateMedia(v *types.AlternateMedia) error { if v == nil { return nil @@ -1926,6 +1941,11 @@ func validateOpPutPlaybackConfigurationInput(v *PutPlaybackConfigurationInput) e if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } + if v.AdConditioningConfiguration != nil { + if err := validateAdConditioningConfiguration(v.AdConditioningConfiguration); err != nil { + invalidParams.AddNested("AdConditioningConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/qbusiness/api_op_AssociatePermission.go b/service/qbusiness/api_op_AssociatePermission.go index bf0b05d5124..199cda69d3a 100644 --- a/service/qbusiness/api_op_AssociatePermission.go +++ b/service/qbusiness/api_op_AssociatePermission.go @@ -10,11 +10,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds or updates a permission policy for a Q Business application, allowing -// cross-account access for an ISV. This operation creates a new policy statement -// for the specified Q Business application. The policy statement defines the IAM -// actions that the ISV is allowed to perform on the Q Business application's -// resources. +// Adds or updates a permission policy for a Amazon Q Business application, +// allowing cross-account access for an ISV. This operation creates a new policy +// statement for the specified Amazon Q Business application. The policy statement +// defines the IAM actions that the ISV is allowed to perform on the Amazon Q +// Business application's resources. func (c *Client) AssociatePermission(ctx context.Context, params *AssociatePermissionInput, optFns ...func(*Options)) (*AssociatePermissionOutput, error) { if params == nil { params = &AssociatePermissionInput{} @@ -32,18 +32,18 @@ func (c *Client) AssociatePermission(ctx context.Context, params *AssociatePermi type AssociatePermissionInput struct { - // The list of Q Business actions that the ISV is allowed to perform. + // The list of Amazon Q Business actions that the ISV is allowed to perform. // // This member is required. Actions []string - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string - // The Amazon Resource Name (ARN) of the IAM role for the ISV that is being - // granted permission. + // The Amazon Resource Name of the IAM role for the ISV that is being granted + // permission. // // This member is required. Principal *string diff --git a/service/qbusiness/api_op_CancelSubscription.go b/service/qbusiness/api_op_CancelSubscription.go new file mode 100644 index 00000000000..d23a43be5ff --- /dev/null +++ b/service/qbusiness/api_op_CancelSubscription.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qbusiness + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qbusiness/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Unsubscribes a user or a group from their pricing tier in an Amazon Q Business +// application. An unsubscribed user or group loses all Amazon Q Business feature +// access at the start of next month. +func (c *Client) CancelSubscription(ctx context.Context, params *CancelSubscriptionInput, optFns ...func(*Options)) (*CancelSubscriptionOutput, error) { + if params == nil { + params = &CancelSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelSubscription", params, optFns, c.addOperationCancelSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelSubscriptionInput struct { + + // The identifier of the Amazon Q Business application for which the subscription + // is being cancelled. + // + // This member is required. + ApplicationId *string + + // The identifier of the Amazon Q Business subscription being cancelled. + // + // This member is required. + SubscriptionId *string + + noSmithyDocumentSerde +} + +type CancelSubscriptionOutput struct { + + // The type of your current Amazon Q Business subscription. + CurrentSubscription *types.SubscriptionDetails + + // The type of the Amazon Q Business subscription for the next month. + NextSubscription *types.SubscriptionDetails + + // The Amazon Resource Name (ARN) of the Amazon Q Business subscription being + // cancelled. + SubscriptionArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCancelSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelSubscription"); 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 = addOpCancelSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelSubscription(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_opCancelSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CancelSubscription", + } +} diff --git a/service/qbusiness/api_op_CreateDataAccessor.go b/service/qbusiness/api_op_CreateDataAccessor.go index 6b581cc71cd..edcc3e2ad6a 100644 --- a/service/qbusiness/api_op_CreateDataAccessor.go +++ b/service/qbusiness/api_op_CreateDataAccessor.go @@ -11,14 +11,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new data accessor for an ISV to access data from a Q Business +// Creates a new data accessor for an ISV to access data from a Amazon Q Business // application. The data accessor is an entity that represents the ISV's access to -// the Q Business application's data. It includes the IAM role ARN for the ISV, a -// friendly name, and a set of action configurations that define the specific -// actions the ISV is allowed to perform and any associated data filters. When the -// data accessor is created, an AWS IAM Identity Center application is also created -// to manage the ISV's identity and authentication for accessing the Q Business -// application. +// the Amazon Q Business application's data. It includes the IAM role ARN for the +// ISV, a friendly name, and a set of action configurations that define the +// specific actions the ISV is allowed to perform and any associated data filters. +// When the data accessor is created, an IAM Identity Center application is also +// created to manage the ISV's identity and authentication for accessing the Amazon +// Q Business application. func (c *Client) CreateDataAccessor(ctx context.Context, params *CreateDataAccessorInput, optFns ...func(*Options)) (*CreateDataAccessorOutput, error) { if params == nil { params = &CreateDataAccessorInput{} @@ -42,7 +42,7 @@ type CreateDataAccessorInput struct { // This member is required. ActionConfigurations []types.ActionConfiguration - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string @@ -80,8 +80,8 @@ type CreateDataAccessorOutput struct { // This member is required. DataAccessorId *string - // The Amazon Resource Name (ARN) of the AWS IAM Identity Center application - // created for this data accessor. + // The Amazon Resource Name (ARN) of the IAM Identity Center application created + // for this data accessor. // // This member is required. IdcApplicationArn *string diff --git a/service/qbusiness/api_op_CreateSubscription.go b/service/qbusiness/api_op_CreateSubscription.go new file mode 100644 index 00000000000..c242278befc --- /dev/null +++ b/service/qbusiness/api_op_CreateSubscription.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qbusiness + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qbusiness/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Subscribes an IAM Identity Center user or a group to a pricing tier for an +// Amazon Q Business application. +// +// Amazon Q Business offers two subscription tiers: Q_LITE and Q_BUSINESS . +// Subscription tier determines feature access for the user. For more information +// on subscriptions and pricing tiers, see [Amazon Q Business pricing]. +// +// [Amazon Q Business pricing]: https://aws.amazon.com/q/business/pricing/ +func (c *Client) CreateSubscription(ctx context.Context, params *CreateSubscriptionInput, optFns ...func(*Options)) (*CreateSubscriptionOutput, error) { + if params == nil { + params = &CreateSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSubscription", params, optFns, c.addOperationCreateSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSubscriptionInput struct { + + // The identifier of the Amazon Q Business application the subscription should be + // added to. + // + // This member is required. + ApplicationId *string + + // The IAM Identity Center UserId or GroupId of a user or group in the IAM + // Identity Center instance connected to the Amazon Q Business application. + // + // This member is required. + Principal types.SubscriptionPrincipal + + // The type of Amazon Q Business subscription you want to create. + // + // This member is required. + Type types.SubscriptionType + + // A token that you provide to identify the request to create a subscription for + // your Amazon Q Business application. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreateSubscriptionOutput struct { + + // The type of your current Amazon Q Business subscription. + CurrentSubscription *types.SubscriptionDetails + + // The type of the Amazon Q Business subscription for the next month. + NextSubscription *types.SubscriptionDetails + + // The Amazon Resource Name (ARN) of the Amazon Q Business subscription created. + SubscriptionArn *string + + // The identifier of the Amazon Q Business subscription created. + SubscriptionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSubscription"); 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 = addIdempotencyToken_opCreateSubscriptionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSubscription(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 +} + +type idempotencyToken_initializeOpCreateSubscription struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateSubscription) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateSubscriptionInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateSubscriptionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSubscription{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateSubscription", + } +} diff --git a/service/qbusiness/api_op_DeleteDataAccessor.go b/service/qbusiness/api_op_DeleteDataAccessor.go index b1e3a620b7d..7e66d14d5b6 100644 --- a/service/qbusiness/api_op_DeleteDataAccessor.go +++ b/service/qbusiness/api_op_DeleteDataAccessor.go @@ -11,8 +11,8 @@ import ( ) // Deletes a specified data accessor. This operation permanently removes the data -// accessor and its associated AWS IAM Identity Center application. Any access -// granted to the ISV through this data accessor will be revoked +// accessor and its associated IAM Identity Center application. Any access granted +// to the ISV through this data accessor will be revoked. func (c *Client) DeleteDataAccessor(ctx context.Context, params *DeleteDataAccessorInput, optFns ...func(*Options)) (*DeleteDataAccessorOutput, error) { if params == nil { params = &DeleteDataAccessorInput{} @@ -30,7 +30,7 @@ func (c *Client) DeleteDataAccessor(ctx context.Context, params *DeleteDataAcces type DeleteDataAccessorInput struct { - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string diff --git a/service/qbusiness/api_op_DisassociatePermission.go b/service/qbusiness/api_op_DisassociatePermission.go index 0f03ae71de3..659ad2a7c4a 100644 --- a/service/qbusiness/api_op_DisassociatePermission.go +++ b/service/qbusiness/api_op_DisassociatePermission.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes a permission policy from a Q Business application, revoking the +// Removes a permission policy from a Amazon Q Business application, revoking the // cross-account access that was previously granted to an ISV. This operation // deletes the specified policy statement from the application's permission policy. func (c *Client) DisassociatePermission(ctx context.Context, params *DisassociatePermissionInput, optFns ...func(*Options)) (*DisassociatePermissionOutput, error) { @@ -30,7 +30,7 @@ func (c *Client) DisassociatePermission(ctx context.Context, params *Disassociat type DisassociatePermissionInput struct { - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string diff --git a/service/qbusiness/api_op_GetDataAccessor.go b/service/qbusiness/api_op_GetDataAccessor.go index 32afcafa232..85e71e6d239 100644 --- a/service/qbusiness/api_op_GetDataAccessor.go +++ b/service/qbusiness/api_op_GetDataAccessor.go @@ -14,7 +14,7 @@ import ( // Retrieves information about a specified data accessor. This operation returns // details about the data accessor, including its display name, unique identifier, -// Amazon Resource Name (ARN), the associated Q Business application and AWS IAM +// Amazon Resource Name (ARN), the associated Amazon Q Business application and IAM // Identity Center application, the IAM role for the ISV, the action // configurations, and the timestamps for when the data accessor was created and // last updated. @@ -35,7 +35,7 @@ func (c *Client) GetDataAccessor(ctx context.Context, params *GetDataAccessorInp type GetDataAccessorInput struct { - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string @@ -54,8 +54,8 @@ type GetDataAccessorOutput struct { // associated filters. ActionConfigurations []types.ActionConfiguration - // The unique identifier of the Q Business application associated with this data - // accessor. + // The unique identifier of the Amazon Q Business application associated with this + // data accessor. ApplicationId *string // The timestamp when the data accessor was created. @@ -70,7 +70,7 @@ type GetDataAccessorOutput struct { // The friendly name of the data accessor. DisplayName *string - // The Amazon Resource Name (ARN) of the AWS IAM Identity Center application + // The Amazon Resource Name (ARN) of the IAM Identity Center application // associated with this data accessor. IdcApplicationArn *string diff --git a/service/qbusiness/api_op_GetPolicy.go b/service/qbusiness/api_op_GetPolicy.go index fcdcf91962f..e836a2e829d 100644 --- a/service/qbusiness/api_op_GetPolicy.go +++ b/service/qbusiness/api_op_GetPolicy.go @@ -10,9 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the current permission policy for a Q Business application. The -// policy is returned as a JSON-formatted string and defines the IAM actions that -// are allowed or denied for the application's resources. +// Retrieves the current permission policy for a Amazon Q Business application. +// The policy is returned as a JSON-formatted string and defines the IAM actions +// that are allowed or denied for the application's resources. func (c *Client) GetPolicy(ctx context.Context, params *GetPolicyInput, optFns ...func(*Options)) (*GetPolicyOutput, error) { if params == nil { params = &GetPolicyInput{} @@ -30,7 +30,7 @@ func (c *Client) GetPolicy(ctx context.Context, params *GetPolicyInput, optFns . type GetPolicyInput struct { - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string diff --git a/service/qbusiness/api_op_ListDataAccessors.go b/service/qbusiness/api_op_ListDataAccessors.go index 982c540f46b..30250561675 100644 --- a/service/qbusiness/api_op_ListDataAccessors.go +++ b/service/qbusiness/api_op_ListDataAccessors.go @@ -11,10 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the data accessors for a Q Business application. This operation returns a -// paginated list of data accessor summaries, including the friendly name, unique -// identifier, ARN, associated IAM role, and creation/update timestamps for each -// data accessor. +// Lists the data accessors for a Amazon Q Business application. This operation +// returns a paginated list of data accessor summaries, including the friendly +// name, unique identifier, ARN, associated IAM role, and creation/update +// timestamps for each data accessor. func (c *Client) ListDataAccessors(ctx context.Context, params *ListDataAccessorsInput, optFns ...func(*Options)) (*ListDataAccessorsOutput, error) { if params == nil { params = &ListDataAccessorsInput{} @@ -32,7 +32,7 @@ func (c *Client) ListDataAccessors(ctx context.Context, params *ListDataAccessor type ListDataAccessorsInput struct { - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string diff --git a/service/qbusiness/api_op_ListSubscriptions.go b/service/qbusiness/api_op_ListSubscriptions.go new file mode 100644 index 00000000000..a017fddcca4 --- /dev/null +++ b/service/qbusiness/api_op_ListSubscriptions.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qbusiness + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qbusiness/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all subscriptions created in an Amazon Q Business application. +func (c *Client) ListSubscriptions(ctx context.Context, params *ListSubscriptionsInput, optFns ...func(*Options)) (*ListSubscriptionsOutput, error) { + if params == nil { + params = &ListSubscriptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSubscriptions", params, optFns, c.addOperationListSubscriptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSubscriptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSubscriptionsInput struct { + + // The identifier of the Amazon Q Business application linked to the subscription. + // + // This member is required. + ApplicationId *string + + // The maximum number of Amazon Q Business subscriptions to return. + MaxResults *int32 + + // If the maxResults response was incomplete because there is more data to + // retrieve, Amazon Q Business returns a pagination token in the response. You can + // use this pagination token to retrieve the next set of Amazon Q Business + // subscriptions. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSubscriptionsOutput struct { + + // If the response is truncated, Amazon Q Business returns this token. You can use + // this token in a subsequent request to retrieve the next set of subscriptions. + NextToken *string + + // An array of summary information on the subscriptions configured for an Amazon Q + // Business application. + Subscriptions []types.Subscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSubscriptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSubscriptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSubscriptions"); 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 = addOpListSubscriptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSubscriptions(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 +} + +// ListSubscriptionsPaginatorOptions is the paginator options for ListSubscriptions +type ListSubscriptionsPaginatorOptions struct { + // The maximum number of Amazon Q Business subscriptions to return. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSubscriptionsPaginator is a paginator for ListSubscriptions +type ListSubscriptionsPaginator struct { + options ListSubscriptionsPaginatorOptions + client ListSubscriptionsAPIClient + params *ListSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewListSubscriptionsPaginator returns a new ListSubscriptionsPaginator +func NewListSubscriptionsPaginator(client ListSubscriptionsAPIClient, params *ListSubscriptionsInput, optFns ...func(*ListSubscriptionsPaginatorOptions)) *ListSubscriptionsPaginator { + if params == nil { + params = &ListSubscriptionsInput{} + } + + options := ListSubscriptionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSubscriptions page. +func (p *ListSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscriptionsOutput, 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.ListSubscriptions(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 +} + +// ListSubscriptionsAPIClient is a client that implements the ListSubscriptions +// operation. +type ListSubscriptionsAPIClient interface { + ListSubscriptions(context.Context, *ListSubscriptionsInput, ...func(*Options)) (*ListSubscriptionsOutput, error) +} + +var _ ListSubscriptionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSubscriptions", + } +} diff --git a/service/qbusiness/api_op_PutGroup.go b/service/qbusiness/api_op_PutGroup.go index 6a73b507542..253b9df44a2 100644 --- a/service/qbusiness/api_op_PutGroup.go +++ b/service/qbusiness/api_op_PutGroup.go @@ -19,6 +19,12 @@ import ( // teams. Only users who work in research and engineering, and therefore belong in // the intellectual property group, can see top-secret company documents in their // Amazon Q Business chat results. +// +// There are two options for creating groups, either passing group members inline +// or using an S3 file via the S3PathForGroupMembers field. For inline groups, +// there is a limit of 1000 members per group and for provided S3 files there is a +// limit of 100 thousand members. When creating a group using an S3 file, you +// provide both an S3 file and a RoleArn for Amazon Q Buisness to access the file. func (c *Client) PutGroup(ctx context.Context, params *PutGroupInput, optFns ...func(*Options)) (*PutGroupOutput, error) { if params == nil { params = &PutGroupInput{} @@ -74,9 +80,7 @@ type PutGroupInput struct { DataSourceId *string // The Amazon Resource Name (ARN) of an IAM role that has access to the S3 file - // that contains your list of users that belong to a group.The Amazon Resource Name - // (ARN) of an IAM role that has access to the S3 file that contains your list of - // users that belong to a group. + // that contains your list of users that belong to a group. RoleArn *string noSmithyDocumentSerde diff --git a/service/qbusiness/api_op_SearchRelevantContent.go b/service/qbusiness/api_op_SearchRelevantContent.go index bdc38214448..43c54979ca7 100644 --- a/service/qbusiness/api_op_SearchRelevantContent.go +++ b/service/qbusiness/api_op_SearchRelevantContent.go @@ -11,13 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Searches for relevant content in a Q Business application based on a query. -// This operation takes a search query text, the Q Business application identifier, -// and optional filters (such as content source and maximum results) as input. It -// returns a list of relevant content items, where each item includes the content -// text, the unique document identifier, the document title, the document URI, any -// relevant document attributes, and score attributes indicating the confidence -// level of the relevance. +// Searches for relevant content in a Amazon Q Business application based on a +// query. This operation takes a search query text, the Amazon Q Business +// application identifier, and optional filters (such as content source and maximum +// results) as input. It returns a list of relevant content items, where each item +// includes the content text, the unique document identifier, the document title, +// the document URI, any relevant document attributes, and score attributes +// indicating the confidence level of the relevance. func (c *Client) SearchRelevantContent(ctx context.Context, params *SearchRelevantContentInput, optFns ...func(*Options)) (*SearchRelevantContentOutput, error) { if params == nil { params = &SearchRelevantContentInput{} @@ -35,7 +35,7 @@ func (c *Client) SearchRelevantContent(ctx context.Context, params *SearchReleva type SearchRelevantContentInput struct { - // The unique identifier of the Q Business application to search. + // The unique identifier of the Amazon Q Business application to search. // // This member is required. ApplicationId *string diff --git a/service/qbusiness/api_op_UpdateDataAccessor.go b/service/qbusiness/api_op_UpdateDataAccessor.go index 486359f75b4..cf809421b2a 100644 --- a/service/qbusiness/api_op_UpdateDataAccessor.go +++ b/service/qbusiness/api_op_UpdateDataAccessor.go @@ -38,7 +38,7 @@ type UpdateDataAccessorInput struct { // This member is required. ActionConfigurations []types.ActionConfiguration - // The unique identifier of the Q Business application. + // The unique identifier of the Amazon Q Business application. // // This member is required. ApplicationId *string diff --git a/service/qbusiness/api_op_UpdateSubscription.go b/service/qbusiness/api_op_UpdateSubscription.go new file mode 100644 index 00000000000..5ab9f362ab5 --- /dev/null +++ b/service/qbusiness/api_op_UpdateSubscription.go @@ -0,0 +1,180 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qbusiness + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qbusiness/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the pricing tier for an Amazon Q Business subscription. Upgrades are +// instant. Downgrades apply at the start of the next month. Subscription tier +// determines feature access for the user. For more information on subscriptions +// and pricing tiers, see [Amazon Q Business pricing]. +// +// [Amazon Q Business pricing]: https://aws.amazon.com/q/business/pricing/ +func (c *Client) UpdateSubscription(ctx context.Context, params *UpdateSubscriptionInput, optFns ...func(*Options)) (*UpdateSubscriptionOutput, error) { + if params == nil { + params = &UpdateSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSubscription", params, optFns, c.addOperationUpdateSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSubscriptionInput struct { + + // The identifier of the Amazon Q Business application where the subscription + // update should take effect. + // + // This member is required. + ApplicationId *string + + // The identifier of the Amazon Q Business subscription to be updated. + // + // This member is required. + SubscriptionId *string + + // The type of the Amazon Q Business subscription to be updated. + // + // This member is required. + Type types.SubscriptionType + + noSmithyDocumentSerde +} + +type UpdateSubscriptionOutput struct { + + // The type of your current Amazon Q Business subscription. + CurrentSubscription *types.SubscriptionDetails + + // The type of the Amazon Q Business subscription for the next month. + NextSubscription *types.SubscriptionDetails + + // The Amazon Resource Name (ARN) of the Amazon Q Business subscription that was + // updated. + SubscriptionArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSubscription"); 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 = addOpUpdateSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSubscription(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_opUpdateSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateSubscription", + } +} diff --git a/service/qbusiness/deserializers.go b/service/qbusiness/deserializers.go index fcf8398f9cf..067f77342e7 100644 --- a/service/qbusiness/deserializers.go +++ b/service/qbusiness/deserializers.go @@ -546,6 +546,184 @@ func awsRestjson1_deserializeOpDocumentBatchPutDocumentOutput(v **BatchPutDocume return nil } +type awsRestjson1_deserializeOpCancelSubscription struct { +} + +func (*awsRestjson1_deserializeOpCancelSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCancelSubscription) 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_deserializeOpErrorCancelSubscription(response, &metadata) + } + output := &CancelSubscriptionOutput{} + 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_deserializeOpDocumentCancelSubscriptionOutput(&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_deserializeOpErrorCancelSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCancelSubscriptionOutput(v **CancelSubscriptionOutput, 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 *CancelSubscriptionOutput + if *v == nil { + sv = &CancelSubscriptionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currentSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.CurrentSubscription, value); err != nil { + return err + } + + case "nextSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.NextSubscription, value); err != nil { + return err + } + + case "subscriptionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionArn to be of type string, got %T instead", value) + } + sv.SubscriptionArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpChat struct { } @@ -1995,6 +2173,196 @@ func awsRestjson1_deserializeOpDocumentCreateRetrieverOutput(v **CreateRetriever return nil } +type awsRestjson1_deserializeOpCreateSubscription struct { +} + +func (*awsRestjson1_deserializeOpCreateSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSubscription) 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_deserializeOpErrorCreateSubscription(response, &metadata) + } + output := &CreateSubscriptionOutput{} + 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_deserializeOpDocumentCreateSubscriptionOutput(&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_deserializeOpErrorCreateSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSubscriptionOutput(v **CreateSubscriptionOutput, 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 *CreateSubscriptionOutput + if *v == nil { + sv = &CreateSubscriptionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currentSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.CurrentSubscription, value); err != nil { + return err + } + + case "nextSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.NextSubscription, value); err != nil { + return err + } + + case "subscriptionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionArn to be of type string, got %T instead", value) + } + sv.SubscriptionArn = ptr.String(jtv) + } + + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionId to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateUser struct { } @@ -8002,7 +8370,183 @@ func (m *awsRestjson1_deserializeOpListMessages) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMessagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMessagesOutput(&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_deserializeOpErrorListMessages(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("LicenseNotFoundException", errorCode): + return awsRestjson1_deserializeErrorLicenseNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListMessagesOutput(v **ListMessagesOutput, 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 *ListMessagesOutput + if *v == nil { + sv = &ListMessagesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "messages": + if err := awsRestjson1_deserializeDocumentMessages(&sv.Messages, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPluginActions struct { +} + +func (*awsRestjson1_deserializeOpListPluginActions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPluginActions) 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_deserializeOpErrorListPluginActions(response, &metadata) + } + output := &ListPluginActionsOutput{} + 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_deserializeOpDocumentListPluginActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8016,7 +8560,7 @@ func (m *awsRestjson1_deserializeOpListMessages) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMessages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPluginActions(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)} @@ -8063,9 +8607,6 @@ func awsRestjson1_deserializeOpErrorListMessages(response *smithyhttp.Response, case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("LicenseNotFoundException", errorCode): - return awsRestjson1_deserializeErrorLicenseNotFoundException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -8085,7 +8626,7 @@ func awsRestjson1_deserializeOpErrorListMessages(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListMessagesOutput(v **ListMessagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPluginActionsOutput(v **ListPluginActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8098,17 +8639,17 @@ func awsRestjson1_deserializeOpDocumentListMessagesOutput(v **ListMessagesOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMessagesOutput + var sv *ListPluginActionsOutput if *v == nil { - sv = &ListMessagesOutput{} + sv = &ListPluginActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "messages": - if err := awsRestjson1_deserializeDocumentMessages(&sv.Messages, value); err != nil { + case "items": + if err := awsRestjson1_deserializeDocumentActions(&sv.Items, value); err != nil { return err } @@ -8130,14 +8671,14 @@ func awsRestjson1_deserializeOpDocumentListMessagesOutput(v **ListMessagesOutput return nil } -type awsRestjson1_deserializeOpListPluginActions struct { +type awsRestjson1_deserializeOpListPlugins struct { } -func (*awsRestjson1_deserializeOpListPluginActions) ID() string { +func (*awsRestjson1_deserializeOpListPlugins) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPluginActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPlugins) 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) @@ -8155,9 +8696,9 @@ func (m *awsRestjson1_deserializeOpListPluginActions) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPluginActions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPlugins(response, &metadata) } - output := &ListPluginActionsOutput{} + output := &ListPluginsOutput{} out.Result = output var buff [1024]byte @@ -8178,7 +8719,7 @@ func (m *awsRestjson1_deserializeOpListPluginActions) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPluginActionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPluginsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8192,7 +8733,7 @@ func (m *awsRestjson1_deserializeOpListPluginActions) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPluginActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPlugins(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)} @@ -8258,7 +8799,7 @@ func awsRestjson1_deserializeOpErrorListPluginActions(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListPluginActionsOutput(v **ListPluginActionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPluginsOutput(v **ListPluginsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8271,20 +8812,15 @@ func awsRestjson1_deserializeOpDocumentListPluginActionsOutput(v **ListPluginAct return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPluginActionsOutput + var sv *ListPluginsOutput if *v == nil { - sv = &ListPluginActionsOutput{} + sv = &ListPluginsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "items": - if err := awsRestjson1_deserializeDocumentActions(&sv.Items, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -8294,6 +8830,11 @@ func awsRestjson1_deserializeOpDocumentListPluginActionsOutput(v **ListPluginAct sv.NextToken = ptr.String(jtv) } + case "plugins": + if err := awsRestjson1_deserializeDocumentPlugins(&sv.Plugins, value); err != nil { + return err + } + default: _, _ = key, value @@ -8303,14 +8844,14 @@ func awsRestjson1_deserializeOpDocumentListPluginActionsOutput(v **ListPluginAct return nil } -type awsRestjson1_deserializeOpListPlugins struct { +type awsRestjson1_deserializeOpListPluginTypeActions struct { } -func (*awsRestjson1_deserializeOpListPlugins) ID() string { +func (*awsRestjson1_deserializeOpListPluginTypeActions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPlugins) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPluginTypeActions) 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) @@ -8328,9 +8869,9 @@ func (m *awsRestjson1_deserializeOpListPlugins) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPlugins(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPluginTypeActions(response, &metadata) } - output := &ListPluginsOutput{} + output := &ListPluginTypeActionsOutput{} out.Result = output var buff [1024]byte @@ -8351,7 +8892,7 @@ func (m *awsRestjson1_deserializeOpListPlugins) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPluginsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPluginTypeActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8365,7 +8906,7 @@ func (m *awsRestjson1_deserializeOpListPlugins) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPlugins(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPluginTypeActions(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)} @@ -8412,9 +8953,6 @@ func awsRestjson1_deserializeOpErrorListPlugins(response *smithyhttp.Response, m case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -8431,7 +8969,7 @@ func awsRestjson1_deserializeOpErrorListPlugins(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListPluginsOutput(v **ListPluginsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPluginTypeActionsOutput(v **ListPluginTypeActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8444,15 +8982,20 @@ func awsRestjson1_deserializeOpDocumentListPluginsOutput(v **ListPluginsOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPluginsOutput + var sv *ListPluginTypeActionsOutput if *v == nil { - sv = &ListPluginsOutput{} + sv = &ListPluginTypeActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "items": + if err := awsRestjson1_deserializeDocumentActions(&sv.Items, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -8462,11 +9005,6 @@ func awsRestjson1_deserializeOpDocumentListPluginsOutput(v **ListPluginsOutput, sv.NextToken = ptr.String(jtv) } - case "plugins": - if err := awsRestjson1_deserializeDocumentPlugins(&sv.Plugins, value); err != nil { - return err - } - default: _, _ = key, value @@ -8476,14 +9014,14 @@ func awsRestjson1_deserializeOpDocumentListPluginsOutput(v **ListPluginsOutput, return nil } -type awsRestjson1_deserializeOpListPluginTypeActions struct { +type awsRestjson1_deserializeOpListPluginTypeMetadata struct { } -func (*awsRestjson1_deserializeOpListPluginTypeActions) ID() string { +func (*awsRestjson1_deserializeOpListPluginTypeMetadata) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPluginTypeActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPluginTypeMetadata) 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) @@ -8501,9 +9039,9 @@ func (m *awsRestjson1_deserializeOpListPluginTypeActions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPluginTypeActions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPluginTypeMetadata(response, &metadata) } - output := &ListPluginTypeActionsOutput{} + output := &ListPluginTypeMetadataOutput{} out.Result = output var buff [1024]byte @@ -8524,7 +9062,7 @@ func (m *awsRestjson1_deserializeOpListPluginTypeActions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPluginTypeActionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPluginTypeMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8538,7 +9076,7 @@ func (m *awsRestjson1_deserializeOpListPluginTypeActions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPluginTypeActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPluginTypeMetadata(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)} @@ -8601,7 +9139,7 @@ func awsRestjson1_deserializeOpErrorListPluginTypeActions(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListPluginTypeActionsOutput(v **ListPluginTypeActionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPluginTypeMetadataOutput(v **ListPluginTypeMetadataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8614,9 +9152,9 @@ func awsRestjson1_deserializeOpDocumentListPluginTypeActionsOutput(v **ListPlugi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPluginTypeActionsOutput + var sv *ListPluginTypeMetadataOutput if *v == nil { - sv = &ListPluginTypeActionsOutput{} + sv = &ListPluginTypeMetadataOutput{} } else { sv = *v } @@ -8624,7 +9162,7 @@ func awsRestjson1_deserializeOpDocumentListPluginTypeActionsOutput(v **ListPlugi for key, value := range shape { switch key { case "items": - if err := awsRestjson1_deserializeDocumentActions(&sv.Items, value); err != nil { + if err := awsRestjson1_deserializeDocumentListPluginTypeMetadataSummaries(&sv.Items, value); err != nil { return err } @@ -8646,14 +9184,14 @@ func awsRestjson1_deserializeOpDocumentListPluginTypeActionsOutput(v **ListPlugi return nil } -type awsRestjson1_deserializeOpListPluginTypeMetadata struct { +type awsRestjson1_deserializeOpListRetrievers struct { } -func (*awsRestjson1_deserializeOpListPluginTypeMetadata) ID() string { +func (*awsRestjson1_deserializeOpListRetrievers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPluginTypeMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRetrievers) 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) @@ -8671,9 +9209,9 @@ func (m *awsRestjson1_deserializeOpListPluginTypeMetadata) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPluginTypeMetadata(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRetrievers(response, &metadata) } - output := &ListPluginTypeMetadataOutput{} + output := &ListRetrieversOutput{} out.Result = output var buff [1024]byte @@ -8694,7 +9232,7 @@ func (m *awsRestjson1_deserializeOpListPluginTypeMetadata) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPluginTypeMetadataOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRetrieversOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8708,7 +9246,7 @@ func (m *awsRestjson1_deserializeOpListPluginTypeMetadata) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPluginTypeMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRetrievers(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)} @@ -8755,6 +9293,9 @@ func awsRestjson1_deserializeOpErrorListPluginTypeMetadata(response *smithyhttp. case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -8771,7 +9312,7 @@ func awsRestjson1_deserializeOpErrorListPluginTypeMetadata(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListPluginTypeMetadataOutput(v **ListPluginTypeMetadataOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRetrieversOutput(v **ListRetrieversOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8784,20 +9325,15 @@ func awsRestjson1_deserializeOpDocumentListPluginTypeMetadataOutput(v **ListPlug return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPluginTypeMetadataOutput + var sv *ListRetrieversOutput if *v == nil { - sv = &ListPluginTypeMetadataOutput{} + sv = &ListRetrieversOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "items": - if err := awsRestjson1_deserializeDocumentListPluginTypeMetadataSummaries(&sv.Items, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -8807,6 +9343,11 @@ func awsRestjson1_deserializeOpDocumentListPluginTypeMetadataOutput(v **ListPlug sv.NextToken = ptr.String(jtv) } + case "retrievers": + if err := awsRestjson1_deserializeDocumentRetrievers(&sv.Retrievers, value); err != nil { + return err + } + default: _, _ = key, value @@ -8816,14 +9357,14 @@ func awsRestjson1_deserializeOpDocumentListPluginTypeMetadataOutput(v **ListPlug return nil } -type awsRestjson1_deserializeOpListRetrievers struct { +type awsRestjson1_deserializeOpListSubscriptions struct { } -func (*awsRestjson1_deserializeOpListRetrievers) ID() string { +func (*awsRestjson1_deserializeOpListSubscriptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRetrievers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSubscriptions) 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) @@ -8841,9 +9382,9 @@ func (m *awsRestjson1_deserializeOpListRetrievers) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRetrievers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSubscriptions(response, &metadata) } - output := &ListRetrieversOutput{} + output := &ListSubscriptionsOutput{} out.Result = output var buff [1024]byte @@ -8864,7 +9405,7 @@ func (m *awsRestjson1_deserializeOpListRetrievers) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRetrieversOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSubscriptionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8878,7 +9419,7 @@ func (m *awsRestjson1_deserializeOpListRetrievers) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRetrievers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSubscriptions(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)} @@ -8922,6 +9463,9 @@ func awsRestjson1_deserializeOpErrorListRetrievers(response *smithyhttp.Response case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -8944,7 +9488,7 @@ func awsRestjson1_deserializeOpErrorListRetrievers(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListRetrieversOutput(v **ListRetrieversOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSubscriptionsOutput(v **ListSubscriptionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8957,9 +9501,9 @@ func awsRestjson1_deserializeOpDocumentListRetrieversOutput(v **ListRetrieversOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRetrieversOutput + var sv *ListSubscriptionsOutput if *v == nil { - sv = &ListRetrieversOutput{} + sv = &ListSubscriptionsOutput{} } else { sv = *v } @@ -8975,8 +9519,8 @@ func awsRestjson1_deserializeOpDocumentListRetrieversOutput(v **ListRetrieversOu sv.NextToken = ptr.String(jtv) } - case "retrievers": - if err := awsRestjson1_deserializeDocumentRetrievers(&sv.Retrievers, value); err != nil { + case "subscriptions": + if err := awsRestjson1_deserializeDocumentSubscriptions(&sv.Subscriptions, value); err != nil { return err } @@ -10634,16 +11178,122 @@ func (m *awsRestjson1_deserializeOpUpdateIndex) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateIndex(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateIndex(response, &metadata) + } + output := &UpdateIndexOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdatePlugin struct { +} + +func (*awsRestjson1_deserializeOpUpdatePlugin) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePlugin) 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_deserializeOpErrorUpdatePlugin(response, &metadata) } - output := &UpdateIndexOutput{} + output := &UpdatePluginOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePlugin(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)} @@ -10715,14 +11365,14 @@ func awsRestjson1_deserializeOpErrorUpdateIndex(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUpdatePlugin struct { +type awsRestjson1_deserializeOpUpdateRetriever struct { } -func (*awsRestjson1_deserializeOpUpdatePlugin) ID() string { +func (*awsRestjson1_deserializeOpUpdateRetriever) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdatePlugin) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateRetriever) 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) @@ -10740,16 +11390,16 @@ func (m *awsRestjson1_deserializeOpUpdatePlugin) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePlugin(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateRetriever(response, &metadata) } - output := &UpdatePluginOutput{} + output := &UpdateRetrieverOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdatePlugin(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateRetriever(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)} @@ -10821,14 +11471,14 @@ func awsRestjson1_deserializeOpErrorUpdatePlugin(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateRetriever struct { +type awsRestjson1_deserializeOpUpdateSubscription struct { } -func (*awsRestjson1_deserializeOpUpdateRetriever) ID() string { +func (*awsRestjson1_deserializeOpUpdateSubscription) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateRetriever) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateSubscription) 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) @@ -10846,16 +11496,44 @@ func (m *awsRestjson1_deserializeOpUpdateRetriever) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateRetriever(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateSubscription(response, &metadata) } - output := &UpdateRetrieverOutput{} + output := &UpdateSubscriptionOutput{} 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_deserializeOpDocumentUpdateSubscriptionOutput(&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_deserializeOpErrorUpdateRetriever(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateSubscription(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)} @@ -10908,9 +11586,6 @@ func awsRestjson1_deserializeOpErrorUpdateRetriever(response *smithyhttp.Respons case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10927,6 +11602,56 @@ func awsRestjson1_deserializeOpErrorUpdateRetriever(response *smithyhttp.Respons } } +func awsRestjson1_deserializeOpDocumentUpdateSubscriptionOutput(v **UpdateSubscriptionOutput, 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 *UpdateSubscriptionOutput + if *v == nil { + sv = &UpdateSubscriptionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currentSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.CurrentSubscription, value); err != nil { + return err + } + + case "nextSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.NextSubscription, value); err != nil { + return err + } + + case "subscriptionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionArn to be of type string, got %T instead", value) + } + sv.SubscriptionArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpUpdateUser struct { } @@ -18725,6 +19450,198 @@ func awsRestjson1_deserializeDocumentSubnetIds(v *[]string, value interface{}) e return nil } +func awsRestjson1_deserializeDocumentSubscription(v **types.Subscription, 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.Subscription + if *v == nil { + sv = &types.Subscription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "currentSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.CurrentSubscription, value); err != nil { + return err + } + + case "nextSubscription": + if err := awsRestjson1_deserializeDocumentSubscriptionDetails(&sv.NextSubscription, value); err != nil { + return err + } + + case "principal": + if err := awsRestjson1_deserializeDocumentSubscriptionPrincipal(&sv.Principal, value); err != nil { + return err + } + + case "subscriptionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionArn to be of type string, got %T instead", value) + } + sv.SubscriptionArn = ptr.String(jtv) + } + + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionId to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSubscriptionDetails(v **types.SubscriptionDetails, 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.SubscriptionDetails + if *v == nil { + sv = &types.SubscriptionDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubscriptionType to be of type string, got %T instead", value) + } + sv.Type = types.SubscriptionType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSubscriptionPrincipal(v *types.SubscriptionPrincipal, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.SubscriptionPrincipal +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "group": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GroupIdentifier to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.SubscriptionPrincipalMemberGroup{Value: mv} + break loop + + case "user": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserIdentifier to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.SubscriptionPrincipalMemberUser{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentSubscriptions(v *[]types.Subscription, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Subscription + if *v == nil { + cv = []types.Subscription{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Subscription + destAddr := &col + if err := awsRestjson1_deserializeDocumentSubscription(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/qbusiness/generated.json b/service/qbusiness/generated.json index 81b6698c682..8b0a039df8f 100644 --- a/service/qbusiness/generated.json +++ b/service/qbusiness/generated.json @@ -12,6 +12,7 @@ "api_op_AssociatePermission.go", "api_op_BatchDeleteDocument.go", "api_op_BatchPutDocument.go", + "api_op_CancelSubscription.go", "api_op_Chat.go", "api_op_ChatSync.go", "api_op_CreateApplication.go", @@ -20,6 +21,7 @@ "api_op_CreateIndex.go", "api_op_CreatePlugin.go", "api_op_CreateRetriever.go", + "api_op_CreateSubscription.go", "api_op_CreateUser.go", "api_op_CreateWebExperience.go", "api_op_DeleteApplication.go", @@ -61,6 +63,7 @@ "api_op_ListPluginTypeMetadata.go", "api_op_ListPlugins.go", "api_op_ListRetrievers.go", + "api_op_ListSubscriptions.go", "api_op_ListTagsForResource.go", "api_op_ListWebExperiences.go", "api_op_PutFeedback.go", @@ -77,6 +80,7 @@ "api_op_UpdateIndex.go", "api_op_UpdatePlugin.go", "api_op_UpdateRetriever.go", + "api_op_UpdateSubscription.go", "api_op_UpdateUser.go", "api_op_UpdateWebExperience.go", "auth.go", diff --git a/service/qbusiness/serializers.go b/service/qbusiness/serializers.go index 5a83696590c..5002966c4d1 100644 --- a/service/qbusiness/serializers.go +++ b/service/qbusiness/serializers.go @@ -351,6 +351,86 @@ func awsRestjson1_serializeOpDocumentBatchPutDocumentInput(v *BatchPutDocumentIn return nil } +type awsRestjson1_serializeOpCancelSubscription struct { +} + +func (*awsRestjson1_serializeOpCancelSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCancelSubscription) 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.(*CancelSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/subscriptions/{subscriptionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + 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_serializeOpHttpBindingsCancelSubscriptionInput(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_serializeOpHttpBindingsCancelSubscriptionInput(v *CancelSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { + return err + } + } + + if v.SubscriptionId == nil || len(*v.SubscriptionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member subscriptionId must not be empty")} + } + if v.SubscriptionId != nil { + if err := encoder.SetURI("subscriptionId").String(*v.SubscriptionId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpChat struct { } @@ -1417,6 +1497,112 @@ func awsRestjson1_serializeOpDocumentCreateRetrieverInput(v *CreateRetrieverInpu return nil } +type awsRestjson1_serializeOpCreateSubscription struct { +} + +func (*awsRestjson1_serializeOpCreateSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSubscription) 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.(*CreateSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/subscriptions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + 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_serializeOpHttpBindingsCreateSubscriptionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSubscriptionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateSubscriptionInput(v *CreateSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSubscriptionInput(v *CreateSubscriptionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Principal != nil { + ok := object.Key("principal") + if err := awsRestjson1_serializeDocumentSubscriptionPrincipal(v.Principal, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + type awsRestjson1_serializeOpCreateUser struct { } @@ -4898,6 +5084,85 @@ func awsRestjson1_serializeOpHttpBindingsListRetrieversInput(v *ListRetrieversIn return nil } +type awsRestjson1_serializeOpListSubscriptions struct { +} + +func (*awsRestjson1_serializeOpListSubscriptions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSubscriptions) 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.(*ListSubscriptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/subscriptions") + 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_serializeOpHttpBindingsListSubscriptionsInput(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_serializeOpHttpBindingsListSubscriptionsInput(v *ListSubscriptionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("applicationId").String(*v.ApplicationId); 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_serializeOpListTagsForResource struct { } @@ -6658,6 +6923,109 @@ func awsRestjson1_serializeOpDocumentUpdateRetrieverInput(v *UpdateRetrieverInpu return nil } +type awsRestjson1_serializeOpUpdateSubscription struct { +} + +func (*awsRestjson1_serializeOpUpdateSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSubscription) 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.(*UpdateSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/subscriptions/{subscriptionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + 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_serializeOpHttpBindingsUpdateSubscriptionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSubscriptionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateSubscriptionInput(v *UpdateSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { + return err + } + } + + if v.SubscriptionId == nil || len(*v.SubscriptionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member subscriptionId must not be empty")} + } + if v.SubscriptionId != nil { + if err := encoder.SetURI("subscriptionId").String(*v.SubscriptionId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSubscriptionInput(v *UpdateSubscriptionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + type awsRestjson1_serializeOpUpdateUser struct { } @@ -8992,6 +9360,26 @@ func awsRestjson1_serializeDocumentSubnetIds(v []string, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentSubscriptionPrincipal(v types.SubscriptionPrincipal, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SubscriptionPrincipalMemberGroup: + av := object.Key("group") + av.String(uv.Value) + + case *types.SubscriptionPrincipalMemberUser: + av := object.Key("user") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/qbusiness/snapshot/api_op_CancelSubscription.go.snap b/service/qbusiness/snapshot/api_op_CancelSubscription.go.snap new file mode 100644 index 00000000000..1fd68a3d1eb --- /dev/null +++ b/service/qbusiness/snapshot/api_op_CancelSubscription.go.snap @@ -0,0 +1,41 @@ +CancelSubscription + 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 + spanRetryLoop + Retry + RetryMetricsHeader + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qbusiness/snapshot/api_op_CreateSubscription.go.snap b/service/qbusiness/snapshot/api_op_CreateSubscription.go.snap new file mode 100644 index 00000000000..33306351abe --- /dev/null +++ b/service/qbusiness/snapshot/api_op_CreateSubscription.go.snap @@ -0,0 +1,42 @@ +CreateSubscription + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + spanRetryLoop + Retry + RetryMetricsHeader + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qbusiness/snapshot/api_op_ListSubscriptions.go.snap b/service/qbusiness/snapshot/api_op_ListSubscriptions.go.snap new file mode 100644 index 00000000000..de1b4b801bf --- /dev/null +++ b/service/qbusiness/snapshot/api_op_ListSubscriptions.go.snap @@ -0,0 +1,41 @@ +ListSubscriptions + 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 + spanRetryLoop + Retry + RetryMetricsHeader + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qbusiness/snapshot/api_op_UpdateSubscription.go.snap b/service/qbusiness/snapshot/api_op_UpdateSubscription.go.snap new file mode 100644 index 00000000000..830667b9b9b --- /dev/null +++ b/service/qbusiness/snapshot/api_op_UpdateSubscription.go.snap @@ -0,0 +1,41 @@ +UpdateSubscription + 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 + spanRetryLoop + Retry + RetryMetricsHeader + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qbusiness/snapshot_test.go b/service/qbusiness/snapshot_test.go index 445b16b3eb1..d011045d0f6 100644 --- a/service/qbusiness/snapshot_test.go +++ b/service/qbusiness/snapshot_test.go @@ -98,6 +98,18 @@ func TestCheckSnapshot_BatchPutDocument(t *testing.T) { } } +func TestCheckSnapshot_CancelSubscription(t *testing.T) { + svc := New(Options{}) + _, err := svc.CancelSubscription(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CancelSubscription") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_Chat(t *testing.T) { svc := New(Options{}) _, err := svc.Chat(context.Background(), nil, func(o *Options) { @@ -194,6 +206,18 @@ func TestCheckSnapshot_CreateRetriever(t *testing.T) { } } +func TestCheckSnapshot_CreateSubscription(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateSubscription(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateSubscription") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateUser(t *testing.T) { svc := New(Options{}) _, err := svc.CreateUser(context.Background(), nil, func(o *Options) { @@ -686,6 +710,18 @@ func TestCheckSnapshot_ListRetrievers(t *testing.T) { } } +func TestCheckSnapshot_ListSubscriptions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListSubscriptions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListSubscriptions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -878,6 +914,18 @@ func TestCheckSnapshot_UpdateRetriever(t *testing.T) { } } +func TestCheckSnapshot_UpdateSubscription(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateSubscription(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateSubscription") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateUser(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateUser(context.Background(), nil, func(o *Options) { @@ -937,6 +985,18 @@ func TestUpdateSnapshot_BatchPutDocument(t *testing.T) { } } +func TestUpdateSnapshot_CancelSubscription(t *testing.T) { + svc := New(Options{}) + _, err := svc.CancelSubscription(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CancelSubscription") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_Chat(t *testing.T) { svc := New(Options{}) _, err := svc.Chat(context.Background(), nil, func(o *Options) { @@ -1033,6 +1093,18 @@ func TestUpdateSnapshot_CreateRetriever(t *testing.T) { } } +func TestUpdateSnapshot_CreateSubscription(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateSubscription(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateSubscription") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateUser(t *testing.T) { svc := New(Options{}) _, err := svc.CreateUser(context.Background(), nil, func(o *Options) { @@ -1525,6 +1597,18 @@ func TestUpdateSnapshot_ListRetrievers(t *testing.T) { } } +func TestUpdateSnapshot_ListSubscriptions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListSubscriptions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListSubscriptions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -1717,6 +1801,18 @@ func TestUpdateSnapshot_UpdateRetriever(t *testing.T) { } } +func TestUpdateSnapshot_UpdateSubscription(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateSubscription(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateSubscription") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateUser(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateUser(context.Background(), nil, func(o *Options) { diff --git a/service/qbusiness/types/types.go b/service/qbusiness/types/types.go index 7faf79c3db1..7f6f0d1e0b4 100644 --- a/service/qbusiness/types/types.go +++ b/service/qbusiness/types/types.go @@ -42,7 +42,7 @@ type AccessControl struct { // Specifies an allowed action and its associated filter configuration. type ActionConfiguration struct { - // The Q Business action that is allowed. + // The Amazon Q Business action that is allowed. // // This member is required. Action *string @@ -1009,7 +1009,7 @@ type DataAccessor struct { // The friendly name of the data accessor. DisplayName *string - // The Amazon Resource Name (ARN) of the associated AWS IAM Identity Center + // The Amazon Resource Name (ARN) of the associated IAM Identity Center // application. IdcApplicationArn *string @@ -2613,6 +2613,78 @@ type StringListAttributeBoostingConfiguration struct { noSmithyDocumentSerde } +// Information about an Amazon Q Business subscription. +// +// Subscriptions are used to provide access for an IAM Identity Center user or a +// group to an Amazon Q Business application. +// +// Amazon Q Business offers two subscription tiers: Q_LITE and Q_BUSINESS . +// Subscription tier determines feature access for the user. For more information +// on subscriptions and pricing tiers, see [Amazon Q Business pricing]. +// +// [Amazon Q Business pricing]: https://aws.amazon.com/q/business/pricing/ +type Subscription struct { + + // The type of your current Amazon Q Business subscription. + CurrentSubscription *SubscriptionDetails + + // The type of the Amazon Q Business subscription for the next month. + NextSubscription *SubscriptionDetails + + // The IAM Identity Center UserId or GroupId of a user or group in the IAM + // Identity Center instance connected to the Amazon Q Business application. + Principal SubscriptionPrincipal + + // The Amazon Resource Name (ARN) of the Amazon Q Business subscription that was + // updated. + SubscriptionArn *string + + // The identifier of the Amazon Q Business subscription to be updated. + SubscriptionId *string + + noSmithyDocumentSerde +} + +// The details of an Amazon Q Business subscription. +type SubscriptionDetails struct { + + // The type of an Amazon Q Business subscription. + Type SubscriptionType + + noSmithyDocumentSerde +} + +// A user or group in the IAM Identity Center instance connected to the Amazon Q +// Business application. +// +// The following types satisfy this interface: +// +// SubscriptionPrincipalMemberGroup +// SubscriptionPrincipalMemberUser +type SubscriptionPrincipal interface { + isSubscriptionPrincipal() +} + +// The identifier of a group in the IAM Identity Center instance connected to the +// Amazon Q Business application. +type SubscriptionPrincipalMemberGroup struct { + Value string + + noSmithyDocumentSerde +} + +func (*SubscriptionPrincipalMemberGroup) isSubscriptionPrincipal() {} + +// The identifier of a user in the IAM Identity Center instance connected to the +// Amazon Q Business application. +type SubscriptionPrincipalMemberUser struct { + Value string + + noSmithyDocumentSerde +} + +func (*SubscriptionPrincipalMemberUser) isSubscriptionPrincipal() {} + // A list of key/value pairs that identify an index, FAQ, or data source. Tag keys // and values can consist of Unicode letters, digits, white space, and any of the // following symbols: _ . : / = + - @. @@ -2842,4 +2914,5 @@ func (*UnknownUnionMember) isPluginAuthConfiguration() {} func (*UnknownUnionMember) isPrincipal() {} func (*UnknownUnionMember) isRetrieverConfiguration() {} func (*UnknownUnionMember) isRuleConfiguration() {} +func (*UnknownUnionMember) isSubscriptionPrincipal() {} func (*UnknownUnionMember) isWebExperienceAuthConfiguration() {} diff --git a/service/qbusiness/types/types_exported_test.go b/service/qbusiness/types/types_exported_test.go index e95ce4e76c8..9f106f6b84d 100644 --- a/service/qbusiness/types/types_exported_test.go +++ b/service/qbusiness/types/types_exported_test.go @@ -356,6 +356,28 @@ func ExampleRuleConfiguration_outputUsage() { var _ *types.ContentRetrievalRule var _ *types.ContentBlockerRule +func ExampleSubscriptionPrincipal_outputUsage() { + var union types.SubscriptionPrincipal + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SubscriptionPrincipalMemberGroup: + _ = v.Value // Value is string + + case *types.SubscriptionPrincipalMemberUser: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string +var _ *string + func ExampleWebExperienceAuthConfiguration_outputUsage() { var union types.WebExperienceAuthConfiguration // type switches can be used to check the union value diff --git a/service/qbusiness/validators.go b/service/qbusiness/validators.go index c1206de0374..bbeced1371b 100644 --- a/service/qbusiness/validators.go +++ b/service/qbusiness/validators.go @@ -70,6 +70,26 @@ func (m *validateOpBatchPutDocument) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpCancelSubscription struct { +} + +func (*validateOpCancelSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpChat struct { } @@ -230,6 +250,26 @@ func (m *validateOpCreateRetriever) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpCreateSubscription struct { +} + +func (*validateOpCreateSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateUser struct { } @@ -1010,6 +1050,26 @@ func (m *validateOpListRetrievers) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpListSubscriptions struct { +} + +func (*validateOpListSubscriptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSubscriptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSubscriptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSubscriptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -1330,6 +1390,26 @@ func (m *validateOpUpdateRetriever) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpUpdateSubscription struct { +} + +func (*validateOpUpdateSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateUser struct { } @@ -1382,6 +1462,10 @@ func addOpBatchPutDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchPutDocument{}, middleware.After) } +func addOpCancelSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelSubscription{}, middleware.After) +} + func addOpChatValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpChat{}, middleware.After) } @@ -1414,6 +1498,10 @@ func addOpCreateRetrieverValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRetriever{}, middleware.After) } +func addOpCreateSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSubscription{}, middleware.After) +} + func addOpCreateUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateUser{}, middleware.After) } @@ -1570,6 +1658,10 @@ func addOpListRetrieversValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListRetrievers{}, middleware.After) } +func addOpListSubscriptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSubscriptions{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -1634,6 +1726,10 @@ func addOpUpdateRetrieverValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRetriever{}, middleware.After) } +func addOpUpdateSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSubscription{}, middleware.After) +} + func addOpUpdateUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateUser{}, middleware.After) } @@ -3395,6 +3491,24 @@ func validateOpBatchPutDocumentInput(v *BatchPutDocumentInput) error { } } +func validateOpCancelSubscriptionInput(v *CancelSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelSubscriptionInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if v.SubscriptionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpChatInput(v *ChatInput) error { if v == nil { return nil @@ -3661,6 +3775,27 @@ func validateOpCreateRetrieverInput(v *CreateRetrieverInput) error { } } +func validateOpCreateSubscriptionInput(v *CreateSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSubscriptionInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if v.Principal == nil { + invalidParams.Add(smithy.NewErrParamRequired("Principal")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateUserInput(v *CreateUserInput) error { if v == nil { return nil @@ -4368,6 +4503,21 @@ func validateOpListRetrieversInput(v *ListRetrieversInput) error { } } +func validateOpListSubscriptionsInput(v *ListSubscriptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSubscriptionsInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -4762,6 +4912,27 @@ func validateOpUpdateRetrieverInput(v *UpdateRetrieverInput) error { } } +func validateOpUpdateSubscriptionInput(v *UpdateSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSubscriptionInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if v.SubscriptionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionId")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateUserInput(v *UpdateUserInput) error { if v == nil { return nil diff --git a/service/s3tables/api_op_CreateNamespace.go b/service/s3tables/api_op_CreateNamespace.go index 829ba1c4544..2bee63de9e4 100644 --- a/service/s3tables/api_op_CreateNamespace.go +++ b/service/s3tables/api_op_CreateNamespace.go @@ -11,9 +11,13 @@ import ( ) // Creates a namespace. A namespace is a logical grouping of tables within your -// table bucket, which you can use to organize tables. For more information, see [Table namespaces]. +// table bucket, which you can use to organize tables. For more information, see [Create a namespace] +// in the Amazon Simple Storage Service User Guide. // -// [Table namespaces]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-namespace.html +// Permissions You must have the s3tables:CreateNamespace permission to use this +// operation. +// +// [Create a namespace]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-namespace-create.html func (c *Client) CreateNamespace(ctx context.Context, params *CreateNamespaceInput, optFns ...func(*Options)) (*CreateNamespaceOutput, error) { if params == nil { params = &CreateNamespaceInput{} diff --git a/service/s3tables/api_op_CreateTable.go b/service/s3tables/api_op_CreateTable.go index f28773ec955..233b07a3b2b 100644 --- a/service/s3tables/api_op_CreateTable.go +++ b/service/s3tables/api_op_CreateTable.go @@ -11,7 +11,16 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new table associated with the given namespace in a table bucket. +// Creates a new table associated with the given namespace in a table bucket. For +// more information, see [Creating an Amazon S3 table]in the Amazon Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:CreateTable permission to use this +// operation. +// +// Additionally, you must have the s3tables:PutTableData permission to use this +// operation with the optional metadata request parameter. +// +// [Creating an Amazon S3 table]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-create.html func (c *Client) CreateTable(ctx context.Context, params *CreateTableInput, optFns ...func(*Options)) (*CreateTableOutput, error) { if params == nil { params = &CreateTableInput{} @@ -49,6 +58,9 @@ type CreateTableInput struct { // This member is required. TableBucketARN *string + // The metadata for the table. + Metadata types.TableMetadata + noSmithyDocumentSerde } diff --git a/service/s3tables/api_op_CreateTableBucket.go b/service/s3tables/api_op_CreateTableBucket.go index e2089307180..d90601e8a99 100644 --- a/service/s3tables/api_op_CreateTableBucket.go +++ b/service/s3tables/api_op_CreateTableBucket.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a table bucket. +// Creates a table bucket. For more information, see [Creating a table bucket] in the Amazon Simple Storage +// Service User Guide. +// +// Permissions You must have the s3tables:CreateTableBucket permission to use this +// operation. +// +// [Creating a table bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-create.html func (c *Client) CreateTableBucket(ctx context.Context, params *CreateTableBucketInput, optFns ...func(*Options)) (*CreateTableBucketOutput, error) { if params == nil { params = &CreateTableBucketInput{} diff --git a/service/s3tables/api_op_DeleteNamespace.go b/service/s3tables/api_op_DeleteNamespace.go index 62c9b7db696..84ddf91ca3f 100644 --- a/service/s3tables/api_op_DeleteNamespace.go +++ b/service/s3tables/api_op_DeleteNamespace.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a namespace. +// Deletes a namespace. For more information, see [Delete a namespace] in the Amazon Simple Storage +// Service User Guide. +// +// Permissions You must have the s3tables:DeleteNamespace permission to use this +// operation. +// +// [Delete a namespace]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-namespace-delete.html func (c *Client) DeleteNamespace(ctx context.Context, params *DeleteNamespaceInput, optFns ...func(*Options)) (*DeleteNamespaceOutput, error) { if params == nil { params = &DeleteNamespaceInput{} diff --git a/service/s3tables/api_op_DeleteTable.go b/service/s3tables/api_op_DeleteTable.go index 6a1c520347a..1e2faafb766 100644 --- a/service/s3tables/api_op_DeleteTable.go +++ b/service/s3tables/api_op_DeleteTable.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a table. +// Deletes a table. For more information, see [Deleting an Amazon S3 table] in the Amazon Simple Storage +// Service User Guide. +// +// Permissions You must have the s3tables:DeleteTable permission to use this +// operation. +// +// [Deleting an Amazon S3 table]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-delete.html func (c *Client) DeleteTable(ctx context.Context, params *DeleteTableInput, optFns ...func(*Options)) (*DeleteTableOutput, error) { if params == nil { params = &DeleteTableInput{} diff --git a/service/s3tables/api_op_DeleteTableBucket.go b/service/s3tables/api_op_DeleteTableBucket.go index 941fe495db6..6641eb3884b 100644 --- a/service/s3tables/api_op_DeleteTableBucket.go +++ b/service/s3tables/api_op_DeleteTableBucket.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a table bucket. +// Deletes a table bucket. For more information, see [Deleting a table bucket] in the Amazon Simple Storage +// Service User Guide. +// +// Permissions You must have the s3tables:DeleteTableBucket permission to use this +// operation. +// +// [Deleting a table bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-delete.html func (c *Client) DeleteTableBucket(ctx context.Context, params *DeleteTableBucketInput, optFns ...func(*Options)) (*DeleteTableBucketOutput, error) { if params == nil { params = &DeleteTableBucketInput{} diff --git a/service/s3tables/api_op_DeleteTableBucketPolicy.go b/service/s3tables/api_op_DeleteTableBucketPolicy.go index 7e054cd4989..67365d7f4f7 100644 --- a/service/s3tables/api_op_DeleteTableBucketPolicy.go +++ b/service/s3tables/api_op_DeleteTableBucketPolicy.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a table bucket policy. +// Deletes a table bucket policy. For more information, see [Deleting a table bucket policy] in the Amazon Simple +// Storage Service User Guide. +// +// Permissions You must have the s3tables:DeleteTableBucketPolicy permission to +// use this operation. +// +// [Deleting a table bucket policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-bucket-policy.html#table-bucket-policy-delete func (c *Client) DeleteTableBucketPolicy(ctx context.Context, params *DeleteTableBucketPolicyInput, optFns ...func(*Options)) (*DeleteTableBucketPolicyOutput, error) { if params == nil { params = &DeleteTableBucketPolicyInput{} @@ -28,7 +34,7 @@ func (c *Client) DeleteTableBucketPolicy(ctx context.Context, params *DeleteTabl type DeleteTableBucketPolicyInput struct { - // The Amazon Resource Number (ARN) of the table bucket. + // The Amazon Resource Name (ARN) of the table bucket. // // This member is required. TableBucketARN *string diff --git a/service/s3tables/api_op_DeleteTablePolicy.go b/service/s3tables/api_op_DeleteTablePolicy.go index c777a44be11..b7c8e8a0f7b 100644 --- a/service/s3tables/api_op_DeleteTablePolicy.go +++ b/service/s3tables/api_op_DeleteTablePolicy.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a table policy. +// Deletes a table policy. For more information, see [Deleting a table policy] in the Amazon Simple Storage +// Service User Guide. +// +// Permissions You must have the s3tables:DeleteTablePolicy permission to use this +// operation. +// +// [Deleting a table policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-table-policy.html#table-policy-delete func (c *Client) DeleteTablePolicy(ctx context.Context, params *DeleteTablePolicyInput, optFns ...func(*Options)) (*DeleteTablePolicyOutput, error) { if params == nil { params = &DeleteTablePolicyInput{} @@ -38,7 +44,7 @@ type DeleteTablePolicyInput struct { // This member is required. Namespace *string - // The Amazon Resource Number (ARN) of the table bucket that contains the table. + // The Amazon Resource Name (ARN) of the table bucket that contains the table. // // This member is required. TableBucketARN *string diff --git a/service/s3tables/api_op_GetNamespace.go b/service/s3tables/api_op_GetNamespace.go index 399e9a1fb5c..17b872558f2 100644 --- a/service/s3tables/api_op_GetNamespace.go +++ b/service/s3tables/api_op_GetNamespace.go @@ -11,7 +11,13 @@ import ( "time" ) -// Gets details about a namespace. +// Gets details about a namespace. For more information, see [Table namespaces] in the Amazon Simple +// Storage Service User Guide. +// +// Permissions You must have the s3tables:GetNamespace permission to use this +// operation. +// +// [Table namespaces]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-namespace.html func (c *Client) GetNamespace(ctx context.Context, params *GetNamespaceInput, optFns ...func(*Options)) (*GetNamespaceOutput, error) { if params == nil { params = &GetNamespaceInput{} diff --git a/service/s3tables/api_op_GetTable.go b/service/s3tables/api_op_GetTable.go index 766d909e880..9ca8a6f0b17 100644 --- a/service/s3tables/api_op_GetTable.go +++ b/service/s3tables/api_op_GetTable.go @@ -12,7 +12,13 @@ import ( "time" ) -// Gets details about a table. +// Gets details about a table. For more information, see [S3 Tables] in the Amazon Simple +// Storage Service User Guide. +// +// Permissions You must have the s3tables:GetTable permission to use this +// operation. +// +// [S3 Tables]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-tables.html func (c *Client) GetTable(ctx context.Context, params *GetTableInput, optFns ...func(*Options)) (*GetTableOutput, error) { if params == nil { params = &GetTableInput{} diff --git a/service/s3tables/api_op_GetTableBucket.go b/service/s3tables/api_op_GetTableBucket.go index 2737633df0b..f3a12f21bb1 100644 --- a/service/s3tables/api_op_GetTableBucket.go +++ b/service/s3tables/api_op_GetTableBucket.go @@ -11,7 +11,13 @@ import ( "time" ) -// Gets details on a table bucket. +// Gets details on a table bucket. For more information, see [Viewing details about an Amazon S3 table bucket] in the Amazon Simple +// Storage Service User Guide. +// +// Permissions You must have the s3tables:GetTableBucket permission to use this +// operation. +// +// [Viewing details about an Amazon S3 table bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-details.html func (c *Client) GetTableBucket(ctx context.Context, params *GetTableBucketInput, optFns ...func(*Options)) (*GetTableBucketOutput, error) { if params == nil { params = &GetTableBucketInput{} diff --git a/service/s3tables/api_op_GetTableBucketMaintenanceConfiguration.go b/service/s3tables/api_op_GetTableBucketMaintenanceConfiguration.go index b48d00807d3..ab80e2f933a 100644 --- a/service/s3tables/api_op_GetTableBucketMaintenanceConfiguration.go +++ b/service/s3tables/api_op_GetTableBucketMaintenanceConfiguration.go @@ -11,7 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets details about a maintenance configuration for a given table bucket. +// Gets details about a maintenance configuration for a given table bucket. For +// more information, see [Amazon S3 table bucket maintenance]in the Amazon Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:GetTableBucketMaintenanceConfiguration +// permission to use this operation. +// +// [Amazon S3 table bucket maintenance]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html func (c *Client) GetTableBucketMaintenanceConfiguration(ctx context.Context, params *GetTableBucketMaintenanceConfigurationInput, optFns ...func(*Options)) (*GetTableBucketMaintenanceConfigurationOutput, error) { if params == nil { params = &GetTableBucketMaintenanceConfigurationInput{} diff --git a/service/s3tables/api_op_GetTableBucketPolicy.go b/service/s3tables/api_op_GetTableBucketPolicy.go index a558d8544db..3eca4cefd12 100644 --- a/service/s3tables/api_op_GetTableBucketPolicy.go +++ b/service/s3tables/api_op_GetTableBucketPolicy.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets details about a table bucket policy. +// Gets details about a table bucket policy. For more information, see [Viewing a table bucket policy] in the +// Amazon Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:GetTableBucketPolicy permission to use +// this operation. +// +// [Viewing a table bucket policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-bucket-policy.html#table-bucket-policy-get func (c *Client) GetTableBucketPolicy(ctx context.Context, params *GetTableBucketPolicyInput, optFns ...func(*Options)) (*GetTableBucketPolicyOutput, error) { if params == nil { params = &GetTableBucketPolicyInput{} @@ -28,7 +34,7 @@ func (c *Client) GetTableBucketPolicy(ctx context.Context, params *GetTableBucke type GetTableBucketPolicyInput struct { - // The Amazon Resource Number (ARN) of the table bucket. + // The Amazon Resource Name (ARN) of the table bucket. // // This member is required. TableBucketARN *string @@ -38,7 +44,7 @@ type GetTableBucketPolicyInput struct { type GetTableBucketPolicyOutput struct { - // The name of the resource policy. + // The JSON that defines the policy. // // This member is required. ResourcePolicy *string diff --git a/service/s3tables/api_op_GetTableMaintenanceConfiguration.go b/service/s3tables/api_op_GetTableMaintenanceConfiguration.go index fd3375740e4..f64523f83e0 100644 --- a/service/s3tables/api_op_GetTableMaintenanceConfiguration.go +++ b/service/s3tables/api_op_GetTableMaintenanceConfiguration.go @@ -11,7 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets details about the maintenance configuration of a table. +// Gets details about the maintenance configuration of a table. For more +// information, see [S3 Tables maintenance]in the Amazon Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:GetTableMaintenanceConfiguration +// permission to use this operation. +// +// [S3 Tables maintenance]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-maintenance.html func (c *Client) GetTableMaintenanceConfiguration(ctx context.Context, params *GetTableMaintenanceConfigurationInput, optFns ...func(*Options)) (*GetTableMaintenanceConfigurationOutput, error) { if params == nil { params = &GetTableMaintenanceConfigurationInput{} diff --git a/service/s3tables/api_op_GetTableMaintenanceJobStatus.go b/service/s3tables/api_op_GetTableMaintenanceJobStatus.go index fc1a7b2e566..19ca2a3722b 100644 --- a/service/s3tables/api_op_GetTableMaintenanceJobStatus.go +++ b/service/s3tables/api_op_GetTableMaintenanceJobStatus.go @@ -11,7 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets the status of a maintenance job for a table. +// Gets the status of a maintenance job for a table. For more information, see [S3 Tables maintenance] in +// the Amazon Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:GetTableMaintenanceJobStatus permission +// to use this operation. +// +// [S3 Tables maintenance]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-maintenance.html func (c *Client) GetTableMaintenanceJobStatus(ctx context.Context, params *GetTableMaintenanceJobStatusInput, optFns ...func(*Options)) (*GetTableMaintenanceJobStatusOutput, error) { if params == nil { params = &GetTableMaintenanceJobStatusInput{} diff --git a/service/s3tables/api_op_GetTableMetadataLocation.go b/service/s3tables/api_op_GetTableMetadataLocation.go index ad2fdf346d2..fcdee64ef01 100644 --- a/service/s3tables/api_op_GetTableMetadataLocation.go +++ b/service/s3tables/api_op_GetTableMetadataLocation.go @@ -11,6 +11,9 @@ import ( ) // Gets the location of the table metadata. +// +// Permissions You must have the s3tables:GetTableMetadataLocation permission to +// use this operation. func (c *Client) GetTableMetadataLocation(ctx context.Context, params *GetTableMetadataLocationInput, optFns ...func(*Options)) (*GetTableMetadataLocationOutput, error) { if params == nil { params = &GetTableMetadataLocationInput{} diff --git a/service/s3tables/api_op_GetTablePolicy.go b/service/s3tables/api_op_GetTablePolicy.go index ff3f919be73..b50019907d2 100644 --- a/service/s3tables/api_op_GetTablePolicy.go +++ b/service/s3tables/api_op_GetTablePolicy.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets details about a table policy. +// Gets details about a table policy. For more information, see [Viewing a table policy] in the Amazon +// Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:GetTablePolicy permission to use this +// operation. +// +// [Viewing a table policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-table-policy.html#table-policy-get func (c *Client) GetTablePolicy(ctx context.Context, params *GetTablePolicyInput, optFns ...func(*Options)) (*GetTablePolicyOutput, error) { if params == nil { params = &GetTablePolicyInput{} @@ -38,7 +44,7 @@ type GetTablePolicyInput struct { // This member is required. Namespace *string - // The Amazon Resource Number (ARN) of the table bucket that contains the table. + // The Amazon Resource Name (ARN) of the table bucket that contains the table. // // This member is required. TableBucketARN *string @@ -48,7 +54,7 @@ type GetTablePolicyInput struct { type GetTablePolicyOutput struct { - // The name of the resource policy. + // The JSON that defines the policy. // // This member is required. ResourcePolicy *string diff --git a/service/s3tables/api_op_ListNamespaces.go b/service/s3tables/api_op_ListNamespaces.go index 26eb243a152..18b689595a3 100644 --- a/service/s3tables/api_op_ListNamespaces.go +++ b/service/s3tables/api_op_ListNamespaces.go @@ -11,7 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the namespaces within a table bucket. +// Lists the namespaces within a table bucket. For more information, see [Table namespaces] in the +// Amazon Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:ListNamespaces permission to use this +// operation. +// +// [Table namespaces]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-namespace.html func (c *Client) ListNamespaces(ctx context.Context, params *ListNamespacesInput, optFns ...func(*Options)) (*ListNamespacesOutput, error) { if params == nil { params = &ListNamespacesInput{} diff --git a/service/s3tables/api_op_ListTableBuckets.go b/service/s3tables/api_op_ListTableBuckets.go index f9e192eb513..60938f918a1 100644 --- a/service/s3tables/api_op_ListTableBuckets.go +++ b/service/s3tables/api_op_ListTableBuckets.go @@ -11,7 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists table buckets for your account. +// Lists table buckets for your account. For more information, see [S3 Table buckets] in the Amazon +// Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:ListTableBuckets permission to use this +// operation. +// +// [S3 Table buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets.html func (c *Client) ListTableBuckets(ctx context.Context, params *ListTableBucketsInput, optFns ...func(*Options)) (*ListTableBucketsOutput, error) { if params == nil { params = &ListTableBucketsInput{} diff --git a/service/s3tables/api_op_ListTables.go b/service/s3tables/api_op_ListTables.go index 85b73de0911..7b3d621b596 100644 --- a/service/s3tables/api_op_ListTables.go +++ b/service/s3tables/api_op_ListTables.go @@ -11,7 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List tables in the given table bucket. +// List tables in the given table bucket. For more information, see [S3 Tables] in the Amazon +// Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:ListTables permission to use this +// operation. +// +// [S3 Tables]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-tables.html func (c *Client) ListTables(ctx context.Context, params *ListTablesInput, optFns ...func(*Options)) (*ListTablesOutput, error) { if params == nil { params = &ListTablesInput{} @@ -29,7 +35,7 @@ func (c *Client) ListTables(ctx context.Context, params *ListTablesInput, optFns type ListTablesInput struct { - // The Amazon resource Number (ARN) of the table bucket. + // The Amazon resource Name (ARN) of the table bucket. // // This member is required. TableBucketARN *string diff --git a/service/s3tables/api_op_PutTableBucketMaintenanceConfiguration.go b/service/s3tables/api_op_PutTableBucketMaintenanceConfiguration.go index 259858d56d9..690557ca6c9 100644 --- a/service/s3tables/api_op_PutTableBucketMaintenanceConfiguration.go +++ b/service/s3tables/api_op_PutTableBucketMaintenanceConfiguration.go @@ -12,7 +12,13 @@ import ( ) // Creates a new maintenance configuration or replaces an existing maintenance -// configuration for a table bucket. +// configuration for a table bucket. For more information, see [Amazon S3 table bucket maintenance]in the Amazon +// Simple Storage Service User Guide. +// +// Permissions You must have the s3tables:PutTableBucketMaintenanceConfiguration +// permission to use this operation. +// +// [Amazon S3 table bucket maintenance]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html func (c *Client) PutTableBucketMaintenanceConfiguration(ctx context.Context, params *PutTableBucketMaintenanceConfigurationInput, optFns ...func(*Options)) (*PutTableBucketMaintenanceConfigurationOutput, error) { if params == nil { params = &PutTableBucketMaintenanceConfigurationInput{} diff --git a/service/s3tables/api_op_PutTableBucketPolicy.go b/service/s3tables/api_op_PutTableBucketPolicy.go index e3802df9d8e..391b4547e21 100644 --- a/service/s3tables/api_op_PutTableBucketPolicy.go +++ b/service/s3tables/api_op_PutTableBucketPolicy.go @@ -11,7 +11,13 @@ import ( ) // Creates a new maintenance configuration or replaces an existing table bucket -// policy for a table bucket. +// policy for a table bucket. For more information, see [Adding a table bucket policy]in the Amazon Simple +// Storage Service User Guide. +// +// Permissions You must have the s3tables:PutTableBucketPolicy permission to use +// this operation. +// +// [Adding a table bucket policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-bucket-policy.html#table-bucket-policy-add func (c *Client) PutTableBucketPolicy(ctx context.Context, params *PutTableBucketPolicyInput, optFns ...func(*Options)) (*PutTableBucketPolicyOutput, error) { if params == nil { params = &PutTableBucketPolicyInput{} @@ -29,12 +35,12 @@ func (c *Client) PutTableBucketPolicy(ctx context.Context, params *PutTableBucke type PutTableBucketPolicyInput struct { - // The name of the resource policy. + // The JSON that defines the policy. // // This member is required. ResourcePolicy *string - // The Amazon Resource Number (ARN) of the table bucket. + // The Amazon Resource Name (ARN) of the table bucket. // // This member is required. TableBucketARN *string diff --git a/service/s3tables/api_op_PutTableMaintenanceConfiguration.go b/service/s3tables/api_op_PutTableMaintenanceConfiguration.go index b1ba597924a..6892230e8f9 100644 --- a/service/s3tables/api_op_PutTableMaintenanceConfiguration.go +++ b/service/s3tables/api_op_PutTableMaintenanceConfiguration.go @@ -12,7 +12,13 @@ import ( ) // Creates a new maintenance configuration or replaces an existing maintenance -// configuration for a table. +// configuration for a table. For more information, see [S3 Tables maintenance]in the Amazon Simple +// Storage Service User Guide. +// +// Permissions You must have the s3tables:PutTableMaintenanceConfiguration +// permission to use this operation. +// +// [S3 Tables maintenance]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-maintenance.html func (c *Client) PutTableMaintenanceConfiguration(ctx context.Context, params *PutTableMaintenanceConfigurationInput, optFns ...func(*Options)) (*PutTableMaintenanceConfigurationOutput, error) { if params == nil { params = &PutTableMaintenanceConfigurationInput{} diff --git a/service/s3tables/api_op_PutTablePolicy.go b/service/s3tables/api_op_PutTablePolicy.go index eb8ea1abbb6..f4d2551fb2e 100644 --- a/service/s3tables/api_op_PutTablePolicy.go +++ b/service/s3tables/api_op_PutTablePolicy.go @@ -11,7 +11,13 @@ import ( ) // Creates a new maintenance configuration or replaces an existing table policy -// for a table. +// for a table. For more information, see [Adding a table policy]in the Amazon Simple Storage Service +// User Guide. +// +// Permissions You must have the s3tables:PutTablePolicy permission to use this +// operation. +// +// [Adding a table policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-table-policy.html#table-policy-add func (c *Client) PutTablePolicy(ctx context.Context, params *PutTablePolicyInput, optFns ...func(*Options)) (*PutTablePolicyOutput, error) { if params == nil { params = &PutTablePolicyInput{} @@ -39,12 +45,12 @@ type PutTablePolicyInput struct { // This member is required. Namespace *string - // The name of the resource policy. + // The JSON that defines the policy. // // This member is required. ResourcePolicy *string - // The Amazon Resource Number (ARN) of the table bucket that contains the table. + // The Amazon Resource Name (ARN) of the table bucket that contains the table. // // This member is required. TableBucketARN *string diff --git a/service/s3tables/api_op_RenameTable.go b/service/s3tables/api_op_RenameTable.go index 85560f8387b..ccff6f54515 100644 --- a/service/s3tables/api_op_RenameTable.go +++ b/service/s3tables/api_op_RenameTable.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Renames a table or a namespace. +// Renames a table or a namespace. For more information, see [S3 Tables] in the Amazon Simple +// Storage Service User Guide. +// +// Permissions You must have the s3tables:RenameTable permission to use this +// operation. +// +// [S3 Tables]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-tables.html func (c *Client) RenameTable(ctx context.Context, params *RenameTableInput, optFns ...func(*Options)) (*RenameTableOutput, error) { if params == nil { params = &RenameTableInput{} diff --git a/service/s3tables/api_op_UpdateTableMetadataLocation.go b/service/s3tables/api_op_UpdateTableMetadataLocation.go index a3e12e700bc..304781173d6 100644 --- a/service/s3tables/api_op_UpdateTableMetadataLocation.go +++ b/service/s3tables/api_op_UpdateTableMetadataLocation.go @@ -10,7 +10,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the metadata location for a table. +// Updates the metadata location for a table. The metadata location of a table +// must be an S3 URI that begins with the table's warehouse location. The metadata +// location for an Apache Iceberg table must end with .metadata.json , or if the +// metadata file is Gzip-compressed, .metadata.json.gz . +// +// Permissions You must have the s3tables:UpdateTableMetadataLocation permission +// to use this operation. func (c *Client) UpdateTableMetadataLocation(ctx context.Context, params *UpdateTableMetadataLocationInput, optFns ...func(*Options)) (*UpdateTableMetadataLocationOutput, error) { if params == nil { params = &UpdateTableMetadataLocationInput{} @@ -73,7 +79,7 @@ type UpdateTableMetadataLocationOutput struct { // This member is required. Namespace []string - // The Amazon Resource Number (ARN) of the table. + // The Amazon Resource Name (ARN) of the table. // // This member is required. TableARN *string diff --git a/service/s3tables/serializers.go b/service/s3tables/serializers.go index 77dace3276d..43912d4a4c7 100644 --- a/service/s3tables/serializers.go +++ b/service/s3tables/serializers.go @@ -211,6 +211,13 @@ func awsRestjson1_serializeOpDocumentCreateTableInput(v *CreateTableInput, value ok.String(string(v.Format)) } + if v.Metadata != nil { + ok := object.Key("metadata") + if err := awsRestjson1_serializeDocumentTableMetadata(v.Metadata, ok); err != nil { + return err + } + } + if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) @@ -2371,6 +2378,34 @@ func awsRestjson1_serializeDocumentIcebergCompactionSettings(v *types.IcebergCom return nil } +func awsRestjson1_serializeDocumentIcebergMetadata(v *types.IcebergMetadata, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Schema != nil { + ok := object.Key("schema") + if err := awsRestjson1_serializeDocumentIcebergSchema(v.Schema, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIcebergSchema(v *types.IcebergSchema, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentSchemaFieldList(v.Fields, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentIcebergSnapshotManagementSettings(v *types.IcebergSnapshotManagementSettings, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2416,6 +2451,41 @@ func awsRestjson1_serializeDocumentNamespaceList(v []string, value smithyjson.Va return nil } +func awsRestjson1_serializeDocumentSchemaField(v *types.SchemaField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Required { + ok := object.Key("required") + ok.Boolean(v.Required) + } + + if v.Type != nil { + ok := object.Key("type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentSchemaFieldList(v []types.SchemaField, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSchemaField(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentTableBucketMaintenanceConfigurationValue(v *types.TableBucketMaintenanceConfigurationValue, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2495,3 +2565,21 @@ func awsRestjson1_serializeDocumentTableMaintenanceSettings(v types.TableMainten } return nil } + +func awsRestjson1_serializeDocumentTableMetadata(v types.TableMetadata, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.TableMetadataMemberIceberg: + av := object.Key("iceberg") + if err := awsRestjson1_serializeDocumentIcebergMetadata(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} diff --git a/service/s3tables/types/types.go b/service/s3tables/types/types.go index 34c2e02fe68..42b8cac76bc 100644 --- a/service/s3tables/types/types.go +++ b/service/s3tables/types/types.go @@ -16,6 +16,28 @@ type IcebergCompactionSettings struct { noSmithyDocumentSerde } +// Contains details about the metadata for an Iceberg table. +type IcebergMetadata struct { + + // The schema for an Iceberg table. + // + // This member is required. + Schema *IcebergSchema + + noSmithyDocumentSerde +} + +// Contains details about the schema for an Iceberg table. +type IcebergSchema struct { + + // The schema fields for the table + // + // This member is required. + Fields []SchemaField + + noSmithyDocumentSerde +} + // Contains details about the snapshot management settings for an Iceberg table. // The oldest snapshot expires when its age exceeds the maxSnapshotAgeHours and // the total number of snapshots exceeds the value for the minimum number of @@ -71,6 +93,30 @@ type NamespaceSummary struct { noSmithyDocumentSerde } +// Contains details about a schema field. +type SchemaField struct { + + // The name of the field. + // + // This member is required. + Name *string + + // The field type. S3 Tables supports all Apache Iceberg primitive types. For more + // information, see the [Apache Iceberg documentation]. + // + // [Apache Iceberg documentation]: https://iceberg.apache.org/spec/#primitive-types + // + // This member is required. + Type *string + + // A Boolean value that specifies whether values are required for each row in this + // field. By default, this is false and null values are allowed in the field. If + // this is true the field does not allow null values. + Required bool + + noSmithyDocumentSerde +} + // Details about the values that define the maintenance configuration for a table // bucket. type TableBucketMaintenanceConfigurationValue struct { @@ -106,7 +152,7 @@ func (*TableBucketMaintenanceSettingsMemberIcebergUnreferencedFileRemoval) isTab // Contains details about a table bucket. type TableBucketSummary struct { - // The Amazon Resource Number (ARN) of the table bucket. + // The Amazon Resource Name (ARN) of the table bucket. // // This member is required. Arn *string @@ -186,6 +232,24 @@ type TableMaintenanceSettingsMemberIcebergSnapshotManagement struct { func (*TableMaintenanceSettingsMemberIcebergSnapshotManagement) isTableMaintenanceSettings() {} +// Contains details about the table metadata. +// +// The following types satisfy this interface: +// +// TableMetadataMemberIceberg +type TableMetadata interface { + isTableMetadata() +} + +// Contains details about the metadata of an Iceberg table. +type TableMetadataMemberIceberg struct { + Value IcebergMetadata + + noSmithyDocumentSerde +} + +func (*TableMetadataMemberIceberg) isTableMetadata() {} + // Contains details about a table. type TableSummary struct { @@ -209,7 +273,7 @@ type TableSummary struct { // This member is required. Namespace []string - // The Amazon Resource Number (ARN) of the table. + // The Amazon Resource Name (ARN) of the table. // // This member is required. TableARN *string @@ -235,3 +299,4 @@ type UnknownUnionMember struct { func (*UnknownUnionMember) isTableBucketMaintenanceSettings() {} func (*UnknownUnionMember) isTableMaintenanceSettings() {} +func (*UnknownUnionMember) isTableMetadata() {} diff --git a/service/s3tables/types/types_exported_test.go b/service/s3tables/types/types_exported_test.go index 9c8bc749112..636fb5ca6e0 100644 --- a/service/s3tables/types/types_exported_test.go +++ b/service/s3tables/types/types_exported_test.go @@ -46,3 +46,21 @@ func ExampleTableMaintenanceSettings_outputUsage() { var _ *types.IcebergSnapshotManagementSettings var _ *types.IcebergCompactionSettings + +func ExampleTableMetadata_outputUsage() { + var union types.TableMetadata + // type switches can be used to check the union value + switch v := union.(type) { + case *types.TableMetadataMemberIceberg: + _ = v.Value // Value is types.IcebergMetadata + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.IcebergMetadata diff --git a/service/s3tables/validators.go b/service/s3tables/validators.go index 875c4798719..91d00850dac 100644 --- a/service/s3tables/validators.go +++ b/service/s3tables/validators.go @@ -5,6 +5,7 @@ package s3tables import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/s3tables/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -609,6 +610,98 @@ func addOpUpdateTableMetadataLocationValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpUpdateTableMetadataLocation{}, middleware.After) } +func validateIcebergMetadata(v *types.IcebergMetadata) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IcebergMetadata"} + if v.Schema == nil { + invalidParams.Add(smithy.NewErrParamRequired("Schema")) + } else if v.Schema != nil { + if err := validateIcebergSchema(v.Schema); err != nil { + invalidParams.AddNested("Schema", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIcebergSchema(v *types.IcebergSchema) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IcebergSchema"} + if v.Fields == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fields")) + } else if v.Fields != nil { + if err := validateSchemaFieldList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSchemaField(v *types.SchemaField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SchemaField"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Type == nil { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSchemaFieldList(v []types.SchemaField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SchemaFieldList"} + for i := range v { + if err := validateSchemaField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTableMetadata(v types.TableMetadata) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TableMetadata"} + switch uv := v.(type) { + case *types.TableMetadataMemberIceberg: + if err := validateIcebergMetadata(&uv.Value); err != nil { + invalidParams.AddNested("[iceberg]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateNamespaceInput(v *CreateNamespaceInput) error { if v == nil { return nil @@ -659,6 +752,11 @@ func validateOpCreateTableInput(v *CreateTableInput) error { if len(v.Format) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Format")) } + if v.Metadata != nil { + if err := validateTableMetadata(v.Metadata); err != nil { + invalidParams.AddNested("Metadata", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/sqs/internal/endpoints/endpoints.go b/service/sqs/internal/endpoints/endpoints.go index 5aa3a05693b..b3e42f05f48 100644 --- a/service/sqs/internal/endpoints/endpoints.go +++ b/service/sqs/internal/endpoints/endpoints.go @@ -181,9 +181,21 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sqs-fips.ca-central-1.amazonaws.com", + }, endpoints.EndpointKey{ Region: "ca-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sqs-fips.ca-west-1.amazonaws.com", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, @@ -208,6 +220,24 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "fips-ca-central-1", + }: endpoints.Endpoint{ + Hostname: "sqs-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ca-west-1", + }: endpoints.Endpoint{ + Hostname: "sqs-fips.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ diff --git a/service/verifiedpermissions/deserializers.go b/service/verifiedpermissions/deserializers.go index a3a9d947e06..c2f8975feb4 100644 --- a/service/verifiedpermissions/deserializers.go +++ b/service/verifiedpermissions/deserializers.go @@ -4814,6 +4814,18 @@ loop: continue } switch key { + case "cedarJson": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CedarJson to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.ContextDefinitionMemberCedarJson{Value: mv} + break loop + case "contextMap": var mv map[string]types.AttributeValue if err := awsAwsjson10_deserializeDocumentContextMap(&mv, value); err != nil { diff --git a/service/verifiedpermissions/serializers.go b/service/verifiedpermissions/serializers.go index ea63b5519d1..8a9d21ef462 100644 --- a/service/verifiedpermissions/serializers.go +++ b/service/verifiedpermissions/serializers.go @@ -1937,6 +1937,10 @@ func awsAwsjson10_serializeDocumentContextDefinition(v types.ContextDefinition, defer object.Close() switch uv := v.(type) { + case *types.ContextDefinitionMemberCedarJson: + av := object.Key("cedarJson") + av.String(uv.Value) + case *types.ContextDefinitionMemberContextMap: av := object.Key("contextMap") if err := awsAwsjson10_serializeDocumentContextMap(uv.Value, av); err != nil { @@ -1971,6 +1975,10 @@ func awsAwsjson10_serializeDocumentEntitiesDefinition(v types.EntitiesDefinition defer object.Close() switch uv := v.(type) { + case *types.EntitiesDefinitionMemberCedarJson: + av := object.Key("cedarJson") + av.String(uv.Value) + case *types.EntitiesDefinitionMemberEntityList: av := object.Key("entityList") if err := awsAwsjson10_serializeDocumentEntityList(uv.Value, av); err != nil { diff --git a/service/verifiedpermissions/types/types.go b/service/verifiedpermissions/types/types.go index 72783fd618f..55a620f0c21 100644 --- a/service/verifiedpermissions/types/types.go +++ b/service/verifiedpermissions/types/types.go @@ -695,11 +695,16 @@ func (*ConfigurationItemMemberOpenIdConnectConfiguration) isConfigurationItem() // // This data type is used as a request parameter for the [IsAuthorized], [BatchIsAuthorized], and [IsAuthorizedWithToken] operations. // +// If you're passing context as part of the request, exactly one instance of +// context must be passed. If you don't want to pass context, omit the context +// parameter from your request rather than sending context {} . +// // Example: // "context":{"contextMap":{"":{"boolean":true},"":{"long":1234}}} // // The following types satisfy this interface: // +// ContextDefinitionMemberCedarJson // ContextDefinitionMemberContextMap // // [BatchIsAuthorized]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html @@ -709,6 +714,18 @@ type ContextDefinition interface { isContextDefinition() } +// A Cedar JSON string representation of the context needed to successfully +// evaluate an authorization request. +// +// Example: {"cedarJson":"{\"\": true, \"\": 1234}" } +type ContextDefinitionMemberCedarJson struct { + Value string + + noSmithyDocumentSerde +} + +func (*ContextDefinitionMemberCedarJson) isContextDefinition() {} + // An list of attributes that are needed to successfully evaluate an authorization // request. Each attribute in this array must include a map of a data type and its // value. @@ -754,6 +771,7 @@ type DeterminingPolicyItem struct { // // The following types satisfy this interface: // +// EntitiesDefinitionMemberCedarJson // EntitiesDefinitionMemberEntityList // // [IsAuthorizedWithToken]: https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html @@ -762,9 +780,25 @@ type EntitiesDefinition interface { isEntitiesDefinition() } +// A Cedar JSON string representation of the entities needed to successfully +// evaluate an authorization request. +// +// Example: {"cedarJson": +// "[{\"uid\":{\"type\":\"Photo\",\"id\":\"VacationPhoto94.jpg\"},\"attrs\":{\"accessLevel\":\"public\"},\"parents\":[]}]"} +type EntitiesDefinitionMemberCedarJson struct { + Value string + + noSmithyDocumentSerde +} + +func (*EntitiesDefinitionMemberCedarJson) isEntitiesDefinition() {} + // An array of entities that are needed to successfully evaluate an authorization // request. Each entity in this array must include an identifier for the entity, // the attributes of the entity, and a list of any parent entities. +// +// If you include multiple entities with the same identifier , only the last one is +// processed in the request. type EntitiesDefinitionMemberEntityList struct { Value []EntityItem diff --git a/service/verifiedpermissions/types/types_exported_test.go b/service/verifiedpermissions/types/types_exported_test.go index a6ec1bd91e3..b2f6a132e5c 100644 --- a/service/verifiedpermissions/types/types_exported_test.go +++ b/service/verifiedpermissions/types/types_exported_test.go @@ -123,6 +123,9 @@ func ExampleContextDefinition_outputUsage() { var union types.ContextDefinition // type switches can be used to check the union value switch v := union.(type) { + case *types.ContextDefinitionMemberCedarJson: + _ = v.Value // Value is string + case *types.ContextDefinitionMemberContextMap: _ = v.Value // Value is map[string]types.AttributeValue @@ -135,12 +138,16 @@ func ExampleContextDefinition_outputUsage() { } } +var _ *string var _ map[string]types.AttributeValue func ExampleEntitiesDefinition_outputUsage() { var union types.EntitiesDefinition // type switches can be used to check the union value switch v := union.(type) { + case *types.EntitiesDefinitionMemberCedarJson: + _ = v.Value // Value is string + case *types.EntitiesDefinitionMemberEntityList: _ = v.Value // Value is []types.EntityItem @@ -153,6 +160,7 @@ func ExampleEntitiesDefinition_outputUsage() { } } +var _ *string var _ []types.EntityItem func ExampleEntityReference_outputUsage() {