From 9f8b24f648a7f387db9d542aa73b59c03ca06998 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 31 Aug 2023 19:04:49 +0000 Subject: [PATCH] Regenerated Clients --- .../3810311d9ce840afbf7743f1774ab906.json | 8 + .../46953688ff4d41d19d82d7017cfc7af2.json | 8 + .../4a8bf3ea0130497f921e9f410f4e5ac7.json | 8 + .../5000babd43b245c2b8dc99f687c48ae5.json | 8 + .../58cc3d59322c445ba4ccf256c1632c26.json | 8 + .../62e1b744e88145068f638edc2e724f8b.json | 8 + .../6853227d4d26486bafda80afc7b3edc6.json | 8 + .../7f88adf10e364ddfaf1d59d4ba52656e.json | 8 + .../82f3d6a2d8694c0b8fbf8470cc6864cc.json | 8 + .../840c3458d0c343f8a463f0415752b5bc.json | 8 + .../8513583237a54fb7a365554649a6ab90.json | 8 + .../8bfe3952c88348318484800faafb4d7b.json | 8 + .../e0eb3431a86c4cd1ba00394bfb78ecaf.json | 8 + .../chimesdkmediapipelines/deserializers.go | 133 +++++ service/chimesdkmediapipelines/serializers.go | 19 + service/chimesdkmediapipelines/types/enums.go | 34 ++ service/chimesdkmediapipelines/types/types.go | 31 +- service/cloudhsm/api_op_AddTagsToResource.go | 2 + service/cloudhsm/api_op_CreateHapg.go | 2 + service/cloudhsm/api_op_CreateHsm.go | 2 + service/cloudhsm/api_op_CreateLunaClient.go | 2 + service/cloudhsm/api_op_DeleteHapg.go | 2 + service/cloudhsm/api_op_DeleteHsm.go | 2 + service/cloudhsm/api_op_DeleteLunaClient.go | 2 + service/cloudhsm/api_op_DescribeHapg.go | 2 + service/cloudhsm/api_op_DescribeHsm.go | 2 + service/cloudhsm/api_op_DescribeLunaClient.go | 2 + service/cloudhsm/api_op_GetConfig.go | 2 + service/cloudhsm/api_op_ListAvailableZones.go | 2 + service/cloudhsm/api_op_ListHapgs.go | 2 + service/cloudhsm/api_op_ListHsms.go | 2 + service/cloudhsm/api_op_ListLunaClients.go | 2 + .../cloudhsm/api_op_ListTagsForResource.go | 2 + service/cloudhsm/api_op_ModifyHapg.go | 2 + service/cloudhsm/api_op_ModifyHsm.go | 2 + service/cloudhsm/api_op_ModifyLunaClient.go | 2 + .../cloudhsm/api_op_RemoveTagsFromResource.go | 2 + service/cloudhsm/endpoints_test.go | 154 ++++-- service/cloudwatchevents/api_op_PutTargets.go | 6 +- service/cloudwatchevents/endpoints_test.go | 206 +++++--- service/cloudwatchevents/types/types.go | 4 +- .../internal/endpoints/endpoints.go | 6 + .../internal/endpoints/endpoints.go | 6 + service/connectcampaigns/deserializers.go | 143 ++++++ service/connectcampaigns/endpoints_test.go | 158 ++++-- service/connectcampaigns/serializers.go | 67 +++ service/connectcampaigns/types/types.go | 33 +- .../types/types_exported_test.go | 4 + service/connectcampaigns/validators.go | 3 - .../api_op_CreateParticipantConnection.go | 5 +- .../connectparticipant/api_op_DescribeView.go | 268 +++++++++++ service/connectparticipant/deserializers.go | 419 ++++++++++++++++ service/connectparticipant/endpoints_test.go | 52 +- service/connectparticipant/generated.json | 1 + service/connectparticipant/serializers.go | 70 +++ service/connectparticipant/types/enums.go | 36 +- service/connectparticipant/types/errors.go | 29 ++ service/connectparticipant/types/types.go | 40 ++ service/connectparticipant/validators.go | 42 ++ service/customerprofiles/deserializers.go | 36 +- service/ecs/api_op_PutAccountSetting.go | 78 +-- .../ecs/api_op_PutAccountSettingDefault.go | 51 +- service/ecs/api_op_RegisterTaskDefinition.go | 25 +- service/ecs/types/enums.go | 16 +- service/ecs/types/types.go | 53 +- ...DescribeAffectedEntitiesForOrganization.go | 15 +- ...DescribeEntityAggregatesForOrganization.go | 269 +++++++++++ service/health/deserializers.go | 378 +++++++++++++++ service/health/generated.json | 1 + service/health/serializers.go | 142 ++++++ service/health/types/enums.go | 4 + service/health/types/types.go | 67 +++ service/health/validators.go | 80 ++- service/ivs/api_op_CreateChannel.go | 39 +- service/ivs/api_op_UpdateChannel.go | 39 +- service/ivs/types/types.go | 78 +-- service/kafkaconnect/endpoints_test.go | 182 +++++-- .../internal/endpoints/endpoints.go | 6 + .../api_op_EncryptData.go | 2 - .../paymentcryptographydata/endpoints_test.go | 239 +++++---- service/sagemakerruntime/api_client.go | 2 + .../sagemakerruntime/api_op_InvokeEndpoint.go | 20 +- .../api_op_InvokeEndpointAsync.go | 6 +- ...api_op_InvokeEndpointWithResponseStream.go | 454 ++++++++++++++++++ service/sagemakerruntime/deserializers.go | 446 +++++++++++++++++ service/sagemakerruntime/endpoints_test.go | 98 ++-- service/sagemakerruntime/eventstream.go | 284 +++++++++++ service/sagemakerruntime/generated.json | 4 + service/sagemakerruntime/go.mod | 3 + service/sagemakerruntime/serializers.go | 107 +++++ service/sagemakerruntime/types/errors.go | 59 +++ service/sagemakerruntime/types/types.go | 43 ++ .../types/types_exported_test.go | 26 + service/sagemakerruntime/validators.go | 42 ++ service/sso/internal/endpoints/endpoints.go | 8 + 95 files changed, 4895 insertions(+), 620 deletions(-) create mode 100644 .changelog/3810311d9ce840afbf7743f1774ab906.json create mode 100644 .changelog/46953688ff4d41d19d82d7017cfc7af2.json create mode 100644 .changelog/4a8bf3ea0130497f921e9f410f4e5ac7.json create mode 100644 .changelog/5000babd43b245c2b8dc99f687c48ae5.json create mode 100644 .changelog/58cc3d59322c445ba4ccf256c1632c26.json create mode 100644 .changelog/62e1b744e88145068f638edc2e724f8b.json create mode 100644 .changelog/6853227d4d26486bafda80afc7b3edc6.json create mode 100644 .changelog/7f88adf10e364ddfaf1d59d4ba52656e.json create mode 100644 .changelog/82f3d6a2d8694c0b8fbf8470cc6864cc.json create mode 100644 .changelog/840c3458d0c343f8a463f0415752b5bc.json create mode 100644 .changelog/8513583237a54fb7a365554649a6ab90.json create mode 100644 .changelog/8bfe3952c88348318484800faafb4d7b.json create mode 100644 .changelog/e0eb3431a86c4cd1ba00394bfb78ecaf.json create mode 100644 service/connectparticipant/api_op_DescribeView.go create mode 100644 service/health/api_op_DescribeEntityAggregatesForOrganization.go create mode 100644 service/sagemakerruntime/api_op_InvokeEndpointWithResponseStream.go create mode 100644 service/sagemakerruntime/eventstream.go create mode 100644 service/sagemakerruntime/types/types_exported_test.go diff --git a/.changelog/3810311d9ce840afbf7743f1774ab906.json b/.changelog/3810311d9ce840afbf7743f1774ab906.json new file mode 100644 index 00000000000..39de77b98af --- /dev/null +++ b/.changelog/3810311d9ce840afbf7743f1774ab906.json @@ -0,0 +1,8 @@ +{ + "id": "3810311d-9ce8-40af-bf77-43f1774ab906", + "type": "feature", + "description": "This release adds support for feature Voice Enhancement for Call Recording as part of Amazon Chime SDK call analytics.", + "modules": [ + "service/chimesdkmediapipelines" + ] +} \ No newline at end of file diff --git a/.changelog/46953688ff4d41d19d82d7017cfc7af2.json b/.changelog/46953688ff4d41d19d82d7017cfc7af2.json new file mode 100644 index 00000000000..5100567132b --- /dev/null +++ b/.changelog/46953688ff4d41d19d82d7017cfc7af2.json @@ -0,0 +1,8 @@ +{ + "id": "46953688-ff4d-41d1-9d82-d7017cfc7af2", + "type": "feature", + "description": "Documentation updates for CloudWatch Events.", + "modules": [ + "service/cloudwatchevents" + ] +} \ No newline at end of file diff --git a/.changelog/4a8bf3ea0130497f921e9f410f4e5ac7.json b/.changelog/4a8bf3ea0130497f921e9f410f4e5ac7.json new file mode 100644 index 00000000000..50d6370536d --- /dev/null +++ b/.changelog/4a8bf3ea0130497f921e9f410f4e5ac7.json @@ -0,0 +1,8 @@ +{ + "id": "4a8bf3ea-0130-497f-921e-9f410f4e5ac7", + "type": "feature", + "description": "This release adds a new InvokeEndpointWithResponseStream API to support streaming of model responses.", + "modules": [ + "service/sagemakerruntime" + ] +} \ No newline at end of file diff --git a/.changelog/5000babd43b245c2b8dc99f687c48ae5.json b/.changelog/5000babd43b245c2b8dc99f687c48ae5.json new file mode 100644 index 00000000000..a01b20d55ef --- /dev/null +++ b/.changelog/5000babd43b245c2b8dc99f687c48ae5.json @@ -0,0 +1,8 @@ +{ + "id": "5000babd-43b2-45c2-b8dc-99f687c48ae5", + "type": "feature", + "description": "Make KeyCheckValue field optional when using asymmetric keys as Key Check Values typically only apply to symmetric keys", + "modules": [ + "service/paymentcryptographydata" + ] +} \ No newline at end of file diff --git a/.changelog/58cc3d59322c445ba4ccf256c1632c26.json b/.changelog/58cc3d59322c445ba4ccf256c1632c26.json new file mode 100644 index 00000000000..d6e7a3bf1af --- /dev/null +++ b/.changelog/58cc3d59322c445ba4ccf256c1632c26.json @@ -0,0 +1,8 @@ +{ + "id": "58cc3d59-322c-445b-a4cc-f256c1632c26", + "type": "feature", + "description": "Marking SAML RoleValues attribute as sensitive and updating VpcConfiguration attributes to match documentation.", + "modules": [ + "service/grafana" + ] +} \ No newline at end of file diff --git a/.changelog/62e1b744e88145068f638edc2e724f8b.json b/.changelog/62e1b744e88145068f638edc2e724f8b.json new file mode 100644 index 00000000000..1786126d41b --- /dev/null +++ b/.changelog/62e1b744e88145068f638edc2e724f8b.json @@ -0,0 +1,8 @@ +{ + "id": "62e1b744-e881-4506-8f63-8edc2e724f8b", + "type": "feature", + "description": "Adds sensitive trait to various shapes in Customer Profiles API model.", + "modules": [ + "service/customerprofiles" + ] +} \ No newline at end of file diff --git a/.changelog/6853227d4d26486bafda80afc7b3edc6.json b/.changelog/6853227d4d26486bafda80afc7b3edc6.json new file mode 100644 index 00000000000..6474c5a1e16 --- /dev/null +++ b/.changelog/6853227d4d26486bafda80afc7b3edc6.json @@ -0,0 +1,8 @@ +{ + "id": "6853227d-4d26-486b-afda-80afc7b3edc6", + "type": "feature", + "description": "Deprecating CloudHSM Classic API Service.", + "modules": [ + "service/cloudhsm" + ] +} \ No newline at end of file diff --git a/.changelog/7f88adf10e364ddfaf1d59d4ba52656e.json b/.changelog/7f88adf10e364ddfaf1d59d4ba52656e.json new file mode 100644 index 00000000000..a3c40ad76c7 --- /dev/null +++ b/.changelog/7f88adf10e364ddfaf1d59d4ba52656e.json @@ -0,0 +1,8 @@ +{ + "id": "7f88adf1-0e36-4ddf-af1d-59d4ba52656e", + "type": "feature", + "description": "Minor model changes for Kafka Connect as well as endpoint updates.", + "modules": [ + "service/kafkaconnect" + ] +} \ No newline at end of file diff --git a/.changelog/82f3d6a2d8694c0b8fbf8470cc6864cc.json b/.changelog/82f3d6a2d8694c0b8fbf8470cc6864cc.json new file mode 100644 index 00000000000..f0496c1bbde --- /dev/null +++ b/.changelog/82f3d6a2d8694c0b8fbf8470cc6864cc.json @@ -0,0 +1,8 @@ +{ + "id": "82f3d6a2-d869-4c0b-8fbf-8470cc6864cc", + "type": "feature", + "description": "Updated \"type\" description for CreateChannel, UpdateChannel, Channel, and ChannelSummary.", + "modules": [ + "service/ivs" + ] +} \ No newline at end of file diff --git a/.changelog/840c3458d0c343f8a463f0415752b5bc.json b/.changelog/840c3458d0c343f8a463f0415752b5bc.json new file mode 100644 index 00000000000..82a1ac7adf8 --- /dev/null +++ b/.changelog/840c3458d0c343f8a463f0415752b5bc.json @@ -0,0 +1,8 @@ +{ + "id": "840c3458-d0c3-43f8-a463-f0415752b5bc", + "type": "feature", + "description": "Amazon Connect outbound campaigns has launched agentless dialing mode which enables customers to make automated outbound calls without agent engagement. This release updates three of the campaign management API's to support the new agentless dialing mode and the new dialing capacity field.", + "modules": [ + "service/connectcampaigns" + ] +} \ No newline at end of file diff --git a/.changelog/8513583237a54fb7a365554649a6ab90.json b/.changelog/8513583237a54fb7a365554649a6ab90.json new file mode 100644 index 00000000000..7083f25f727 --- /dev/null +++ b/.changelog/8513583237a54fb7a365554649a6ab90.json @@ -0,0 +1,8 @@ +{ + "id": "85135832-37a5-4fb7-a365-554649a6ab90", + "type": "feature", + "description": "This release adds support for an account-level setting that you can use to configure the number of days for AWS Fargate task retirement.", + "modules": [ + "service/ecs" + ] +} \ No newline at end of file diff --git a/.changelog/8bfe3952c88348318484800faafb4d7b.json b/.changelog/8bfe3952c88348318484800faafb4d7b.json new file mode 100644 index 00000000000..c9cb92871c2 --- /dev/null +++ b/.changelog/8bfe3952c88348318484800faafb4d7b.json @@ -0,0 +1,8 @@ +{ + "id": "8bfe3952-c883-4831-8484-800faafb4d7b", + "type": "feature", + "description": "Amazon Connect Participant Service adds the ability to get a view resource using a view token, which is provided in a participant message, with the release of the DescribeView API.", + "modules": [ + "service/connectparticipant" + ] +} \ No newline at end of file diff --git a/.changelog/e0eb3431a86c4cd1ba00394bfb78ecaf.json b/.changelog/e0eb3431a86c4cd1ba00394bfb78ecaf.json new file mode 100644 index 00000000000..e4e4981af96 --- /dev/null +++ b/.changelog/e0eb3431a86c4cd1ba00394bfb78ecaf.json @@ -0,0 +1,8 @@ +{ + "id": "e0eb3431-a86c-4cd1-ba00-394bfb78ecaf", + "type": "feature", + "description": "Adds new API DescribeEntityAggregatesForOrganization that retrieves entity aggregates across your organization. Also adds support for resource status filtering in DescribeAffectedEntitiesForOrganization, resource status aggregates in the DescribeEntityAggregates response, and new resource statuses.", + "modules": [ + "service/health" + ] +} \ No newline at end of file diff --git a/service/chimesdkmediapipelines/deserializers.go b/service/chimesdkmediapipelines/deserializers.go index 96d164f6fa3..eb3cbb429da 100644 --- a/service/chimesdkmediapipelines/deserializers.go +++ b/service/chimesdkmediapipelines/deserializers.go @@ -5705,6 +5705,11 @@ func awsRestjson1_deserializeDocumentMediaInsightsPipeline(v **types.MediaInsigh sv.CreatedTimestamp = ptr.Time(t) } + case "ElementStatuses": + if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineElementStatuses(&sv.ElementStatuses, value); err != nil { + return err + } + case "KinesisVideoStreamRecordingSourceRuntimeConfiguration": if err := awsRestjson1_deserializeDocumentKinesisVideoStreamRecordingSourceRuntimeConfiguration(&sv.KinesisVideoStreamRecordingSourceRuntimeConfiguration, value); err != nil { return err @@ -5944,6 +5949,11 @@ func awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationElement(v return err } + case "VoiceEnhancementSinkConfiguration": + if err := awsRestjson1_deserializeDocumentVoiceEnhancementSinkConfiguration(&sv.VoiceEnhancementSinkConfiguration, value); err != nil { + return err + } + default: _, _ = key, value @@ -6079,6 +6089,89 @@ func awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationSummaryLi return nil } +func awsRestjson1_deserializeDocumentMediaInsightsPipelineElementStatus(v **types.MediaInsightsPipelineElementStatus, 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.MediaInsightsPipelineElementStatus + if *v == nil { + sv = &types.MediaInsightsPipelineElementStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaPipelineElementStatus to be of type string, got %T instead", value) + } + sv.Status = types.MediaPipelineElementStatus(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaInsightsPipelineConfigurationElementType to be of type string, got %T instead", value) + } + sv.Type = types.MediaInsightsPipelineConfigurationElementType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMediaInsightsPipelineElementStatuses(v *[]types.MediaInsightsPipelineElementStatus, 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.MediaInsightsPipelineElementStatus + if *v == nil { + cv = []types.MediaInsightsPipelineElementStatus{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MediaInsightsPipelineElementStatus + destAddr := &col + if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineElementStatus(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentMediaInsightsRuntimeMetadata(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8009,3 +8102,43 @@ func awsRestjson1_deserializeDocumentVoiceAnalyticsProcessorConfiguration(v **ty *v = sv return nil } + +func awsRestjson1_deserializeDocumentVoiceEnhancementSinkConfiguration(v **types.VoiceEnhancementSinkConfiguration, 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.VoiceEnhancementSinkConfiguration + if *v == nil { + sv = &types.VoiceEnhancementSinkConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Disabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Disabled = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/chimesdkmediapipelines/serializers.go b/service/chimesdkmediapipelines/serializers.go index bc5398f1c7d..25692a4ae41 100644 --- a/service/chimesdkmediapipelines/serializers.go +++ b/service/chimesdkmediapipelines/serializers.go @@ -2482,6 +2482,13 @@ func awsRestjson1_serializeDocumentMediaInsightsPipelineConfigurationElement(v * } } + if v.VoiceEnhancementSinkConfiguration != nil { + ok := object.Key("VoiceEnhancementSinkConfiguration") + if err := awsRestjson1_serializeDocumentVoiceEnhancementSinkConfiguration(v.VoiceEnhancementSinkConfiguration, ok); err != nil { + return err + } + } + return nil } @@ -3002,3 +3009,15 @@ func awsRestjson1_serializeDocumentVoiceAnalyticsProcessorConfiguration(v *types return nil } + +func awsRestjson1_serializeDocumentVoiceEnhancementSinkConfiguration(v *types.VoiceEnhancementSinkConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Disabled { + ok := object.Key("Disabled") + ok.Boolean(v.Disabled) + } + + return nil +} diff --git a/service/chimesdkmediapipelines/types/enums.go b/service/chimesdkmediapipelines/types/enums.go index deb129aab84..0ba3f9f5e2f 100644 --- a/service/chimesdkmediapipelines/types/enums.go +++ b/service/chimesdkmediapipelines/types/enums.go @@ -479,6 +479,7 @@ const ( MediaInsightsPipelineConfigurationElementTypeSqsQueueSink MediaInsightsPipelineConfigurationElementType = "SqsQueueSink" MediaInsightsPipelineConfigurationElementTypeSnsTopicSink MediaInsightsPipelineConfigurationElementType = "SnsTopicSink" MediaInsightsPipelineConfigurationElementTypeS3RecordingSink MediaInsightsPipelineConfigurationElementType = "S3RecordingSink" + MediaInsightsPipelineConfigurationElementTypeVoiceEnhancementSink MediaInsightsPipelineConfigurationElementType = "VoiceEnhancementSink" ) // Values returns all known values for @@ -495,6 +496,37 @@ func (MediaInsightsPipelineConfigurationElementType) Values() []MediaInsightsPip "SqsQueueSink", "SnsTopicSink", "S3RecordingSink", + "VoiceEnhancementSink", + } +} + +type MediaPipelineElementStatus string + +// Enum values for MediaPipelineElementStatus +const ( + MediaPipelineElementStatusNotStarted MediaPipelineElementStatus = "NotStarted" + MediaPipelineElementStatusNotSupported MediaPipelineElementStatus = "NotSupported" + MediaPipelineElementStatusInitializing MediaPipelineElementStatus = "Initializing" + MediaPipelineElementStatusInProgress MediaPipelineElementStatus = "InProgress" + MediaPipelineElementStatusFailed MediaPipelineElementStatus = "Failed" + MediaPipelineElementStatusStopping MediaPipelineElementStatus = "Stopping" + MediaPipelineElementStatusStopped MediaPipelineElementStatus = "Stopped" + MediaPipelineElementStatusPaused MediaPipelineElementStatus = "Paused" +) + +// Values returns all known values for MediaPipelineElementStatus. 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 (MediaPipelineElementStatus) Values() []MediaPipelineElementStatus { + return []MediaPipelineElementStatus{ + "NotStarted", + "NotSupported", + "Initializing", + "InProgress", + "Failed", + "Stopping", + "Stopped", + "Paused", } } @@ -540,6 +572,7 @@ const ( MediaPipelineStatusStopping MediaPipelineStatus = "Stopping" MediaPipelineStatusStopped MediaPipelineStatus = "Stopped" MediaPipelineStatusPaused MediaPipelineStatus = "Paused" + MediaPipelineStatusNotStarted MediaPipelineStatus = "NotStarted" ) // Values returns all known values for MediaPipelineStatus. Note that this can be @@ -553,6 +586,7 @@ func (MediaPipelineStatus) Values() []MediaPipelineStatus { "Stopping", "Stopped", "Paused", + "NotStarted", } } diff --git a/service/chimesdkmediapipelines/types/types.go b/service/chimesdkmediapipelines/types/types.go index ced273b20cb..6e282007410 100644 --- a/service/chimesdkmediapipelines/types/types.go +++ b/service/chimesdkmediapipelines/types/types.go @@ -790,6 +790,10 @@ type MediaInsightsPipeline struct { // The time at which the media insights pipeline was created. CreatedTimestamp *time.Time + // The statuses that the elements in a media insights pipeline can have during + // data processing. + ElementStatuses []MediaInsightsPipelineElementStatus + // The runtime configuration settings for a Kinesis recording video stream in a // media insights pipeline. KinesisVideoStreamRecordingSourceRuntimeConfiguration *KinesisVideoStreamRecordingSourceRuntimeConfiguration @@ -891,6 +895,9 @@ type MediaInsightsPipelineConfigurationElement struct { // configuration element. VoiceAnalyticsProcessorConfiguration *VoiceAnalyticsProcessorConfiguration + // The configuration settings for the VoiceEnhancementSinkConfiguration element. + VoiceEnhancementSinkConfiguration *VoiceEnhancementSinkConfiguration + noSmithyDocumentSerde } @@ -909,6 +916,18 @@ type MediaInsightsPipelineConfigurationSummary struct { noSmithyDocumentSerde } +// The status of the pipeline element. +type MediaInsightsPipelineElementStatus struct { + + // The element's status. + Status MediaPipelineElementStatus + + // The type of status. + Type MediaInsightsPipelineConfigurationElementType + + noSmithyDocumentSerde +} + // The connector pipeline. type MediaLiveConnectorPipeline struct { @@ -1242,7 +1261,7 @@ type TranscriptionMessagesConcatenationConfiguration struct { noSmithyDocumentSerde } -// Defines the configuration settings for a vertial layout. +// Defines the configuration settings for a vertical layout. type VerticalLayoutConfiguration struct { // Sets the aspect ratio of the video tiles, such as 16:9. @@ -1315,4 +1334,14 @@ type VoiceAnalyticsProcessorConfiguration struct { noSmithyDocumentSerde } +// A static structure that contains the configuration data for a +// VoiceEnhancementSinkConfiguration element. +type VoiceEnhancementSinkConfiguration struct { + + // Disables the VoiceEnhancementSinkConfiguration element. + Disabled bool + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/cloudhsm/api_op_AddTagsToResource.go b/service/cloudhsm/api_op_AddTagsToResource.go index 435dca21c66..14d0ea61bfc 100644 --- a/service/cloudhsm/api_op_AddTagsToResource.go +++ b/service/cloudhsm/api_op_AddTagsToResource.go @@ -26,6 +26,8 @@ import ( // . Adds or overwrites one or more tags for the specified AWS CloudHSM resource. // Each tag consists of a key and a value. Tag keys must be unique to each // resource. +// +// Deprecated: This API is deprecated. func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) { if params == nil { params = &AddTagsToResourceInput{} diff --git a/service/cloudhsm/api_op_CreateHapg.go b/service/cloudhsm/api_op_CreateHapg.go index 6315fb0e17c..10f1594f97d 100644 --- a/service/cloudhsm/api_op_CreateHapg.go +++ b/service/cloudhsm/api_op_CreateHapg.go @@ -24,6 +24,8 @@ import ( // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Creates a high-availability partition group. A high-availability partition // group is a group of partitions that spans multiple physical HSMs. +// +// Deprecated: This API is deprecated. func (c *Client) CreateHapg(ctx context.Context, params *CreateHapgInput, optFns ...func(*Options)) (*CreateHapgOutput, error) { if params == nil { params = &CreateHapgInput{} diff --git a/service/cloudhsm/api_op_CreateHsm.go b/service/cloudhsm/api_op_CreateHsm.go index 27a085c6168..b5643a34be2 100644 --- a/service/cloudhsm/api_op_CreateHsm.go +++ b/service/cloudhsm/api_op_CreateHsm.go @@ -31,6 +31,8 @@ import ( // 20 minutes to create and provision an HSM. You can monitor the status of the HSM // with the DescribeHsm operation. The HSM is ready to be initialized when the // status changes to RUNNING . +// +// Deprecated: This API is deprecated. func (c *Client) CreateHsm(ctx context.Context, params *CreateHsmInput, optFns ...func(*Options)) (*CreateHsmOutput, error) { if params == nil { params = &CreateHsmInput{} diff --git a/service/cloudhsm/api_op_CreateLunaClient.go b/service/cloudhsm/api_op_CreateLunaClient.go index 51eab8d91cb..0b4fb213b94 100644 --- a/service/cloudhsm/api_op_CreateLunaClient.go +++ b/service/cloudhsm/api_op_CreateLunaClient.go @@ -23,6 +23,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Creates an HSM client. +// +// Deprecated: This API is deprecated. func (c *Client) CreateLunaClient(ctx context.Context, params *CreateLunaClientInput, optFns ...func(*Options)) (*CreateLunaClientOutput, error) { if params == nil { params = &CreateLunaClientInput{} diff --git a/service/cloudhsm/api_op_DeleteHapg.go b/service/cloudhsm/api_op_DeleteHapg.go index 61e34511042..3548498ed2a 100644 --- a/service/cloudhsm/api_op_DeleteHapg.go +++ b/service/cloudhsm/api_op_DeleteHapg.go @@ -23,6 +23,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Deletes a high-availability partition group. +// +// Deprecated: This API is deprecated. func (c *Client) DeleteHapg(ctx context.Context, params *DeleteHapgInput, optFns ...func(*Options)) (*DeleteHapgOutput, error) { if params == nil { params = &DeleteHapgInput{} diff --git a/service/cloudhsm/api_op_DeleteHsm.go b/service/cloudhsm/api_op_DeleteHsm.go index 49b5f508807..44eaeb192e4 100644 --- a/service/cloudhsm/api_op_DeleteHsm.go +++ b/service/cloudhsm/api_op_DeleteHsm.go @@ -24,6 +24,8 @@ import ( // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Deletes an HSM. After completion, this operation cannot be undone and your key // material cannot be recovered. +// +// Deprecated: This API is deprecated. func (c *Client) DeleteHsm(ctx context.Context, params *DeleteHsmInput, optFns ...func(*Options)) (*DeleteHsmOutput, error) { if params == nil { params = &DeleteHsmInput{} diff --git a/service/cloudhsm/api_op_DeleteLunaClient.go b/service/cloudhsm/api_op_DeleteLunaClient.go index dcc7a93da65..852878af1ec 100644 --- a/service/cloudhsm/api_op_DeleteLunaClient.go +++ b/service/cloudhsm/api_op_DeleteLunaClient.go @@ -23,6 +23,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Deletes a client. +// +// Deprecated: This API is deprecated. func (c *Client) DeleteLunaClient(ctx context.Context, params *DeleteLunaClientInput, optFns ...func(*Options)) (*DeleteLunaClientOutput, error) { if params == nil { params = &DeleteLunaClientInput{} diff --git a/service/cloudhsm/api_op_DescribeHapg.go b/service/cloudhsm/api_op_DescribeHapg.go index 4fb1c61c466..190a63c276f 100644 --- a/service/cloudhsm/api_op_DescribeHapg.go +++ b/service/cloudhsm/api_op_DescribeHapg.go @@ -24,6 +24,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Retrieves information about a high-availability partition group. +// +// Deprecated: This API is deprecated. func (c *Client) DescribeHapg(ctx context.Context, params *DescribeHapgInput, optFns ...func(*Options)) (*DescribeHapgOutput, error) { if params == nil { params = &DescribeHapgInput{} diff --git a/service/cloudhsm/api_op_DescribeHsm.go b/service/cloudhsm/api_op_DescribeHsm.go index 4bbc51a0f62..505233500e6 100644 --- a/service/cloudhsm/api_op_DescribeHsm.go +++ b/service/cloudhsm/api_op_DescribeHsm.go @@ -25,6 +25,8 @@ import ( // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Retrieves information about an HSM. You can identify the HSM by its ARN or its // serial number. +// +// Deprecated: This API is deprecated. func (c *Client) DescribeHsm(ctx context.Context, params *DescribeHsmInput, optFns ...func(*Options)) (*DescribeHsmOutput, error) { if params == nil { params = &DescribeHsmInput{} diff --git a/service/cloudhsm/api_op_DescribeLunaClient.go b/service/cloudhsm/api_op_DescribeLunaClient.go index 87abff4a6c3..c091329532e 100644 --- a/service/cloudhsm/api_op_DescribeLunaClient.go +++ b/service/cloudhsm/api_op_DescribeLunaClient.go @@ -23,6 +23,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Retrieves information about an HSM client. +// +// Deprecated: This API is deprecated. func (c *Client) DescribeLunaClient(ctx context.Context, params *DescribeLunaClientInput, optFns ...func(*Options)) (*DescribeLunaClientOutput, error) { if params == nil { params = &DescribeLunaClientInput{} diff --git a/service/cloudhsm/api_op_GetConfig.go b/service/cloudhsm/api_op_GetConfig.go index 0f7d8116471..c20c2304265 100644 --- a/service/cloudhsm/api_op_GetConfig.go +++ b/service/cloudhsm/api_op_GetConfig.go @@ -25,6 +25,8 @@ import ( // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Gets the configuration files necessary to connect to all high availability // partition groups the client is associated with. +// +// Deprecated: This API is deprecated. func (c *Client) GetConfig(ctx context.Context, params *GetConfigInput, optFns ...func(*Options)) (*GetConfigOutput, error) { if params == nil { params = &GetConfigInput{} diff --git a/service/cloudhsm/api_op_ListAvailableZones.go b/service/cloudhsm/api_op_ListAvailableZones.go index faa1ef4b96d..b10d2a139f1 100644 --- a/service/cloudhsm/api_op_ListAvailableZones.go +++ b/service/cloudhsm/api_op_ListAvailableZones.go @@ -23,6 +23,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Lists the Availability Zones that have available AWS CloudHSM capacity. +// +// Deprecated: This API is deprecated. func (c *Client) ListAvailableZones(ctx context.Context, params *ListAvailableZonesInput, optFns ...func(*Options)) (*ListAvailableZonesOutput, error) { if params == nil { params = &ListAvailableZonesInput{} diff --git a/service/cloudhsm/api_op_ListHapgs.go b/service/cloudhsm/api_op_ListHapgs.go index bbbbee1fb48..6af598a2061 100644 --- a/service/cloudhsm/api_op_ListHapgs.go +++ b/service/cloudhsm/api_op_ListHapgs.go @@ -26,6 +26,8 @@ import ( // supports pagination with the use of the NextToken member. If more results are // available, the NextToken member of the response contains a token that you pass // in the next call to ListHapgs to retrieve the next set of items. +// +// Deprecated: This API is deprecated. func (c *Client) ListHapgs(ctx context.Context, params *ListHapgsInput, optFns ...func(*Options)) (*ListHapgsOutput, error) { if params == nil { params = &ListHapgsInput{} diff --git a/service/cloudhsm/api_op_ListHsms.go b/service/cloudhsm/api_op_ListHsms.go index 04e87cf0577..1dd5ba6de26 100644 --- a/service/cloudhsm/api_op_ListHsms.go +++ b/service/cloudhsm/api_op_ListHsms.go @@ -27,6 +27,8 @@ import ( // member. If more results are available, the NextToken member of the response // contains a token that you pass in the next call to ListHsms to retrieve the // next set of items. +// +// Deprecated: This API is deprecated. func (c *Client) ListHsms(ctx context.Context, params *ListHsmsInput, optFns ...func(*Options)) (*ListHsmsOutput, error) { if params == nil { params = &ListHsmsInput{} diff --git a/service/cloudhsm/api_op_ListLunaClients.go b/service/cloudhsm/api_op_ListLunaClients.go index 0c76e47087c..170ea50b325 100644 --- a/service/cloudhsm/api_op_ListLunaClients.go +++ b/service/cloudhsm/api_op_ListLunaClients.go @@ -26,6 +26,8 @@ import ( // the NextToken member. If more results are available, the NextToken member of // the response contains a token that you pass in the next call to ListLunaClients // to retrieve the next set of items. +// +// Deprecated: This API is deprecated. func (c *Client) ListLunaClients(ctx context.Context, params *ListLunaClientsInput, optFns ...func(*Options)) (*ListLunaClientsOutput, error) { if params == nil { params = &ListLunaClientsInput{} diff --git a/service/cloudhsm/api_op_ListTagsForResource.go b/service/cloudhsm/api_op_ListTagsForResource.go index 53b219286f1..d1716420dc2 100644 --- a/service/cloudhsm/api_op_ListTagsForResource.go +++ b/service/cloudhsm/api_op_ListTagsForResource.go @@ -24,6 +24,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Returns a list of all tags for the specified AWS CloudHSM resource. +// +// Deprecated: This API is deprecated. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} diff --git a/service/cloudhsm/api_op_ModifyHapg.go b/service/cloudhsm/api_op_ModifyHapg.go index 4260ae32110..2c4c7e196be 100644 --- a/service/cloudhsm/api_op_ModifyHapg.go +++ b/service/cloudhsm/api_op_ModifyHapg.go @@ -23,6 +23,8 @@ import ( // , the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/) // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Modifies an existing high-availability partition group. +// +// Deprecated: This API is deprecated. func (c *Client) ModifyHapg(ctx context.Context, params *ModifyHapgInput, optFns ...func(*Options)) (*ModifyHapgOutput, error) { if params == nil { params = &ModifyHapgInput{} diff --git a/service/cloudhsm/api_op_ModifyHsm.go b/service/cloudhsm/api_op_ModifyHsm.go index a046032679a..d3aa9660231 100644 --- a/service/cloudhsm/api_op_ModifyHsm.go +++ b/service/cloudhsm/api_op_ModifyHsm.go @@ -27,6 +27,8 @@ import ( // a production HSM, you should ensure that your AWS CloudHSM service is configured // for high availability, and consider executing this operation during a // maintenance window. +// +// Deprecated: This API is deprecated. func (c *Client) ModifyHsm(ctx context.Context, params *ModifyHsmInput, optFns ...func(*Options)) (*ModifyHsmOutput, error) { if params == nil { params = &ModifyHsmInput{} diff --git a/service/cloudhsm/api_op_ModifyLunaClient.go b/service/cloudhsm/api_op_ModifyLunaClient.go index efa133de8a3..23189a9cb3a 100644 --- a/service/cloudhsm/api_op_ModifyLunaClient.go +++ b/service/cloudhsm/api_op_ModifyLunaClient.go @@ -24,6 +24,8 @@ import ( // , and the AWS CloudHSM API Reference (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/) // . Modifies the certificate used by the client. This action can potentially start // a workflow to install the new certificate on the client's HSMs. +// +// Deprecated: This API is deprecated. func (c *Client) ModifyLunaClient(ctx context.Context, params *ModifyLunaClientInput, optFns ...func(*Options)) (*ModifyLunaClientOutput, error) { if params == nil { params = &ModifyLunaClientInput{} diff --git a/service/cloudhsm/api_op_RemoveTagsFromResource.go b/service/cloudhsm/api_op_RemoveTagsFromResource.go index f29e78fac48..99b54784438 100644 --- a/service/cloudhsm/api_op_RemoveTagsFromResource.go +++ b/service/cloudhsm/api_op_RemoveTagsFromResource.go @@ -25,6 +25,8 @@ import ( // . Removes one or more tags from the specified AWS CloudHSM resource. To remove a // tag, specify only the tag key to remove (not the value). To overwrite the value // for an existing tag, use AddTagsToResource . +// +// Deprecated: This API is deprecated. func (c *Client) RemoveTagsFromResource(ctx context.Context, params *RemoveTagsFromResourceInput, optFns ...func(*Options)) (*RemoveTagsFromResourceOutput, error) { if params == nil { params = &RemoveTagsFromResourceInput{} diff --git a/service/cloudhsm/endpoints_test.go b/service/cloudhsm/endpoints_test.go index fe60bf2b908..4eba23fb4ed 100644 --- a/service/cloudhsm/endpoints_test.go +++ b/service/cloudhsm/endpoints_test.go @@ -18,8 +18,8 @@ import ( func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -57,8 +57,8 @@ func TestEndpointCase0(t *testing.T) { func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -96,8 +96,8 @@ func TestEndpointCase1(t *testing.T) { func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -135,8 +135,8 @@ func TestEndpointCase2(t *testing.T) { func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -174,8 +174,8 @@ func TestEndpointCase3(t *testing.T) { func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -213,8 +213,8 @@ func TestEndpointCase4(t *testing.T) { func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -252,8 +252,8 @@ func TestEndpointCase5(t *testing.T) { func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -291,8 +291,8 @@ func TestEndpointCase6(t *testing.T) { func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -330,8 +330,8 @@ func TestEndpointCase7(t *testing.T) { func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -369,8 +369,8 @@ func TestEndpointCase8(t *testing.T) { func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -408,8 +408,8 @@ func TestEndpointCase9(t *testing.T) { func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -447,8 +447,8 @@ func TestEndpointCase10(t *testing.T) { func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -486,8 +486,8 @@ func TestEndpointCase11(t *testing.T) { func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -521,12 +521,32 @@ func TestEndpointCase12(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack disabled +// For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -560,12 +580,32 @@ func TestEndpointCase13(t *testing.T) { } } +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase14(t *testing.T) { +func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -599,12 +639,32 @@ func TestEndpointCase14(t *testing.T) { } } +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase15(t *testing.T) { +func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -638,12 +698,32 @@ func TestEndpointCase15(t *testing.T) { } } +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase16(t *testing.T) { +func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -678,11 +758,11 @@ func TestEndpointCase16(t *testing.T) { } // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase17(t *testing.T) { +func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -718,10 +798,10 @@ func TestEndpointCase17(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase18(t *testing.T) { +func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -757,11 +837,11 @@ func TestEndpointCase18(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase19(t *testing.T) { +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -778,11 +858,11 @@ func TestEndpointCase19(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase20(t *testing.T) { +func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -797,3 +877,19 @@ func TestEndpointCase20(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase25(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/cloudwatchevents/api_op_PutTargets.go b/service/cloudwatchevents/api_op_PutTargets.go index 980b23b156d..43427015c18 100644 --- a/service/cloudwatchevents/api_op_PutTargets.go +++ b/service/cloudwatchevents/api_op_PutTargets.go @@ -47,9 +47,9 @@ import ( // - SSM Run Command // - Step Functions state machines // -// Creating rules with built-in targets is supported only in the Management -// Console. The built-in targets are EC2 CreateSnapshot API call , EC2 -// RebootInstances API call , EC2 StopInstances API call , and EC2 +// Creating rules with built-in targets is supported only in the Amazon Web +// Services Management Console. The built-in targets are EC2 CreateSnapshot API +// call , EC2 RebootInstances API call , EC2 StopInstances API call , and EC2 // TerminateInstances API call . For some target types, PutTargets provides // target-specific parameters. If the target is a Kinesis data stream, you can // optionally specify which shard the event goes to by using the KinesisParameters diff --git a/service/cloudwatchevents/endpoints_test.go b/service/cloudwatchevents/endpoints_test.go index 4ab0eae73bd..222f610acfa 100644 --- a/service/cloudwatchevents/endpoints_test.go +++ b/service/cloudwatchevents/endpoints_test.go @@ -18,8 +18,8 @@ import ( func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("af-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -57,8 +57,8 @@ func TestEndpointCase0(t *testing.T) { func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -96,8 +96,8 @@ func TestEndpointCase1(t *testing.T) { func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -135,8 +135,8 @@ func TestEndpointCase2(t *testing.T) { func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -174,8 +174,8 @@ func TestEndpointCase3(t *testing.T) { func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -213,8 +213,8 @@ func TestEndpointCase4(t *testing.T) { func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -252,8 +252,8 @@ func TestEndpointCase5(t *testing.T) { func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -291,8 +291,8 @@ func TestEndpointCase6(t *testing.T) { func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -330,8 +330,8 @@ func TestEndpointCase7(t *testing.T) { func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -369,8 +369,8 @@ func TestEndpointCase8(t *testing.T) { func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ca-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -408,8 +408,8 @@ func TestEndpointCase9(t *testing.T) { func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -447,8 +447,8 @@ func TestEndpointCase10(t *testing.T) { func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -486,8 +486,8 @@ func TestEndpointCase11(t *testing.T) { func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -525,8 +525,8 @@ func TestEndpointCase12(t *testing.T) { func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -564,8 +564,8 @@ func TestEndpointCase13(t *testing.T) { func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -603,8 +603,8 @@ func TestEndpointCase14(t *testing.T) { func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -642,8 +642,8 @@ func TestEndpointCase15(t *testing.T) { func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("me-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -681,8 +681,8 @@ func TestEndpointCase16(t *testing.T) { func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("sa-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -720,8 +720,8 @@ func TestEndpointCase17(t *testing.T) { func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -759,8 +759,8 @@ func TestEndpointCase18(t *testing.T) { func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -798,8 +798,8 @@ func TestEndpointCase19(t *testing.T) { func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -837,8 +837,8 @@ func TestEndpointCase20(t *testing.T) { func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -876,8 +876,8 @@ func TestEndpointCase21(t *testing.T) { func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -915,8 +915,8 @@ func TestEndpointCase22(t *testing.T) { func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -954,8 +954,8 @@ func TestEndpointCase23(t *testing.T) { func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -993,8 +993,8 @@ func TestEndpointCase24(t *testing.T) { func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1032,8 +1032,8 @@ func TestEndpointCase25(t *testing.T) { func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1071,8 +1071,8 @@ func TestEndpointCase26(t *testing.T) { func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1110,8 +1110,8 @@ func TestEndpointCase27(t *testing.T) { func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1149,8 +1149,8 @@ func TestEndpointCase28(t *testing.T) { func TestEndpointCase29(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-northwest-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1188,8 +1188,8 @@ func TestEndpointCase29(t *testing.T) { func TestEndpointCase30(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1227,8 +1227,8 @@ func TestEndpointCase30(t *testing.T) { func TestEndpointCase31(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1266,8 +1266,8 @@ func TestEndpointCase31(t *testing.T) { func TestEndpointCase32(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1305,8 +1305,8 @@ func TestEndpointCase32(t *testing.T) { func TestEndpointCase33(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1344,8 +1344,8 @@ func TestEndpointCase33(t *testing.T) { func TestEndpointCase34(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1383,8 +1383,8 @@ func TestEndpointCase34(t *testing.T) { func TestEndpointCase35(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1422,8 +1422,8 @@ func TestEndpointCase35(t *testing.T) { func TestEndpointCase36(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1461,8 +1461,8 @@ func TestEndpointCase36(t *testing.T) { func TestEndpointCase37(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1500,8 +1500,8 @@ func TestEndpointCase37(t *testing.T) { func TestEndpointCase38(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1539,8 +1539,8 @@ func TestEndpointCase38(t *testing.T) { func TestEndpointCase39(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1578,8 +1578,8 @@ func TestEndpointCase39(t *testing.T) { func TestEndpointCase40(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1613,12 +1613,32 @@ func TestEndpointCase40(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack disabled +// For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase41(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase42(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1652,12 +1672,32 @@ func TestEndpointCase41(t *testing.T) { } } +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase43(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase42(t *testing.T) { +func TestEndpointCase44(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1691,12 +1731,32 @@ func TestEndpointCase42(t *testing.T) { } } +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase45(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase43(t *testing.T) { +func TestEndpointCase46(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1730,12 +1790,32 @@ func TestEndpointCase43(t *testing.T) { } } +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase47(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase44(t *testing.T) { +func TestEndpointCase48(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1771,10 +1851,10 @@ func TestEndpointCase44(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase45(t *testing.T) { +func TestEndpointCase49(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1810,11 +1890,11 @@ func TestEndpointCase45(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase46(t *testing.T) { +func TestEndpointCase50(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1831,11 +1911,11 @@ func TestEndpointCase46(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase47(t *testing.T) { +func TestEndpointCase51(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -1850,3 +1930,19 @@ func TestEndpointCase47(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase52(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/cloudwatchevents/types/types.go b/service/cloudwatchevents/types/types.go index 33389efd3c1..638861f9f9b 100644 --- a/service/cloudwatchevents/types/types.go +++ b/service/cloudwatchevents/types/types.go @@ -655,7 +655,7 @@ type InputTransformer struct { // "InputPathsMap": {"instance": "$.detail.instance","status": // "$.detail.status"}, // - // "InputTemplate": " is in state """ + // "InputTemplate": " is in state \"\"" // } The InputTemplate can also be valid JSON with varibles in quotes or out, as // in the following example: "InputTransformer": // { @@ -663,7 +663,7 @@ type InputTransformer struct { // "InputPathsMap": {"instance": "$.detail.instance","status": // "$.detail.status"}, // - // "InputTemplate": '{"myInstance": ,"myStatus": " is in state """}' + // "InputTemplate": '{"myInstance": ,"myStatus": " is in state \"\""}' // // } // diff --git a/service/cognitoidentity/internal/endpoints/endpoints.go b/service/cognitoidentity/internal/endpoints/endpoints.go index 7912baef3cc..de27afd3d02 100644 --- a/service/cognitoidentity/internal/endpoints/endpoints.go +++ b/service/cognitoidentity/internal/endpoints/endpoints.go @@ -145,6 +145,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, @@ -211,6 +214,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/cognitoidentityprovider/internal/endpoints/endpoints.go b/service/cognitoidentityprovider/internal/endpoints/endpoints.go index f9dac7b1e19..b08367e41b5 100644 --- a/service/cognitoidentityprovider/internal/endpoints/endpoints.go +++ b/service/cognitoidentityprovider/internal/endpoints/endpoints.go @@ -145,6 +145,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, @@ -211,6 +214,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/connectcampaigns/deserializers.go b/service/connectcampaigns/deserializers.go index 5e6ebed774b..bde4e2cc8aa 100644 --- a/service/connectcampaigns/deserializers.go +++ b/service/connectcampaigns/deserializers.go @@ -3404,6 +3404,71 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } +func awsRestjson1_deserializeDocumentAgentlessDialerConfig(v **types.AgentlessDialerConfig, 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.AgentlessDialerConfig + if *v == nil { + sv = &types.AgentlessDialerConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dialingCapacity": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DialingCapacity = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.DialingCapacity = ptr.Float64(f64) + + default: + return fmt.Errorf("expected DialingCapacity to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAnswerMachineDetectionConfig(v **types.AnswerMachineDetectionConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3696,6 +3761,16 @@ loop: continue } switch key { + case "agentlessDialerConfig": + var mv types.AgentlessDialerConfig + destAddr := &mv + if err := awsRestjson1_deserializeDocumentAgentlessDialerConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.DialerConfigMemberAgentlessDialerConfig{Value: mv} + break loop + case "predictiveDialerConfig": var mv types.PredictiveDialerConfig destAddr := &mv @@ -4346,6 +4421,40 @@ func awsRestjson1_deserializeDocumentPredictiveDialerConfig(v **types.Predictive } } + case "dialingCapacity": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DialingCapacity = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.DialingCapacity = ptr.Float64(f64) + + default: + return fmt.Errorf("expected DialingCapacity to be a JSON Number, got %T instead", value) + + } + } + default: _, _ = key, value @@ -4411,6 +4520,40 @@ func awsRestjson1_deserializeDocumentProgressiveDialerConfig(v **types.Progressi } } + case "dialingCapacity": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DialingCapacity = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.DialingCapacity = ptr.Float64(f64) + + default: + return fmt.Errorf("expected DialingCapacity to be a JSON Number, got %T instead", value) + + } + } + default: _, _ = key, value diff --git a/service/connectcampaigns/endpoints_test.go b/service/connectcampaigns/endpoints_test.go index 602b2eec915..0e1830d36c8 100644 --- a/service/connectcampaigns/endpoints_test.go +++ b/service/connectcampaigns/endpoints_test.go @@ -18,8 +18,8 @@ import ( func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -57,8 +57,8 @@ func TestEndpointCase0(t *testing.T) { func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -96,8 +96,8 @@ func TestEndpointCase1(t *testing.T) { func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -135,8 +135,8 @@ func TestEndpointCase2(t *testing.T) { func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -174,8 +174,8 @@ func TestEndpointCase3(t *testing.T) { func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -213,8 +213,8 @@ func TestEndpointCase4(t *testing.T) { func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -252,8 +252,8 @@ func TestEndpointCase5(t *testing.T) { func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -291,8 +291,8 @@ func TestEndpointCase6(t *testing.T) { func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -330,8 +330,8 @@ func TestEndpointCase7(t *testing.T) { func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -369,8 +369,8 @@ func TestEndpointCase8(t *testing.T) { func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -408,8 +408,8 @@ func TestEndpointCase9(t *testing.T) { func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -447,8 +447,8 @@ func TestEndpointCase10(t *testing.T) { func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -486,8 +486,8 @@ func TestEndpointCase11(t *testing.T) { func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -525,8 +525,8 @@ func TestEndpointCase12(t *testing.T) { func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -564,8 +564,8 @@ func TestEndpointCase13(t *testing.T) { func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -599,12 +599,32 @@ func TestEndpointCase14(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack disabled +// For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -638,12 +658,32 @@ func TestEndpointCase15(t *testing.T) { } } +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase16(t *testing.T) { +func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -677,12 +717,32 @@ func TestEndpointCase16(t *testing.T) { } } +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase17(t *testing.T) { +func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -716,12 +776,32 @@ func TestEndpointCase17(t *testing.T) { } } +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase18(t *testing.T) { +func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -756,11 +836,11 @@ func TestEndpointCase18(t *testing.T) { } // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase19(t *testing.T) { +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -796,10 +876,10 @@ func TestEndpointCase19(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase20(t *testing.T) { +func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -835,11 +915,11 @@ func TestEndpointCase20(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase21(t *testing.T) { +func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -856,11 +936,11 @@ func TestEndpointCase21(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase22(t *testing.T) { +func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -875,3 +955,19 @@ func TestEndpointCase22(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase27(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/connectcampaigns/serializers.go b/service/connectcampaigns/serializers.go index 07c4c50c3bc..083c6a92276 100644 --- a/service/connectcampaigns/serializers.go +++ b/service/connectcampaigns/serializers.go @@ -1680,6 +1680,31 @@ func awsRestjson1_serializeOpDocumentUpdateCampaignOutboundCallConfigInput(v *Up return nil } +func awsRestjson1_serializeDocumentAgentlessDialerConfig(v *types.AgentlessDialerConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DialingCapacity != nil { + ok := object.Key("dialingCapacity") + switch { + case math.IsNaN(*v.DialingCapacity): + ok.String("NaN") + + case math.IsInf(*v.DialingCapacity, 1): + ok.String("Infinity") + + case math.IsInf(*v.DialingCapacity, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.DialingCapacity) + + } + } + + return nil +} + func awsRestjson1_serializeDocumentAnswerMachineDetectionConfig(v *types.AnswerMachineDetectionConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1733,6 +1758,12 @@ func awsRestjson1_serializeDocumentDialerConfig(v types.DialerConfig, value smit defer object.Close() switch uv := v.(type) { + case *types.DialerConfigMemberAgentlessDialerConfig: + av := object.Key("agentlessDialerConfig") + if err := awsRestjson1_serializeDocumentAgentlessDialerConfig(&uv.Value, av); err != nil { + return err + } + case *types.DialerConfigMemberPredictiveDialerConfig: av := object.Key("predictiveDialerConfig") if err := awsRestjson1_serializeDocumentPredictiveDialerConfig(&uv.Value, av); err != nil { @@ -1884,6 +1915,24 @@ func awsRestjson1_serializeDocumentPredictiveDialerConfig(v *types.PredictiveDia } } + if v.DialingCapacity != nil { + ok := object.Key("dialingCapacity") + switch { + case math.IsNaN(*v.DialingCapacity): + ok.String("NaN") + + case math.IsInf(*v.DialingCapacity, 1): + ok.String("Infinity") + + case math.IsInf(*v.DialingCapacity, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.DialingCapacity) + + } + } + return nil } @@ -1909,6 +1958,24 @@ func awsRestjson1_serializeDocumentProgressiveDialerConfig(v *types.ProgressiveD } } + if v.DialingCapacity != nil { + ok := object.Key("dialingCapacity") + switch { + case math.IsNaN(*v.DialingCapacity): + ok.String("NaN") + + case math.IsInf(*v.DialingCapacity, 1): + ok.String("Infinity") + + case math.IsInf(*v.DialingCapacity, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.DialingCapacity) + + } + } + return nil } diff --git a/service/connectcampaigns/types/types.go b/service/connectcampaigns/types/types.go index 5f384ba5720..7e85c5d3b23 100644 --- a/service/connectcampaigns/types/types.go +++ b/service/connectcampaigns/types/types.go @@ -7,6 +7,15 @@ import ( "time" ) +// Agentless Dialer config +type AgentlessDialerConfig struct { + + // Allocates dialing capacity for this campaign between multiple active campaigns + DialingCapacity *float64 + + noSmithyDocumentSerde +} + // Answering Machine Detection config type AnswerMachineDetectionConfig struct { @@ -96,12 +105,22 @@ type CampaignSummary struct { // // The following types satisfy this interface: // +// DialerConfigMemberAgentlessDialerConfig // DialerConfigMemberPredictiveDialerConfig // DialerConfigMemberProgressiveDialerConfig type DialerConfig interface { isDialerConfig() } +// Agentless Dialer config +type DialerConfigMemberAgentlessDialerConfig struct { + Value AgentlessDialerConfig + + noSmithyDocumentSerde +} + +func (*DialerConfigMemberAgentlessDialerConfig) isDialerConfig() {} + // Predictive Dialer config type DialerConfigMemberPredictiveDialerConfig struct { Value PredictiveDialerConfig @@ -265,17 +284,15 @@ type OutboundCallConfig struct { // This member is required. ConnectContactFlowId *string + // Answering Machine Detection config + AnswerMachineDetectionConfig *AnswerMachineDetectionConfig + // The queue for the call. If you specify a queue, the phone displayed for caller // ID is the phone number specified in the queue. If you do not specify a queue, // the queue defined in the contact flow is used. If you do not specify a queue, // you must specify a source phone number. - // - // This member is required. ConnectQueueId *string - // Answering Machine Detection config - AnswerMachineDetectionConfig *AnswerMachineDetectionConfig - // The phone number associated with the Amazon Connect instance, in E.164 format. // If you do not specify a source phone number, you must specify a queue. ConnectSourcePhoneNumber *string @@ -291,6 +308,9 @@ type PredictiveDialerConfig struct { // This member is required. BandwidthAllocation *float64 + // Allocates dialing capacity for this campaign between multiple active campaigns + DialingCapacity *float64 + noSmithyDocumentSerde } @@ -302,6 +322,9 @@ type ProgressiveDialerConfig struct { // This member is required. BandwidthAllocation *float64 + // Allocates dialing capacity for this campaign between multiple active campaigns + DialingCapacity *float64 + noSmithyDocumentSerde } diff --git a/service/connectcampaigns/types/types_exported_test.go b/service/connectcampaigns/types/types_exported_test.go index 72d72dfafce..819148a99ef 100644 --- a/service/connectcampaigns/types/types_exported_test.go +++ b/service/connectcampaigns/types/types_exported_test.go @@ -11,6 +11,9 @@ func ExampleDialerConfig_outputUsage() { var union types.DialerConfig // type switches can be used to check the union value switch v := union.(type) { + case *types.DialerConfigMemberAgentlessDialerConfig: + _ = v.Value // Value is types.AgentlessDialerConfig + case *types.DialerConfigMemberPredictiveDialerConfig: _ = v.Value // Value is types.PredictiveDialerConfig @@ -27,4 +30,5 @@ func ExampleDialerConfig_outputUsage() { } var _ *types.PredictiveDialerConfig +var _ *types.AgentlessDialerConfig var _ *types.ProgressiveDialerConfig diff --git a/service/connectcampaigns/validators.go b/service/connectcampaigns/validators.go index 3688b40f69f..4a5f04594a9 100644 --- a/service/connectcampaigns/validators.go +++ b/service/connectcampaigns/validators.go @@ -673,9 +673,6 @@ func validateOutboundCallConfig(v *types.OutboundCallConfig) error { if v.ConnectContactFlowId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectContactFlowId")) } - if v.ConnectQueueId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectQueueId")) - } if v.AnswerMachineDetectionConfig != nil { if err := validateAnswerMachineDetectionConfig(v.AnswerMachineDetectionConfig); err != nil { invalidParams.AddNested("AnswerMachineDetectionConfig", err.(smithy.InvalidParamsError)) diff --git a/service/connectparticipant/api_op_CreateParticipantConnection.go b/service/connectparticipant/api_op_CreateParticipantConnection.go index 63cefe6b1f6..afb05dc3a66 100644 --- a/service/connectparticipant/api_op_CreateParticipantConnection.go +++ b/service/connectparticipant/api_op_CreateParticipantConnection.go @@ -65,8 +65,9 @@ type CreateParticipantConnectionInput struct { // participant in non-streaming chats. ConnectParticipant *bool - // Type of connection information required. This can be omitted if - // ConnectParticipant is true . + // Type of connection information required. If you need CONNECTION_CREDENTIALS + // along with marking participant as connected, pass CONNECTION_CREDENTIALS in Type + // . Type []types.ConnectionType noSmithyDocumentSerde diff --git a/service/connectparticipant/api_op_DescribeView.go b/service/connectparticipant/api_op_DescribeView.go new file mode 100644 index 00000000000..3629141de25 --- /dev/null +++ b/service/connectparticipant/api_op_DescribeView.go @@ -0,0 +1,268 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectparticipant + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/connectparticipant/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the view for the specified view token. +func (c *Client) DescribeView(ctx context.Context, params *DescribeViewInput, optFns ...func(*Options)) (*DescribeViewOutput, error) { + if params == nil { + params = &DescribeViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeView", params, optFns, c.addOperationDescribeViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeViewInput struct { + + // The connection token. + // + // This member is required. + ConnectionToken *string + + // An encrypted token originating from the interactive message of a ShowView block + // operation. Represents the desired view. + // + // This member is required. + ViewToken *string + + noSmithyDocumentSerde +} + +type DescribeViewOutput struct { + + // A view resource object. Contains metadata and content necessary to render the + // view. + View *types.View + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeView{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDescribeViewResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDescribeViewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeView(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "execute-api", + OperationName: "DescribeView", + } +} + +type opDescribeViewResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeViewResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeViewResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "execute-api" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "execute-api" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("execute-api") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeViewResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeViewResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/connectparticipant/deserializers.go b/service/connectparticipant/deserializers.go index e2bd02c36f4..26d06af2186 100644 --- a/service/connectparticipant/deserializers.go +++ b/service/connectparticipant/deserializers.go @@ -277,6 +277,165 @@ func awsRestjson1_deserializeOpDocumentCreateParticipantConnectionOutput(v **Cre return nil } +type awsRestjson1_deserializeOpDescribeView struct { +} + +func (*awsRestjson1_deserializeOpDescribeView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeView) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDescribeView(response, &metadata) + } + output := &DescribeViewOutput{} + 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_deserializeOpDocumentDescribeViewOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeView(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_deserializeOpDocumentDescribeViewOutput(v **DescribeViewOutput, 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 *DescribeViewOutput + if *v == nil { + sv = &DescribeViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "View": + if err := awsRestjson1_deserializeDocumentView(&sv.View, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDisconnectParticipant struct { } @@ -1326,6 +1485,42 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R return output } +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} var buff [1024]byte @@ -1972,6 +2167,64 @@ func awsRestjson1_deserializeDocumentReceipts(v *[]types.Receipt, value interfac return nil } +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = types.ResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2216,6 +2469,172 @@ func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationExc return nil } +func awsRestjson1_deserializeDocumentView(v **types.View, 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.View + if *v == nil { + sv = &types.View{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Content": + if err := awsRestjson1_deserializeDocumentViewContent(&sv.Content, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ViewId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ViewName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Version": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ViewVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Version = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentViewActions(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ViewAction to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentViewContent(v **types.ViewContent, 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.ViewContent + if *v == nil { + sv = &types.ViewContent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Actions": + if err := awsRestjson1_deserializeDocumentViewActions(&sv.Actions, value); err != nil { + return err + } + + case "InputSchema": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ViewInputSchema to be of type string, got %T instead", value) + } + sv.InputSchema = ptr.String(jtv) + } + + case "Template": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ViewTemplate to be of type string, got %T instead", value) + } + sv.Template = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentWebsocket(v **types.Websocket, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connectparticipant/endpoints_test.go b/service/connectparticipant/endpoints_test.go index 9ea04496933..238aec009ad 100644 --- a/service/connectparticipant/endpoints_test.go +++ b/service/connectparticipant/endpoints_test.go @@ -17,9 +17,9 @@ import ( // For region us-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -56,9 +56,9 @@ func TestEndpointCase0(t *testing.T) { // For region us-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -95,9 +95,9 @@ func TestEndpointCase1(t *testing.T) { // For region us-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -134,9 +134,9 @@ func TestEndpointCase2(t *testing.T) { // For region us-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -173,9 +173,9 @@ func TestEndpointCase3(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack enabled func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -212,9 +212,9 @@ func TestEndpointCase4(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack disabled func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -251,9 +251,9 @@ func TestEndpointCase5(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack enabled func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -290,9 +290,9 @@ func TestEndpointCase6(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack disabled func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("cn-north-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -329,9 +329,9 @@ func TestEndpointCase7(t *testing.T) { // For region us-gov-west-1 with FIPS disabled and DualStack disabled func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -368,9 +368,9 @@ func TestEndpointCase8(t *testing.T) { // For region us-gov-west-1 with FIPS enabled and DualStack disabled func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -407,9 +407,9 @@ func TestEndpointCase9(t *testing.T) { // For region us-gov-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -446,9 +446,9 @@ func TestEndpointCase10(t *testing.T) { // For region us-gov-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -485,9 +485,9 @@ func TestEndpointCase11(t *testing.T) { // For region us-gov-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -524,9 +524,9 @@ func TestEndpointCase12(t *testing.T) { // For region us-gov-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -563,9 +563,9 @@ func TestEndpointCase13(t *testing.T) { // For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -583,9 +583,9 @@ func TestEndpointCase14(t *testing.T) { // For region us-iso-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -622,9 +622,9 @@ func TestEndpointCase15(t *testing.T) { // For region us-iso-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -642,9 +642,9 @@ func TestEndpointCase16(t *testing.T) { // For region us-iso-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -681,9 +681,9 @@ func TestEndpointCase17(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -701,9 +701,9 @@ func TestEndpointCase18(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -740,9 +740,9 @@ func TestEndpointCase19(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -760,9 +760,9 @@ func TestEndpointCase20(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -799,9 +799,9 @@ func TestEndpointCase21(t *testing.T) { // For custom endpoint with region set and fips disabled and dualstack disabled func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -839,8 +839,8 @@ func TestEndpointCase22(t *testing.T) { // For custom endpoint with region not set and fips disabled and dualstack disabled func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -878,9 +878,9 @@ func TestEndpointCase23(t *testing.T) { // For custom endpoint with fips enabled and dualstack disabled func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -899,9 +899,9 @@ func TestEndpointCase24(t *testing.T) { // For custom endpoint with fips disabled and dualstack enabled func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(true), Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } diff --git a/service/connectparticipant/generated.json b/service/connectparticipant/generated.json index 3c8b56d5aae..6bbb17b19ca 100644 --- a/service/connectparticipant/generated.json +++ b/service/connectparticipant/generated.json @@ -11,6 +11,7 @@ "api_client_test.go", "api_op_CompleteAttachmentUpload.go", "api_op_CreateParticipantConnection.go", + "api_op_DescribeView.go", "api_op_DisconnectParticipant.go", "api_op_GetAttachment.go", "api_op_GetTranscript.go", diff --git a/service/connectparticipant/serializers.go b/service/connectparticipant/serializers.go index d515d9b0f52..fb730c17172 100644 --- a/service/connectparticipant/serializers.go +++ b/service/connectparticipant/serializers.go @@ -196,6 +196,76 @@ func awsRestjson1_serializeOpDocumentCreateParticipantConnectionInput(v *CreateP return nil } +type awsRestjson1_serializeOpDescribeView struct { +} + +func (*awsRestjson1_serializeOpDescribeView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeView) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/participant/views/{ViewToken}") + 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_serializeOpHttpBindingsDescribeViewInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribeViewInput(v *DescribeViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectionToken != nil && len(*v.ConnectionToken) > 0 { + locationName := "X-Amz-Bearer" + encoder.SetHeader(locationName).String(*v.ConnectionToken) + } + + if v.ViewToken == nil || len(*v.ViewToken) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ViewToken must not be empty")} + } + if v.ViewToken != nil { + if err := encoder.SetURI("ViewToken").String(*v.ViewToken); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDisconnectParticipant struct { } diff --git a/service/connectparticipant/types/enums.go b/service/connectparticipant/types/enums.go index b7cfead0a02..18ff5103be3 100644 --- a/service/connectparticipant/types/enums.go +++ b/service/connectparticipant/types/enums.go @@ -82,9 +82,10 @@ type ParticipantRole string // Enum values for ParticipantRole const ( - ParticipantRoleAgent ParticipantRole = "AGENT" - ParticipantRoleCustomer ParticipantRole = "CUSTOMER" - ParticipantRoleSystem ParticipantRole = "SYSTEM" + ParticipantRoleAgent ParticipantRole = "AGENT" + ParticipantRoleCustomer ParticipantRole = "CUSTOMER" + ParticipantRoleSystem ParticipantRole = "SYSTEM" + ParticipantRoleCustomBot ParticipantRole = "CUSTOM_BOT" ) // Values returns all known values for ParticipantRole. Note that this can be @@ -95,6 +96,35 @@ func (ParticipantRole) Values() []ParticipantRole { "AGENT", "CUSTOMER", "SYSTEM", + "CUSTOM_BOT", + } +} + +type ResourceType string + +// Enum values for ResourceType +const ( + ResourceTypeContact ResourceType = "CONTACT" + ResourceTypeContactFlow ResourceType = "CONTACT_FLOW" + ResourceTypeInstance ResourceType = "INSTANCE" + ResourceTypeParticipant ResourceType = "PARTICIPANT" + ResourceTypeHierarchyLevel ResourceType = "HIERARCHY_LEVEL" + ResourceTypeHierarchyGroup ResourceType = "HIERARCHY_GROUP" + ResourceTypeUser ResourceType = "USER" +) + +// Values returns all known values for ResourceType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ResourceType) Values() []ResourceType { + return []ResourceType{ + "CONTACT", + "CONTACT_FLOW", + "INSTANCE", + "PARTICIPANT", + "HIERARCHY_LEVEL", + "HIERARCHY_GROUP", + "USER", } } diff --git a/service/connectparticipant/types/errors.go b/service/connectparticipant/types/errors.go index 2f1b381d4ad..fa6fa816df8 100644 --- a/service/connectparticipant/types/errors.go +++ b/service/connectparticipant/types/errors.go @@ -86,6 +86,35 @@ func (e *InternalServerException) ErrorCode() string { } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The resource was not found. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType ResourceType + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The number of attachments per contact exceeds the quota. type ServiceQuotaExceededException struct { Message *string diff --git a/service/connectparticipant/types/types.go b/service/connectparticipant/types/types.go index 28b2eb21035..4b441061245 100644 --- a/service/connectparticipant/types/types.go +++ b/service/connectparticipant/types/types.go @@ -150,6 +150,46 @@ type UploadMetadata struct { noSmithyDocumentSerde } +// A view resource object. Contains metadata and content necessary to render the +// view. +type View struct { + + // The Amazon Resource Name (ARN) of the view. + Arn *string + + // View content containing all content necessary to render a view except for + // runtime input data. + Content *ViewContent + + // The identifier of the view. + Id *string + + // The name of the view. + Name *string + + // The current version of the view. + Version *int32 + + noSmithyDocumentSerde +} + +// View content containing all content necessary to render a view except for +// runtime input data. +type ViewContent struct { + + // A list of actions possible from the view + Actions []string + + // The schema representing the input data that the view template must be supplied + // to render. + InputSchema *string + + // The view template representing the structure of the view. + Template *string + + noSmithyDocumentSerde +} + // The websocket for the participant's connection. type Websocket struct { diff --git a/service/connectparticipant/validators.go b/service/connectparticipant/validators.go index 922c0454ef4..b6ccd07f487 100644 --- a/service/connectparticipant/validators.go +++ b/service/connectparticipant/validators.go @@ -49,6 +49,26 @@ func (m *validateOpCreateParticipantConnection) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpDescribeView struct { +} + +func (*validateOpDescribeView) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeViewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeViewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisconnectParticipant struct { } @@ -177,6 +197,10 @@ func addOpCreateParticipantConnectionValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpCreateParticipantConnection{}, middleware.After) } +func addOpDescribeViewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeView{}, middleware.After) +} + func addOpDisconnectParticipantValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisconnectParticipant{}, middleware.After) } @@ -237,6 +261,24 @@ func validateOpCreateParticipantConnectionInput(v *CreateParticipantConnectionIn } } +func validateOpDescribeViewInput(v *DescribeViewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeViewInput"} + if v.ViewToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ViewToken")) + } + if v.ConnectionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisconnectParticipantInput(v *DisconnectParticipantInput) error { if v == nil { return nil diff --git a/service/customerprofiles/deserializers.go b/service/customerprofiles/deserializers.go index 38bad4af93e..0e133880806 100644 --- a/service/customerprofiles/deserializers.go +++ b/service/customerprofiles/deserializers.go @@ -4411,7 +4411,7 @@ func awsRestjson1_deserializeOpDocumentGetProfileObjectTypeOutput(v **GetProfile if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected text to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveText to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } @@ -8272,7 +8272,7 @@ func awsRestjson1_deserializeOpDocumentPutProfileObjectTypeOutput(v **PutProfile if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected text to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveText to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } @@ -12798,7 +12798,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.AccountNumber = ptr.String(jtv) } @@ -12807,7 +12807,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To1000 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To1000 to be of type string, got %T instead", value) } sv.AdditionalInformation = ptr.String(jtv) } @@ -12831,7 +12831,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.BirthDate = ptr.String(jtv) } @@ -12840,7 +12840,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.BusinessEmailAddress = ptr.String(jtv) } @@ -12849,7 +12849,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.BusinessName = ptr.String(jtv) } @@ -12858,7 +12858,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.BusinessPhoneNumber = ptr.String(jtv) } @@ -12867,7 +12867,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.EmailAddress = ptr.String(jtv) } @@ -12876,7 +12876,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.FirstName = ptr.String(jtv) } @@ -12899,7 +12899,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.GenderString = ptr.String(jtv) } @@ -12908,7 +12908,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.HomePhoneNumber = ptr.String(jtv) } @@ -12917,7 +12917,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.LastName = ptr.String(jtv) } @@ -12931,7 +12931,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.MiddleName = ptr.String(jtv) } @@ -12940,7 +12940,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.MobilePhoneNumber = ptr.String(jtv) } @@ -12958,7 +12958,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.PartyTypeString = ptr.String(jtv) } @@ -12967,7 +12967,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.PersonalEmailAddress = ptr.String(jtv) } @@ -12976,7 +12976,7 @@ func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveString1To255 to be of type string, got %T instead", value) } sv.PhoneNumber = ptr.String(jtv) } diff --git a/service/ecs/api_op_PutAccountSetting.go b/service/ecs/api_op_PutAccountSetting.go index 8394804edd2..67f1bbfe883 100644 --- a/service/ecs/api_op_PutAccountSetting.go +++ b/service/ecs/api_op_PutAccountSetting.go @@ -20,21 +20,21 @@ import ( // you change the root user account setting, the default settings are reset for // users and roles that do not have specified individual account settings. For more // information, see Account Settings (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html) -// in the Amazon Elastic Container Service Developer Guide. When -// serviceLongArnFormat , taskLongArnFormat , or containerInstanceLongArnFormat -// are specified, the Amazon Resource Name (ARN) and resource ID format of the -// resource type for a specified user, role, or the root user for an account is -// affected. The opt-in and opt-out account setting must be set for each Amazon ECS -// resource separately. The ARN and resource ID format of a resource is defined by -// the opt-in status of the user or role that created the resource. You must turn -// on this setting to use Amazon ECS features such as resource tagging. When -// awsvpcTrunking is specified, the elastic network interface (ENI) limit for any -// new container instances that support the feature is changed. If awsvpcTrunking -// is turned on, any new container instances that support the feature are launched -// have the increased ENI limits available to them. For more information, see -// Elastic Network Interface Trunking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-eni.html) -// in the Amazon Elastic Container Service Developer Guide. When containerInsights -// is specified, the default setting indicating whether Amazon Web Services +// in the Amazon Elastic Container Service Developer Guide. When you specify +// serviceLongArnFormat , taskLongArnFormat , or containerInstanceLongArnFormat , +// the Amazon Resource Name (ARN) and resource ID format of the resource type for a +// specified user, role, or the root user for an account is affected. The opt-in +// and opt-out account setting must be set for each Amazon ECS resource separately. +// The ARN and resource ID format of a resource is defined by the opt-in status of +// the user or role that created the resource. You must turn on this setting to use +// Amazon ECS features such as resource tagging. When you specify awsvpcTrunking , +// the elastic network interface (ENI) limit for any new container instances that +// support the feature is changed. If awsvpcTrunking is turned on, any new +// container instances that support the feature are launched have the increased ENI +// limits available to them. For more information, see Elastic Network Interface +// Trunking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-eni.html) +// in the Amazon Elastic Container Service Developer Guide. When you specify +// containerInsights , the default setting indicating whether Amazon Web Services // CloudWatch Container Insights is turned on for your clusters is changed. If // containerInsights is turned on, any new clusters that are created will have // Container Insights turned on unless you disable it during cluster creation. For @@ -46,6 +46,12 @@ import ( // additional authorization to verify if users or roles have permissions to create // tags. Therefore, you must grant explicit permissions to use the ecs:TagResource // action. For more information, see Grant permission to tag resources on creation (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/supported-iam-actions-tagging.html) +// in the Amazon ECS Developer Guide. When Amazon Web Services determines that a +// security or infrastructure update is needed for an Amazon ECS task hosted on +// Fargate, the tasks need to be stopped and new tasks launched to replace them. +// Use fargateTaskRetirementWaitPeriod to configure the wait time to retire a +// Fargate task. For information about the Fargate tasks maintenance, see Amazon +// Web Services Fargate task maintenance (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-maintenance.html) // in the Amazon ECS Developer Guide. func (c *Client) PutAccountSetting(ctx context.Context, params *PutAccountSettingInput, optFns ...func(*Options)) (*PutAccountSettingOutput, error) { if params == nil { @@ -64,25 +70,34 @@ func (c *Client) PutAccountSetting(ctx context.Context, params *PutAccountSettin type PutAccountSettingInput struct { - // The Amazon ECS resource name for which to modify the account setting. If - // serviceLongArnFormat is specified, the ARN for your Amazon ECS services is - // affected. If taskLongArnFormat is specified, the ARN and resource ID for your - // Amazon ECS tasks is affected. If containerInstanceLongArnFormat is specified, - // the ARN and resource ID for your Amazon ECS container instances is affected. If - // awsvpcTrunking is specified, the elastic network interface (ENI) limit for your - // Amazon ECS container instances is affected. If containerInsights is specified, - // the default setting for Amazon Web Services CloudWatch Container Insights for - // your clusters is affected. If fargateFIPSMode is specified, Fargate FIPS 140 - // compliance is affected. If tagResourceAuthorization is specified, the opt-in - // option for tagging resources on creation is affected. For information about the - // opt-in timeline, see Tagging authorization timeline (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#tag-resources) - // in the Amazon ECS Developer Guide. + // The Amazon ECS resource name for which to modify the account setting. If you + // specify serviceLongArnFormat , the ARN for your Amazon ECS services is affected. + // If you specify taskLongArnFormat , the ARN and resource ID for your Amazon ECS + // tasks is affected. If you specify containerInstanceLongArnFormat , the ARN and + // resource ID for your Amazon ECS container instances is affected. If you specify + // awsvpcTrunking , the elastic network interface (ENI) limit for your Amazon ECS + // container instances is affected. If you specify containerInsights , the default + // setting for Amazon Web Services CloudWatch Container Insights for your clusters + // is affected. If you specify fargateFIPSMode , Fargate FIPS 140 compliance is + // affected. If you specify tagResourceAuthorization , the opt-in option for + // tagging resources on creation is affected. For information about the opt-in + // timeline, see Tagging authorization timeline (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#tag-resources) + // in the Amazon ECS Developer Guide. If you specify + // fargateTaskRetirementWaitPeriod , the wait time to retire a Fargate task is + // affected. // // This member is required. Name types.SettingName // The account setting value for the specified principal ARN. Accepted values are - // enabled , disabled , on , and off . + // enabled , disabled , on , and off . When you specify + // fargateTaskRetirementWaitPeriod for the name , the following are the valid + // values: + // - 0 - immediately retire the tasks and patch Fargate There is no advanced + // notification. Your tasks are retired immediately, and Fargate is patched without + // any notification. + // - 7 -wait 7 calendar days to retire the tasks and patch Fargate + // - 14 - wait 14 calendar days to retire the tasks and patch Fargate // // This member is required. Value *string @@ -91,8 +106,9 @@ type PutAccountSettingInput struct { // specify the root user, it modifies the account setting for all users, roles, and // the root user of the account unless a user or role explicitly overrides these // settings. If this field is omitted, the setting is changed only for the - // authenticated user. Federated users assume the account setting of the root user - // and can't have explicit account settings set for them. + // authenticated user. You must use the root user when you set the Fargate wait + // time ( fargateTaskRetirementWaitPeriod ). Federated users assume the account + // setting of the root user and can't have explicit account settings set for them. PrincipalArn *string noSmithyDocumentSerde diff --git a/service/ecs/api_op_PutAccountSettingDefault.go b/service/ecs/api_op_PutAccountSettingDefault.go index 0dfd7bcc30e..097c78c75d7 100644 --- a/service/ecs/api_op_PutAccountSettingDefault.go +++ b/service/ecs/api_op_PutAccountSettingDefault.go @@ -36,29 +36,44 @@ func (c *Client) PutAccountSettingDefault(ctx context.Context, params *PutAccoun type PutAccountSettingDefaultInput struct { - // The resource name for which to modify the account setting. If - // serviceLongArnFormat is specified, the ARN for your Amazon ECS services is - // affected. If taskLongArnFormat is specified, the ARN and resource ID for your - // Amazon ECS tasks is affected. If containerInstanceLongArnFormat is specified, - // the ARN and resource ID for your Amazon ECS container instances is affected. If - // awsvpcTrunking is specified, the ENI limit for your Amazon ECS container - // instances is affected. If containerInsights is specified, the default setting - // for Amazon Web Services CloudWatch Container Insights for your clusters is - // affected. If tagResourceAuthorization is specified, the opt-in option for - // tagging resources on creation is affected. For information about the opt-in - // timeline, see Tagging authorization timeline (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#tag-resources) - // in the Amazon ECS Developer Guide. When you specify fargateFIPSMode for the name - // and enabled for the value , Fargate uses FIPS-140 compliant cryptographic - // algorithms on your tasks. For more information about FIPS-140 compliance with - // Fargate, see Amazon Web Services Fargate Federal Information Processing - // Standard (FIPS) 140-2 compliance (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-fips-compliance.html) - // in the Amazon Elastic Container Service Developer Guide. + // The resource name for which to modify the account setting. If you specify + // serviceLongArnFormat , the ARN for your Amazon ECS services is affected. If you + // specify taskLongArnFormat , the ARN and resource ID for your Amazon ECS tasks is + // affected. If you specify containerInstanceLongArnFormat , the ARN and resource + // ID for your Amazon ECS container instances is affected. If you specify + // awsvpcTrunking , the ENI limit for your Amazon ECS container instances is + // affected. If you specify containerInsights , the default setting for Amazon Web + // Services CloudWatch Container Insights for your clusters is affected. If you + // specify tagResourceAuthorization , the opt-in option for tagging resources on + // creation is affected. For information about the opt-in timeline, see Tagging + // authorization timeline (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#tag-resources) + // in the Amazon ECS Developer Guide. If you specify + // fargateTaskRetirementWaitPeriod , the default wait time to retire a Fargate task + // due to required maintenance is affected. When you specify fargateFIPSMode for + // the name and enabled for the value , Fargate uses FIPS-140 compliant + // cryptographic algorithms on your tasks. For more information about FIPS-140 + // compliance with Fargate, see Amazon Web Services Fargate Federal Information + // Processing Standard (FIPS) 140-2 compliance (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-fips-compliance.html) + // in the Amazon Elastic Container Service Developer Guide. When Amazon Web + // Services determines that a security or infrastructure update is needed for an + // Amazon ECS task hosted on Fargate, the tasks need to be stopped and new tasks + // launched to replace them. Use fargateTaskRetirementWaitPeriod to set the wait + // time to retire a Fargate task to the default. For information about the Fargate + // tasks maintenance, see Amazon Web Services Fargate task maintenance (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-maintenance.html) + // in the Amazon ECS Developer Guide. // // This member is required. Name types.SettingName // The account setting value for the specified principal ARN. Accepted values are - // enabled , disabled , on , and off . + // enabled , disabled , on , and off . When you specify + // fargateTaskRetirementWaitPeriod for the name , the following are the valid + // values: + // - 0 - immediately retire the tasks and patch Fargate There is no advanced + // notification. Your tasks are retired immediately, and Fargate is patched without + // any notification. + // - 7 -wait 7 calendar days to retire the tasks and patch Fargate + // - 14 - wait 14 calendar days to retire the tasks and patch Fargate // // This member is required. Value *string diff --git a/service/ecs/api_op_RegisterTaskDefinition.go b/service/ecs/api_op_RegisterTaskDefinition.go index ff9f33985e0..57c924dc975 100644 --- a/service/ecs/api_op_RegisterTaskDefinition.go +++ b/service/ecs/api_op_RegisterTaskDefinition.go @@ -192,17 +192,20 @@ type RegisterTaskDefinitionInput struct { NetworkMode types.NetworkMode // The process namespace to use for the containers in the task. The valid values - // are host or task . If host is specified, then all containers within the tasks - // that specified the host PID mode on the same container instance share the same - // process namespace with the host Amazon EC2 instance. If task is specified, all - // containers within the specified task share the same process namespace. If no - // value is specified, the default is a private namespace. For more information, - // see PID settings (https://docs.docker.com/engine/reference/run/#pid-settings---pid) - // in the Docker run reference. If the host PID mode is used, be aware that there - // is a heightened risk of undesired process namespace expose. For more - // information, see Docker security (https://docs.docker.com/engine/security/security/) - // . This parameter is not supported for Windows containers or tasks run on - // Fargate. + // are host or task . On Fargate for Linux containers, the only valid value is task + // . For example, monitoring sidecars might need pidMode to access information + // about other containers running in the same task. If host is specified, all + // containers within the tasks that specified the host PID mode on the same + // container instance share the same process namespace with the host Amazon EC2 + // instance. If task is specified, all containers within the specified task share + // the same process namespace. If no value is specified, the default is a private + // namespace for each container. For more information, see PID settings (https://docs.docker.com/engine/reference/run/#pid-settings---pid) + // in the Docker run reference. If the host PID mode is used, there's a heightened + // risk of undesired process namespace exposure. For more information, see Docker + // security (https://docs.docker.com/engine/security/security/) . This parameter is + // not supported for Windows containers. This parameter is only supported for tasks + // that are hosted on Fargate if the tasks are using platform version 1.4.0 or + // later (Linux). This isn't supported for Windows containers on Fargate. PidMode types.PidMode // An array of placement constraint objects to use for the task. You can specify a diff --git a/service/ecs/types/enums.go b/service/ecs/types/enums.go index 35f7b8c17d9..9746d58968c 100644 --- a/service/ecs/types/enums.go +++ b/service/ecs/types/enums.go @@ -888,13 +888,14 @@ type SettingName string // Enum values for SettingName const ( - SettingNameServiceLongArnFormat SettingName = "serviceLongArnFormat" - SettingNameTaskLongArnFormat SettingName = "taskLongArnFormat" - SettingNameContainerInstanceLongArnFormat SettingName = "containerInstanceLongArnFormat" - SettingNameAwsvpcTrunking SettingName = "awsvpcTrunking" - SettingNameContainerInsights SettingName = "containerInsights" - SettingNameFargateFipsMode SettingName = "fargateFIPSMode" - SettingNameTagResourceAuthorization SettingName = "tagResourceAuthorization" + SettingNameServiceLongArnFormat SettingName = "serviceLongArnFormat" + SettingNameTaskLongArnFormat SettingName = "taskLongArnFormat" + SettingNameContainerInstanceLongArnFormat SettingName = "containerInstanceLongArnFormat" + SettingNameAwsvpcTrunking SettingName = "awsvpcTrunking" + SettingNameContainerInsights SettingName = "containerInsights" + SettingNameFargateFipsMode SettingName = "fargateFIPSMode" + SettingNameTagResourceAuthorization SettingName = "tagResourceAuthorization" + SettingNameFargateTaskRetirementWaitPeriod SettingName = "fargateTaskRetirementWaitPeriod" ) // Values returns all known values for SettingName. Note that this can be expanded @@ -909,6 +910,7 @@ func (SettingName) Values() []SettingName { "containerInsights", "fargateFIPSMode", "tagResourceAuthorization", + "fargateTaskRetirementWaitPeriod", } } diff --git a/service/ecs/types/types.go b/service/ecs/types/types.go index 1e6f28f14e9..2220cf3c176 100644 --- a/service/ecs/types/types.go +++ b/service/ecs/types/types.go @@ -83,7 +83,7 @@ type AutoScalingGroupProvider struct { // This member is required. AutoScalingGroupArn *string - // he managed scaling settings for the Auto Scaling group capacity provider. + // The managed scaling settings for the Auto Scaling group capacity provider. ManagedScaling *ManagedScaling // The managed termination protection setting to use for the Auto Scaling group @@ -997,12 +997,17 @@ type ContainerDefinition struct { // maps to Sysctls in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/) // and the --sysctl option to docker run (https://docs.docker.com/engine/reference/run/#security-configuration) - // . We don't recommended that you specify network-related systemControls - // parameters for multiple containers in a single task that also uses either the - // awsvpc or host network modes. For tasks that use the awsvpc network mode, the - // container that's started last determines which systemControls parameters take - // effect. For tasks that use the host network mode, it changes the container - // instance's namespaced kernel parameters as well as the containers. + // . For example, you can configure net.ipv4.tcp_keepalive_time setting to + // maintain longer lived connections. We don't recommended that you specify + // network-related systemControls parameters for multiple containers in a single + // task that also uses either the awsvpc or host network modes. For tasks that use + // the awsvpc network mode, the container that's started last determines which + // systemControls parameters take effect. For tasks that use the host network + // mode, it changes the container instance's namespaced kernel parameters as well + // as the containers. This parameter is not supported for Windows containers. This + // parameter is only supported for tasks that are hosted on Fargate if the tasks + // are using platform version 1.4.0 or later (Linux). This isn't supported for + // Windows containers on Fargate. SystemControls []SystemControl // A list of ulimits to set in the container. If a ulimit value is specified in a @@ -1164,7 +1169,8 @@ type ContainerInstance struct { // new tasks. RemainingResources []Resource - // The number of tasks on the container instance that are in the RUNNING status. + // The number of tasks on the container instance that have a desired status ( + // desiredStatus ) of RUNNING . RunningTasksCount int32 // The status of the container instance. The valid values are REGISTERING , @@ -3322,7 +3328,11 @@ type SystemControl struct { // The namespaced kernel parameter to set a value for. Namespace *string - // The value for the namespaced kernel parameter that's specified in namespace . + // The namespaced kernel parameter to set a value for. Valid IPC namespace values: + // "kernel.msgmax" | "kernel.msgmnb" | "kernel.msgmni" | "kernel.sem" | + // "kernel.shmall" | "kernel.shmmax" | "kernel.shmmni" | "kernel.shm_rmid_forced" , + // and Sysctls that start with "fs.mqueue.*" Valid network namespace values: + // Sysctls that start with "net.*" All of these values are supported by Fargate. Value *string noSmithyDocumentSerde @@ -3715,17 +3725,20 @@ type TaskDefinition struct { NetworkMode NetworkMode // The process namespace to use for the containers in the task. The valid values - // are host or task . If host is specified, then all containers within the tasks - // that specified the host PID mode on the same container instance share the same - // process namespace with the host Amazon EC2 instance. If task is specified, all - // containers within the specified task share the same process namespace. If no - // value is specified, the default is a private namespace. For more information, - // see PID settings (https://docs.docker.com/engine/reference/run/#pid-settings---pid) - // in the Docker run reference. If the host PID mode is used, be aware that there - // is a heightened risk of undesired process namespace expose. For more - // information, see Docker security (https://docs.docker.com/engine/security/security/) - // . This parameter is not supported for Windows containers or tasks run on - // Fargate. + // are host or task . On Fargate for Linux containers, the only valid value is task + // . For example, monitoring sidecars might need pidMode to access information + // about other containers running in the same task. If host is specified, all + // containers within the tasks that specified the host PID mode on the same + // container instance share the same process namespace with the host Amazon EC2 + // instance. If task is specified, all containers within the specified task share + // the same process namespace. If no value is specified, the default is a private + // namespace for each container. For more information, see PID settings (https://docs.docker.com/engine/reference/run/#pid-settings---pid) + // in the Docker run reference. If the host PID mode is used, there's a heightened + // risk of undesired process namespace exposure. For more information, see Docker + // security (https://docs.docker.com/engine/security/security/) . This parameter is + // not supported for Windows containers. This parameter is only supported for tasks + // that are hosted on Fargate if the tasks are using platform version 1.4.0 or + // later (Linux). This isn't supported for Windows containers on Fargate. PidMode PidMode // An array of placement constraint objects to use for tasks. This parameter isn't diff --git a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go index 42efa21d6ce..173cd3f294b 100644 --- a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go +++ b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go @@ -47,11 +47,6 @@ func (c *Client) DescribeAffectedEntitiesForOrganization(ctx context.Context, pa type DescribeAffectedEntitiesForOrganizationInput struct { - // A JSON set of elements including the awsAccountId and the eventArn . - // - // This member is required. - OrganizationEntityFilters []types.EventAccountFilter - // The locale (language) to return information in. English (en) is the default and // the only supported value at this time. Locale *string @@ -67,6 +62,16 @@ type DescribeAffectedEntitiesForOrganizationInput struct { // contain a pagination token value. NextToken *string + // A JSON set of elements including the awsAccountId , eventArn and a set of + // statusCodes . + OrganizationEntityAccountFilters []types.EntityAccountFilter + + // A JSON set of elements including the awsAccountId and the eventArn . + // + // Deprecated: This property is deprecated, use organizationEntityAccountFilters + // instead. + OrganizationEntityFilters []types.EventAccountFilter + noSmithyDocumentSerde } diff --git a/service/health/api_op_DescribeEntityAggregatesForOrganization.go b/service/health/api_op_DescribeEntityAggregatesForOrganization.go new file mode 100644 index 00000000000..ff5d17fcff7 --- /dev/null +++ b/service/health/api_op_DescribeEntityAggregatesForOrganization.go @@ -0,0 +1,269 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package health + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/health/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of entity aggregates for your Organizations that are affected by +// each of the specified events. +func (c *Client) DescribeEntityAggregatesForOrganization(ctx context.Context, params *DescribeEntityAggregatesForOrganizationInput, optFns ...func(*Options)) (*DescribeEntityAggregatesForOrganizationOutput, error) { + if params == nil { + params = &DescribeEntityAggregatesForOrganizationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeEntityAggregatesForOrganization", params, optFns, c.addOperationDescribeEntityAggregatesForOrganizationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeEntityAggregatesForOrganizationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeEntityAggregatesForOrganizationInput struct { + + // A list of event ARNs (unique identifiers). For example: + // "arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", + // "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101" + // + // This member is required. + EventArns []string + + // A list of 12-digit Amazon Web Services account numbers that contains the + // affected entities. + AwsAccountIds []string + + noSmithyDocumentSerde +} + +type DescribeEntityAggregatesForOrganizationOutput struct { + + // The list of entity aggregates for each of the specified accounts that are + // affected by each of the specified events. + OrganizationEntityAggregates []types.OrganizationEntityAggregate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeEntityAggregatesForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEntityAggregatesForOrganization{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEntityAggregatesForOrganization{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDescribeEntityAggregatesForOrganizationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDescribeEntityAggregatesForOrganizationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEntityAggregatesForOrganization(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeEntityAggregatesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "health", + OperationName: "DescribeEntityAggregatesForOrganization", + } +} + +type opDescribeEntityAggregatesForOrganizationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeEntityAggregatesForOrganizationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeEntityAggregatesForOrganizationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "health" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "health" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("health") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeEntityAggregatesForOrganizationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeEntityAggregatesForOrganizationResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/health/deserializers.go b/service/health/deserializers.go index ab13bd1e39f..bc0729eabcc 100644 --- a/service/health/deserializers.go +++ b/service/health/deserializers.go @@ -467,6 +467,114 @@ func awsAwsjson11_deserializeOpErrorDescribeEntityAggregates(response *smithyhtt } } +type awsAwsjson11_deserializeOpDescribeEntityAggregatesForOrganization struct { +} + +func (*awsAwsjson11_deserializeOpDescribeEntityAggregatesForOrganization) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeEntityAggregatesForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEntityAggregatesForOrganization(response, &metadata) + } + output := &DescribeEntityAggregatesForOrganizationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDescribeEntityAggregatesForOrganizationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribeEntityAggregatesForOrganization(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 { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribeEventAggregates struct { } @@ -1533,6 +1641,98 @@ func awsAwsjson11_deserializeErrorUnsupportedLocale(response *smithyhttp.Respons return output } +func awsAwsjson11_deserializeDocumentAccountEntityAggregate(v **types.AccountEntityAggregate, 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.AccountEntityAggregate + if *v == nil { + sv = &types.AccountEntityAggregate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected eventArn to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "count": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected count to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Count = int32(i64) + } + + case "statuses": + if err := awsAwsjson11_deserializeDocumentEntityStatuses(&sv.Statuses, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAccountEntityAggregatesList(v *[]types.AccountEntityAggregate, 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.AccountEntityAggregate + if *v == nil { + cv = []types.AccountEntityAggregate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountEntityAggregate + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAccountEntityAggregate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentAffectedAccountsList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1929,6 +2129,11 @@ func awsAwsjson11_deserializeDocumentEntityAggregate(v **types.EntityAggregate, sv.EventArn = ptr.String(jtv) } + case "statuses": + if err := awsAwsjson11_deserializeDocumentEntityStatuses(&sv.Statuses, value); err != nil { + return err + } + default: _, _ = key, value @@ -2006,6 +2211,46 @@ func awsAwsjson11_deserializeDocumentEntityList(v *[]types.AffectedEntity, value return nil } +func awsAwsjson11_deserializeDocumentEntityStatuses(v *map[string]int32, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]int32 + if *v == nil { + mv = map[string]int32{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected count to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + parsedVal = int32(i64) + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson11_deserializeDocumentEvent(v **types.Event, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2657,6 +2902,103 @@ func awsAwsjson11_deserializeDocumentOrganizationAffectedEntitiesErrorItem(v **t return nil } +func awsAwsjson11_deserializeDocumentOrganizationEntityAggregate(v **types.OrganizationEntityAggregate, 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.OrganizationEntityAggregate + if *v == nil { + sv = &types.OrganizationEntityAggregate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accounts": + if err := awsAwsjson11_deserializeDocumentAccountEntityAggregatesList(&sv.Accounts, value); err != nil { + return err + } + + case "count": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected count to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Count = int32(i64) + } + + case "eventArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected eventArn to be of type string, got %T instead", value) + } + sv.EventArn = ptr.String(jtv) + } + + case "statuses": + if err := awsAwsjson11_deserializeDocumentEntityStatuses(&sv.Statuses, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOrganizationEntityAggregatesList(v *[]types.OrganizationEntityAggregate, 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.OrganizationEntityAggregate + if *v == nil { + cv = []types.OrganizationEntityAggregate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OrganizationEntityAggregate + destAddr := &col + if err := awsAwsjson11_deserializeDocumentOrganizationEntityAggregate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentOrganizationEvent(v **types.OrganizationEvent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3180,6 +3522,42 @@ func awsAwsjson11_deserializeOpDocumentDescribeAffectedEntitiesOutput(v **Descri return nil } +func awsAwsjson11_deserializeOpDocumentDescribeEntityAggregatesForOrganizationOutput(v **DescribeEntityAggregatesForOrganizationOutput, 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 *DescribeEntityAggregatesForOrganizationOutput + if *v == nil { + sv = &DescribeEntityAggregatesForOrganizationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "organizationEntityAggregates": + if err := awsAwsjson11_deserializeDocumentOrganizationEntityAggregatesList(&sv.OrganizationEntityAggregates, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeEntityAggregatesOutput(v **DescribeEntityAggregatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/health/generated.json b/service/health/generated.json index 712b12c2a2c..1e26dc8d4ed 100644 --- a/service/health/generated.json +++ b/service/health/generated.json @@ -13,6 +13,7 @@ "api_op_DescribeAffectedEntities.go", "api_op_DescribeAffectedEntitiesForOrganization.go", "api_op_DescribeEntityAggregates.go", + "api_op_DescribeEntityAggregatesForOrganization.go", "api_op_DescribeEventAggregates.go", "api_op_DescribeEventDetails.go", "api_op_DescribeEventDetailsForOrganization.go", diff --git a/service/health/serializers.go b/service/health/serializers.go index 5a6674b6516..da7c2147e8b 100644 --- a/service/health/serializers.go +++ b/service/health/serializers.go @@ -237,6 +237,61 @@ func (m *awsAwsjson11_serializeOpDescribeEntityAggregates) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeEntityAggregatesForOrganization struct { +} + +func (*awsAwsjson11_serializeOpDescribeEntityAggregatesForOrganization) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeEntityAggregatesForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeEntityAggregatesForOrganizationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSHealth_20160804.DescribeEntityAggregatesForOrganization") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeEntityAggregatesForOrganizationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribeEventAggregates struct { } @@ -768,6 +823,30 @@ func awsAwsjson11_serializeDocumentDateTimeRangeList(v []types.DateTimeRange, va return nil } +func awsAwsjson11_serializeDocumentEntityAccountFilter(v *types.EntityAccountFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsAccountId != nil { + ok := object.Key("awsAccountId") + ok.String(*v.AwsAccountId) + } + + if v.EventArn != nil { + ok := object.Key("eventArn") + ok.String(*v.EventArn) + } + + if v.StatusCodes != nil { + ok := object.Key("statusCodes") + if err := awsAwsjson11_serializeDocumentEntityStatusCodeList(v.StatusCodes, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentEntityArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1070,6 +1149,30 @@ func awsAwsjson11_serializeDocumentEventTypeList2(v []string, value smithyjson.V return nil } +func awsAwsjson11_serializeDocumentOrganizationAccountIdsList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentOrganizationEntityAccountFiltersList(v []types.EntityAccountFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentEntityAccountFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentOrganizationEntityFiltersList(v []types.EventAccountFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1083,6 +1186,17 @@ func awsAwsjson11_serializeDocumentOrganizationEntityFiltersList(v []types.Event return nil } +func awsAwsjson11_serializeDocumentOrganizationEventArnsList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentOrganizationEventDetailFiltersList(v []types.EventAccountFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1270,6 +1384,13 @@ func awsAwsjson11_serializeOpDocumentDescribeAffectedEntitiesForOrganizationInpu ok.String(*v.NextToken) } + if v.OrganizationEntityAccountFilters != nil { + ok := object.Key("organizationEntityAccountFilters") + if err := awsAwsjson11_serializeDocumentOrganizationEntityAccountFiltersList(v.OrganizationEntityAccountFilters, ok); err != nil { + return err + } + } + if v.OrganizationEntityFilters != nil { ok := object.Key("organizationEntityFilters") if err := awsAwsjson11_serializeDocumentOrganizationEntityFiltersList(v.OrganizationEntityFilters, ok); err != nil { @@ -1309,6 +1430,27 @@ func awsAwsjson11_serializeOpDocumentDescribeAffectedEntitiesInput(v *DescribeAf return nil } +func awsAwsjson11_serializeOpDocumentDescribeEntityAggregatesForOrganizationInput(v *DescribeEntityAggregatesForOrganizationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsAccountIds != nil { + ok := object.Key("awsAccountIds") + if err := awsAwsjson11_serializeDocumentOrganizationAccountIdsList(v.AwsAccountIds, ok); err != nil { + return err + } + } + + if v.EventArns != nil { + ok := object.Key("eventArns") + if err := awsAwsjson11_serializeDocumentOrganizationEventArnsList(v.EventArns, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeEntityAggregatesInput(v *DescribeEntityAggregatesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/health/types/enums.go b/service/health/types/enums.go index 39152205057..31bfe79805b 100644 --- a/service/health/types/enums.go +++ b/service/health/types/enums.go @@ -9,6 +9,8 @@ const ( EntityStatusCodeImpaired EntityStatusCode = "IMPAIRED" EntityStatusCodeUnimpaired EntityStatusCode = "UNIMPAIRED" EntityStatusCodeUnknown EntityStatusCode = "UNKNOWN" + EntityStatusCodePending EntityStatusCode = "PENDING" + EntityStatusCodeResolved EntityStatusCode = "RESOLVED" ) // Values returns all known values for EntityStatusCode. Note that this can be @@ -19,6 +21,8 @@ func (EntityStatusCode) Values() []EntityStatusCode { "IMPAIRED", "UNIMPAIRED", "UNKNOWN", + "PENDING", + "RESOLVED", } } diff --git a/service/health/types/types.go b/service/health/types/types.go index 2442ec793d5..cd6dfd4270b 100644 --- a/service/health/types/types.go +++ b/service/health/types/types.go @@ -7,6 +7,23 @@ import ( "time" ) +// The number of entities in an account that are impacted by a specific event +// aggregated by the entity status codes. +type AccountEntityAggregate struct { + + // The 12-digit Amazon Web Services account numbers that contains the affected + // entities. + AccountId *string + + // The number of entities that match the filter criteria for the specified events. + Count int32 + + // The number of affected entities aggregated by the entity status codes. + Statuses map[string]int32 + + noSmithyDocumentSerde +} + // Information about an entity that is affected by a Health event. type AffectedEntity struct { @@ -63,6 +80,28 @@ type DateTimeRange struct { noSmithyDocumentSerde } +// A JSON set of elements including the awsAccountId , eventArn and a set of +// statusCodes . +type EntityAccountFilter struct { + + // The unique identifier for the event. The event ARN has the + // arn:aws:health:event-region::event/SERVICE/EVENT_TYPE_CODE/EVENT_TYPE_PLUS_ID + // format. For example, an event ARN might look like the following: + // arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456 + // + // This member is required. + EventArn *string + + // The 12-digit Amazon Web Services account numbers that contains the affected + // entities. + AwsAccountId *string + + // A list of entity status codes. + StatusCodes []EntityStatusCode + + noSmithyDocumentSerde +} + // The number of entities that are affected by one or more events. Returned by the // DescribeEntityAggregates (https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeEntityAggregates.html) // operation. @@ -77,6 +116,9 @@ type EntityAggregate struct { // arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456 EventArn *string + // The number of affected entities aggregated by the entity status codes. + Statuses map[string]int32 + noSmithyDocumentSerde } @@ -388,6 +430,31 @@ type OrganizationAffectedEntitiesErrorItem struct { noSmithyDocumentSerde } +// The aggregate results of entities affected by the specified event in your +// organization. The results are aggregated by the entity status codes for the +// specified set of accountsIDs. +type OrganizationEntityAggregate struct { + + // A list of entity aggregates for each of the specified accounts in your + // organization that are affected by a specific event. If there are no + // awsAccountIds provided in the request, this field will be empty in the response. + Accounts []AccountEntityAggregate + + // The number of entities for the organization that match the filter criteria for + // the specified events. + Count int32 + + // A list of event ARNs (unique identifiers). For example: + // "arn:aws:health:us-east-1::event/EC2/EC2_INSTANCE_RETIREMENT_SCHEDULED/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-CDE456", + // "arn:aws:health:us-west-1::event/EBS/AWS_EBS_LOST_VOLUME/AWS_EBS_LOST_VOLUME_CHI789_JKL101" + EventArn *string + + // The number of affected entities aggregated by the entitiy status codes. + Statuses map[string]int32 + + noSmithyDocumentSerde +} + // Summary information about an event, returned by the // DescribeEventsForOrganization (https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeEventsForOrganization.html) // operation. diff --git a/service/health/validators.go b/service/health/validators.go index cb807aa48e5..5b90873dcfe 100644 --- a/service/health/validators.go +++ b/service/health/validators.go @@ -70,6 +70,26 @@ func (m *validateOpDescribeAffectedEntities) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpDescribeEntityAggregatesForOrganization struct { +} + +func (*validateOpDescribeEntityAggregatesForOrganization) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeEntityAggregatesForOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeEntityAggregatesForOrganizationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeEntityAggregatesForOrganizationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeEventAggregates struct { } @@ -142,6 +162,10 @@ func addOpDescribeAffectedEntitiesValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDescribeAffectedEntities{}, middleware.After) } +func addOpDescribeEntityAggregatesForOrganizationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeEntityAggregatesForOrganization{}, middleware.After) +} + func addOpDescribeEventAggregatesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeEventAggregates{}, middleware.After) } @@ -154,6 +178,21 @@ func addOpDescribeEventDetailsValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpDescribeEventDetails{}, middleware.After) } +func validateEntityAccountFilter(v *types.EntityAccountFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EntityAccountFilter"} + if v.EventArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateEntityFilter(v *types.EntityFilter) error { if v == nil { return nil @@ -184,6 +223,23 @@ func validateEventAccountFilter(v *types.EventAccountFilter) error { } } +func validateOrganizationEntityAccountFiltersList(v []types.EntityAccountFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OrganizationEntityAccountFiltersList"} + for i := range v { + if err := validateEntityAccountFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOrganizationEntityFiltersList(v []types.EventAccountFilter) error { if v == nil { return nil @@ -238,13 +294,16 @@ func validateOpDescribeAffectedEntitiesForOrganizationInput(v *DescribeAffectedE return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeAffectedEntitiesForOrganizationInput"} - if v.OrganizationEntityFilters == nil { - invalidParams.Add(smithy.NewErrParamRequired("OrganizationEntityFilters")) - } else if v.OrganizationEntityFilters != nil { + if v.OrganizationEntityFilters != nil { if err := validateOrganizationEntityFiltersList(v.OrganizationEntityFilters); err != nil { invalidParams.AddNested("OrganizationEntityFilters", err.(smithy.InvalidParamsError)) } } + if v.OrganizationEntityAccountFilters != nil { + if err := validateOrganizationEntityAccountFiltersList(v.OrganizationEntityAccountFilters); err != nil { + invalidParams.AddNested("OrganizationEntityAccountFilters", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -271,6 +330,21 @@ func validateOpDescribeAffectedEntitiesInput(v *DescribeAffectedEntitiesInput) e } } +func validateOpDescribeEntityAggregatesForOrganizationInput(v *DescribeEntityAggregatesForOrganizationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeEntityAggregatesForOrganizationInput"} + if v.EventArns == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventArns")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeEventAggregatesInput(v *DescribeEventAggregatesInput) error { if v == nil { return nil diff --git a/service/ivs/api_op_CreateChannel.go b/service/ivs/api_op_CreateChannel.go index 16f929e7361..22e2dec4ecf 100644 --- a/service/ivs/api_op_CreateChannel.go +++ b/service/ivs/api_op_CreateChannel.go @@ -68,43 +68,8 @@ type CreateChannelInput struct { // Channel type, which determines the allowable resolution and bitrate. If you // exceed the allowable input resolution or bitrate, the stream probably will - // disconnect immediately. Some types generate multiple qualities (renditions) from - // the original input; this automatically gives viewers the best experience for - // their devices and network conditions. Some types provide transcoded video; - // transcoding allows higher playback quality across a range of download speeds. - // Default: STANDARD . Valid values: - // - BASIC : Video is transmuxed: Amazon IVS delivers the original input quality - // to viewers. The viewer’s video-quality choice is limited to the original input. - // Input resolution can be up to 1080p and bitrate can be up to 1.5 Mbps for 480p - // and up to 3.5 Mbps for resolutions between 480p and 1080p. Original audio is - // passed through. - // - STANDARD : Video is transcoded: multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Transcoding allows higher playback quality - // across a range of download speeds. Resolution can be up to 1080p and bitrate can - // be up to 8.5 Mbps. Audio is transcoded only for renditions 360p and below; above - // that, audio is passed through. This is the default when you create a channel. - // - ADVANCED_SD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at SD quality (480p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // - ADVANCED_HD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at HD quality (720p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // Optional transcode presets (available for the ADVANCED types) allow you to - // trade off available download bandwidth and video quality, to optimize the - // viewing experience. There are two presets: - // - Constrained bandwidth delivery uses a lower bitrate for each quality level. - // Use it if you have low download bandwidth and/or simple video content (e.g., - // talking heads) - // - Higher bandwidth delivery uses a higher bitrate for each quality level. Use - // it if you have high download bandwidth and/or complex video content (e.g., - // flashes and quick scene changes). + // disconnect immediately. Default: STANDARD . For details, see Channel Types (https://docs.aws.amazon.com/ivs/latest/LowLatencyAPIReference/channel-types.html) + // . Type types.ChannelType noSmithyDocumentSerde diff --git a/service/ivs/api_op_UpdateChannel.go b/service/ivs/api_op_UpdateChannel.go index a084bcbc7ab..f46cfc6e249 100644 --- a/service/ivs/api_op_UpdateChannel.go +++ b/service/ivs/api_op_UpdateChannel.go @@ -67,43 +67,8 @@ type UpdateChannelInput struct { // Channel type, which determines the allowable resolution and bitrate. If you // exceed the allowable input resolution or bitrate, the stream probably will - // disconnect immediately. Some types generate multiple qualities (renditions) from - // the original input; this automatically gives viewers the best experience for - // their devices and network conditions. Some types provide transcoded video; - // transcoding allows higher playback quality across a range of download speeds. - // Default: STANDARD . Valid values: - // - BASIC : Video is transmuxed: Amazon IVS delivers the original input quality - // to viewers. The viewer’s video-quality choice is limited to the original input. - // Input resolution can be up to 1080p and bitrate can be up to 1.5 Mbps for 480p - // and up to 3.5 Mbps for resolutions between 480p and 1080p. Original audio is - // passed through. - // - STANDARD : Video is transcoded: multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Transcoding allows higher playback quality - // across a range of download speeds. Resolution can be up to 1080p and bitrate can - // be up to 8.5 Mbps. Audio is transcoded only for renditions 360p and below; above - // that, audio is passed through. This is the default when you create a channel. - // - ADVANCED_SD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at SD quality (480p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // - ADVANCED_HD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at HD quality (720p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // Optional transcode presets (available for the ADVANCED types) allow you to - // trade off available download bandwidth and video quality, to optimize the - // viewing experience. There are two presets: - // - Constrained bandwidth delivery uses a lower bitrate for each quality level. - // Use it if you have low download bandwidth and/or simple video content (e.g., - // talking heads) - // - Higher bandwidth delivery uses a higher bitrate for each quality level. Use - // it if you have high download bandwidth and/or complex video content (e.g., - // flashes and quick scene changes). + // disconnect immediately. Default: STANDARD . For details, see Channel Types (https://docs.aws.amazon.com/ivs/latest/LowLatencyAPIReference/channel-types.html) + // . Type types.ChannelType noSmithyDocumentSerde diff --git a/service/ivs/types/types.go b/service/ivs/types/types.go index f6ef6b96ce6..1c5e32a0039 100644 --- a/service/ivs/types/types.go +++ b/service/ivs/types/types.go @@ -136,43 +136,8 @@ type Channel struct { // Channel type, which determines the allowable resolution and bitrate. If you // exceed the allowable input resolution or bitrate, the stream probably will - // disconnect immediately. Some types generate multiple qualities (renditions) from - // the original input; this automatically gives viewers the best experience for - // their devices and network conditions. Some types provide transcoded video; - // transcoding allows higher playback quality across a range of download speeds. - // Default: STANDARD . Valid values: - // - BASIC : Video is transmuxed: Amazon IVS delivers the original input quality - // to viewers. The viewer’s video-quality choice is limited to the original input. - // Input resolution can be up to 1080p and bitrate can be up to 1.5 Mbps for 480p - // and up to 3.5 Mbps for resolutions between 480p and 1080p. Original audio is - // passed through. - // - STANDARD : Video is transcoded: multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Transcoding allows higher playback quality - // across a range of download speeds. Resolution can be up to 1080p and bitrate can - // be up to 8.5 Mbps. Audio is transcoded only for renditions 360p and below; above - // that, audio is passed through. This is the default when you create a channel. - // - ADVANCED_SD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at SD quality (480p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // - ADVANCED_HD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at HD quality (720p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // Optional transcode presets (available for the ADVANCED types) allow you to - // trade off available download bandwidth and video quality, to optimize the - // viewing experience. There are two presets: - // - Constrained bandwidth delivery uses a lower bitrate for each quality level. - // Use it if you have low download bandwidth and/or simple video content (e.g., - // talking heads) - // - Higher bandwidth delivery uses a higher bitrate for each quality level. Use - // it if you have high download bandwidth and/or complex video content (e.g., - // flashes and quick scene changes). + // disconnect immediately. Default: STANDARD . For details, see Channel Types (https://docs.aws.amazon.com/ivs/latest/LowLatencyAPIReference/channel-types.html) + // . Type ChannelType noSmithyDocumentSerde @@ -219,43 +184,8 @@ type ChannelSummary struct { // Channel type, which determines the allowable resolution and bitrate. If you // exceed the allowable input resolution or bitrate, the stream probably will - // disconnect immediately. Some types generate multiple qualities (renditions) from - // the original input; this automatically gives viewers the best experience for - // their devices and network conditions. Some types provide transcoded video; - // transcoding allows higher playback quality across a range of download speeds. - // Default: STANDARD . Valid values: - // - BASIC : Video is transmuxed: Amazon IVS delivers the original input quality - // to viewers. The viewer’s video-quality choice is limited to the original input. - // Input resolution can be up to 1080p and bitrate can be up to 1.5 Mbps for 480p - // and up to 3.5 Mbps for resolutions between 480p and 1080p. Original audio is - // passed through. - // - STANDARD : Video is transcoded: multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Transcoding allows higher playback quality - // across a range of download speeds. Resolution can be up to 1080p and bitrate can - // be up to 8.5 Mbps. Audio is transcoded only for renditions 360p and below; above - // that, audio is passed through. This is the default when you create a channel. - // - ADVANCED_SD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at SD quality (480p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // - ADVANCED_HD : Video is transcoded; multiple qualities are generated from the - // original input, to automatically give viewers the best experience for their - // devices and network conditions. Input resolution can be up to 1080p and bitrate - // can be up to 8.5 Mbps; output is capped at HD quality (720p). You can select an - // optional transcode preset (see below). Audio for all renditions is transcoded, - // and an audio-only rendition is available. - // Optional transcode presets (available for the ADVANCED types) allow you to - // trade off available download bandwidth and video quality, to optimize the - // viewing experience. There are two presets: - // - Constrained bandwidth delivery uses a lower bitrate for each quality level. - // Use it if you have low download bandwidth and/or simple video content (e.g., - // talking heads) - // - Higher bandwidth delivery uses a higher bitrate for each quality level. Use - // it if you have high download bandwidth and/or complex video content (e.g., - // flashes and quick scene changes). + // disconnect immediately. Default: STANDARD . For details, see Channel Types (https://docs.aws.amazon.com/ivs/latest/LowLatencyAPIReference/channel-types.html) + // . Type ChannelType noSmithyDocumentSerde diff --git a/service/kafkaconnect/endpoints_test.go b/service/kafkaconnect/endpoints_test.go index 67f480320dc..eb4b5634699 100644 --- a/service/kafkaconnect/endpoints_test.go +++ b/service/kafkaconnect/endpoints_test.go @@ -18,8 +18,8 @@ import ( func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -57,8 +57,8 @@ func TestEndpointCase0(t *testing.T) { func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-northeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -96,8 +96,8 @@ func TestEndpointCase1(t *testing.T) { func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-south-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -135,8 +135,8 @@ func TestEndpointCase2(t *testing.T) { func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -174,8 +174,8 @@ func TestEndpointCase3(t *testing.T) { func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ap-southeast-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -213,8 +213,8 @@ func TestEndpointCase4(t *testing.T) { func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("ca-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -252,8 +252,8 @@ func TestEndpointCase5(t *testing.T) { func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-central-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -291,8 +291,8 @@ func TestEndpointCase6(t *testing.T) { func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -330,8 +330,8 @@ func TestEndpointCase7(t *testing.T) { func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -369,8 +369,8 @@ func TestEndpointCase8(t *testing.T) { func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -408,8 +408,8 @@ func TestEndpointCase9(t *testing.T) { func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("eu-west-3"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -447,8 +447,8 @@ func TestEndpointCase10(t *testing.T) { func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("sa-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -486,8 +486,8 @@ func TestEndpointCase11(t *testing.T) { func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -525,8 +525,8 @@ func TestEndpointCase12(t *testing.T) { func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -564,8 +564,8 @@ func TestEndpointCase13(t *testing.T) { func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -603,8 +603,8 @@ func TestEndpointCase14(t *testing.T) { func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-west-2"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -642,8 +642,8 @@ func TestEndpointCase15(t *testing.T) { func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -681,8 +681,8 @@ func TestEndpointCase16(t *testing.T) { func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -720,8 +720,8 @@ func TestEndpointCase17(t *testing.T) { func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -759,8 +759,8 @@ func TestEndpointCase18(t *testing.T) { func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -798,8 +798,8 @@ func TestEndpointCase19(t *testing.T) { func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -837,8 +837,8 @@ func TestEndpointCase20(t *testing.T) { func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -876,8 +876,8 @@ func TestEndpointCase21(t *testing.T) { func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -915,8 +915,8 @@ func TestEndpointCase22(t *testing.T) { func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -954,8 +954,8 @@ func TestEndpointCase23(t *testing.T) { func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -993,8 +993,8 @@ func TestEndpointCase24(t *testing.T) { func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1032,8 +1032,8 @@ func TestEndpointCase25(t *testing.T) { func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1067,12 +1067,32 @@ func TestEndpointCase26(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack disabled +// For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase28(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1106,12 +1126,32 @@ func TestEndpointCase27(t *testing.T) { } } +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase29(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase28(t *testing.T) { +func TestEndpointCase30(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1145,12 +1185,32 @@ func TestEndpointCase28(t *testing.T) { } } +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase31(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase29(t *testing.T) { +func TestEndpointCase32(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1184,12 +1244,32 @@ func TestEndpointCase29(t *testing.T) { } } +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase33(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase30(t *testing.T) { +func TestEndpointCase34(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -1224,11 +1304,11 @@ func TestEndpointCase30(t *testing.T) { } // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase31(t *testing.T) { +func TestEndpointCase35(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1264,10 +1344,10 @@ func TestEndpointCase31(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase32(t *testing.T) { +func TestEndpointCase36(t *testing.T) { var params = EndpointParameters{ - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1303,11 +1383,11 @@ func TestEndpointCase32(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase33(t *testing.T) { +func TestEndpointCase37(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1324,11 +1404,11 @@ func TestEndpointCase33(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase34(t *testing.T) { +func TestEndpointCase38(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -1343,3 +1423,19 @@ func TestEndpointCase34(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase39(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go b/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go index 9101ec8c64f..2d17e845314 100644 --- a/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go +++ b/service/licensemanagerusersubscriptions/internal/endpoints/endpoints.go @@ -163,6 +163,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, @@ -220,6 +223,9 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, diff --git a/service/paymentcryptographydata/api_op_EncryptData.go b/service/paymentcryptographydata/api_op_EncryptData.go index 51aeb10c63f..47d9262bc4c 100644 --- a/service/paymentcryptographydata/api_op_EncryptData.go +++ b/service/paymentcryptographydata/api_op_EncryptData.go @@ -96,8 +96,6 @@ type EncryptDataOutput struct { // standard algorithms, typically by encrypting 8 or 16 bytes or "00" or "01" and // then truncating the result to the first 3 bytes, or 6 hex digits, of the // resulting cryptogram. - // - // This member is required. KeyCheckValue *string // Metadata pertaining to the operation's result. diff --git a/service/paymentcryptographydata/endpoints_test.go b/service/paymentcryptographydata/endpoints_test.go index 0dcb190ffa9..ad2f28cd2e2 100644 --- a/service/paymentcryptographydata/endpoints_test.go +++ b/service/paymentcryptographydata/endpoints_test.go @@ -14,11 +14,11 @@ import ( "testing" ) -// For region us-gov-east-1 with FIPS enabled and DualStack enabled +// 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(true), - Region: ptr.String("us-gov-east-1"), UseDualStack: ptr.Bool(true), } @@ -30,7 +30,7 @@ func TestEndpointCase0(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -53,11 +53,11 @@ func TestEndpointCase0(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack disabled +// 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(true), - Region: ptr.String("us-gov-east-1"), UseDualStack: ptr.Bool(false), } @@ -69,7 +69,7 @@ func TestEndpointCase1(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -92,11 +92,11 @@ func TestEndpointCase1(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack enabled +// 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(false), - Region: ptr.String("us-gov-east-1"), UseDualStack: ptr.Bool(true), } @@ -108,7 +108,7 @@ func TestEndpointCase2(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://dataplane.payment-cryptography.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -131,11 +131,11 @@ func TestEndpointCase2(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack disabled +// 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(false), - Region: ptr.String("us-gov-east-1"), UseDualStack: ptr.Bool(false), } @@ -147,7 +147,7 @@ func TestEndpointCase3(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://dataplane.payment-cryptography.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -173,8 +173,8 @@ func TestEndpointCase3(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack enabled func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -212,8 +212,8 @@ func TestEndpointCase4(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack disabled func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -251,8 +251,8 @@ func TestEndpointCase5(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack enabled func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -290,8 +290,8 @@ func TestEndpointCase6(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack disabled func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -326,11 +326,11 @@ func TestEndpointCase7(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack enabled +// For region us-gov-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), - Region: ptr.String("us-iso-east-1"), UseDualStack: ptr.Bool(true), } @@ -338,31 +338,11 @@ func TestEndpointCase8(t *testing.T) { result, err := resolver.ResolveEndpoint(context.Background(), params) _, _ = result, err - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase9(t *testing.T) { - var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), - Region: ptr.String("us-iso-east-1"), - 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://dataplane.payment-cryptography-fips.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -385,31 +365,11 @@ func TestEndpointCase9(t *testing.T) { } } -// For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase10(t *testing.T) { - var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), - Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase11(t *testing.T) { +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), - Region: ptr.String("us-iso-east-1"), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -421,7 +381,7 @@ func TestEndpointCase11(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -444,11 +404,11 @@ func TestEndpointCase11(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase12(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), - Region: ptr.String("us-east-1"), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -460,7 +420,7 @@ func TestEndpointCase12(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-east-1.api.aws") + uri, _ := url.Parse("https://dataplane.payment-cryptography.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -483,11 +443,11 @@ func TestEndpointCase12(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase13(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), - Region: ptr.String("us-east-1"), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -499,7 +459,7 @@ func TestEndpointCase13(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://dataplane.payment-cryptography.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -522,11 +482,11 @@ func TestEndpointCase13(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase14(t *testing.T) { +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), - Region: ptr.String("us-east-1"), + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -534,11 +494,31 @@ func TestEndpointCase14(t *testing.T) { result, err := resolver.ResolveEndpoint(context.Background(), params) _, _ = result, err + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + if err != nil { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography.us-east-1.api.aws") + uri, _ := url.Parse("https://dataplane.payment-cryptography-fips.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -561,11 +541,31 @@ func TestEndpointCase14(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack disabled +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-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 error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), - Region: ptr.String("us-east-1"), UseDualStack: ptr.Bool(false), } @@ -577,7 +577,7 @@ func TestEndpointCase15(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://dataplane.payment-cryptography.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://dataplane.payment-cryptography.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -603,8 +603,8 @@ func TestEndpointCase15(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -623,8 +623,8 @@ func TestEndpointCase16(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -662,8 +662,8 @@ func TestEndpointCase17(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -682,8 +682,8 @@ func TestEndpointCase18(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -718,11 +718,11 @@ func TestEndpointCase19(t *testing.T) { } } -// For custom endpoint with fips disabled and dualstack disabled +// For custom endpoint with region set and fips disabled and dualstack disabled func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -758,11 +758,50 @@ func TestEndpointCase20(t *testing.T) { } } -// For custom endpoint with fips enabled and dualstack disabled +// For custom endpoint with region not set and fips disabled and dualstack disabled func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with fips enabled and dualstack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -780,10 +819,10 @@ func TestEndpointCase21(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase22(t *testing.T) { +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -799,3 +838,19 @@ func TestEndpointCase22(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/sagemakerruntime/api_client.go b/service/sagemakerruntime/api_client.go index b144239229e..ae74e0df859 100644 --- a/service/sagemakerruntime/api_client.go +++ b/service/sagemakerruntime/api_client.go @@ -197,6 +197,8 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf fn(&options) } + setSafeEventStreamClientLogMode(&options, opID) + finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) diff --git a/service/sagemakerruntime/api_op_InvokeEndpoint.go b/service/sagemakerruntime/api_op_InvokeEndpoint.go index 3997492ebd2..bb98e4da9c0 100644 --- a/service/sagemakerruntime/api_op_InvokeEndpoint.go +++ b/service/sagemakerruntime/api_op_InvokeEndpoint.go @@ -65,7 +65,7 @@ type InvokeEndpointInput struct { // This member is required. EndpointName *string - // The desired MIME type of the inference in the response. + // The desired MIME type of the inference response from the model container. Accept *string // The MIME type of the input data in the request body. @@ -77,14 +77,14 @@ type InvokeEndpointInput struct { // ID that you can use to track a request or to provide other metadata that a // service endpoint was programmed to process. The value must consist of no more // than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field - // Value Components (https://tools.ietf.org/html/rfc7230#section-3.2.6) of the - // Hypertext Transfer Protocol (HTTP/1.1). The code in your model is responsible - // for setting or updating any custom attributes in the response. If your code does - // not set this value in the response, an empty value is returned. For example, if - // a custom attribute represents the trace ID, your model can prepend the custom - // attribute with Trace ID: in your post-processing function. This feature is - // currently supported in the Amazon Web Services SDKs but not in the Amazon - // SageMaker Python SDK. + // Value Components (https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6) + // of the Hypertext Transfer Protocol (HTTP/1.1). The code in your model is + // responsible for setting or updating any custom attributes in the response. If + // your code does not set this value in the response, an empty value is returned. + // For example, if a custom attribute represents the trace ID, your model can + // prepend the custom attribute with Trace ID: in your post-processing function. + // This feature is currently supported in the Amazon Web Services SDKs but not in + // the Amazon SageMaker Python SDK. CustomAttributes *string // An optional JMESPath expression used to override the EnableExplanations @@ -126,7 +126,7 @@ type InvokeEndpointOutput struct { // This member is required. Body []byte - // The MIME type of the inference returned in the response body. + // The MIME type of the inference returned from the model container. ContentType *string // Provides additional information in the response about the inference returned by diff --git a/service/sagemakerruntime/api_op_InvokeEndpointAsync.go b/service/sagemakerruntime/api_op_InvokeEndpointAsync.go index d8b1e3a3e07..adc24a8974b 100644 --- a/service/sagemakerruntime/api_op_InvokeEndpointAsync.go +++ b/service/sagemakerruntime/api_op_InvokeEndpointAsync.go @@ -47,7 +47,7 @@ func (c *Client) InvokeEndpointAsync(ctx context.Context, params *InvokeEndpoint type InvokeEndpointAsyncInput struct { // The name of the endpoint that you specified when you created the endpoint using - // the CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html) + // the CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html) // API. // // This member is required. @@ -58,7 +58,7 @@ type InvokeEndpointAsyncInput struct { // This member is required. InputLocation *string - // The desired MIME type of the inference in the response. + // The desired MIME type of the inference response from the model container. Accept *string // The MIME type of the input data in the request body. @@ -75,7 +75,7 @@ type InvokeEndpointAsyncInput struct { // responsible for setting or updating any custom attributes in the response. If // your code does not set this value in the response, an empty value is returned. // For example, if a custom attribute represents the trace ID, your model can - // prepend the custom attribute with Trace ID : in your post-processing function. + // prepend the custom attribute with Trace ID: in your post-processing function. // This feature is currently supported in the Amazon Web Services SDKs but not in // the Amazon SageMaker Python SDK. CustomAttributes *string diff --git a/service/sagemakerruntime/api_op_InvokeEndpointWithResponseStream.go b/service/sagemakerruntime/api_op_InvokeEndpointWithResponseStream.go new file mode 100644 index 00000000000..a9f4c4aa12f --- /dev/null +++ b/service/sagemakerruntime/api_op_InvokeEndpointWithResponseStream.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakerruntime + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/sagemakerruntime/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithysync "github.com/aws/smithy-go/sync" + smithyhttp "github.com/aws/smithy-go/transport/http" + "sync" +) + +// Invokes a model at the specified endpoint to return the inference response as a +// stream. The inference stream provides the response payload incrementally as a +// series of parts. Before you can get an inference stream, you must have access to +// a model that's deployed using Amazon SageMaker hosting services, and the +// container for that model must support inference streaming. For more information +// that can help you use this API, see the following sections in the Amazon +// SageMaker Developer Guide: +// - For information about how to add streaming support to a model, see How +// Containers Serve Requests (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-code-how-containe-serves-requests) +// . +// - For information about how to process the streaming response, see Invoke +// real-time endpoints (https://docs.aws.amazon.com/sagemaker/latest/dg/realtime-endpoints-test-endpoints.html) +// . +// +// Amazon SageMaker strips all POST headers except those supported by the API. +// Amazon SageMaker might add additional headers. You should not rely on the +// behavior of headers outside those enumerated in the request syntax. Calls to +// InvokeEndpointWithResponseStream are authenticated by using Amazon Web Services +// Signature Version 4. For information, see Authenticating Requests (Amazon Web +// Services Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) +// in the Amazon S3 API Reference. +func (c *Client) InvokeEndpointWithResponseStream(ctx context.Context, params *InvokeEndpointWithResponseStreamInput, optFns ...func(*Options)) (*InvokeEndpointWithResponseStreamOutput, error) { + if params == nil { + params = &InvokeEndpointWithResponseStreamInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "InvokeEndpointWithResponseStream", params, optFns, c.addOperationInvokeEndpointWithResponseStreamMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*InvokeEndpointWithResponseStreamOutput) + out.ResultMetadata = metadata + return out, nil +} + +type InvokeEndpointWithResponseStreamInput struct { + + // Provides input data, in the format specified in the ContentType request header. + // Amazon SageMaker passes all of the data in the body to the model. For + // information about the format of the request body, see Common Data + // Formats-Inference (https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html) + // . + // + // This member is required. + Body []byte + + // The name of the endpoint that you specified when you created the endpoint using + // the CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html) + // API. + // + // This member is required. + EndpointName *string + + // The desired MIME type of the inference response from the model container. + Accept *string + + // The MIME type of the input data in the request body. + ContentType *string + + // Provides additional information about a request for an inference submitted to a + // model hosted at an Amazon SageMaker endpoint. The information is an opaque value + // that is forwarded verbatim. You could use this value, for example, to provide an + // ID that you can use to track a request or to provide other metadata that a + // service endpoint was programmed to process. The value must consist of no more + // than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field + // Value Components (https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6) + // of the Hypertext Transfer Protocol (HTTP/1.1). The code in your model is + // responsible for setting or updating any custom attributes in the response. If + // your code does not set this value in the response, an empty value is returned. + // For example, if a custom attribute represents the trace ID, your model can + // prepend the custom attribute with Trace ID: in your post-processing function. + // This feature is currently supported in the Amazon Web Services SDKs but not in + // the Amazon SageMaker Python SDK. + CustomAttributes *string + + // An identifier that you assign to your request. + InferenceId *string + + // If the endpoint hosts multiple containers and is configured to use direct + // invocation, this parameter specifies the host name of the container to invoke. + TargetContainerHostname *string + + // Specify the production variant to send the inference request to when invoking + // an endpoint that is running two or more variants. Note that this parameter + // overrides the default behavior for the endpoint, which is to distribute the + // invocation traffic based on the variant weights. For information about how to + // use variant targeting to perform a/b testing, see Test models in production (https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html) + TargetVariant *string + + noSmithyDocumentSerde +} + +type InvokeEndpointWithResponseStreamOutput struct { + + // The MIME type of the inference returned from the model container. + ContentType *string + + // Provides additional information in the response about the inference returned by + // a model hosted at an Amazon SageMaker endpoint. The information is an opaque + // value that is forwarded verbatim. You could use this value, for example, to + // return an ID received in the CustomAttributes header of a request or other + // metadata that a service endpoint was programmed to produce. The value must + // consist of no more than 1024 visible US-ASCII characters as specified in + // Section 3.3.6. Field Value Components (https://tools.ietf.org/html/rfc7230#section-3.2.6) + // of the Hypertext Transfer Protocol (HTTP/1.1). If the customer wants the custom + // attribute returned, the model must set the custom attribute to be included on + // the way back. The code in your model is responsible for setting or updating any + // custom attributes in the response. If your code does not set this value in the + // response, an empty value is returned. For example, if a custom attribute + // represents the trace ID, your model can prepend the custom attribute with Trace + // ID: in your post-processing function. This feature is currently supported in the + // Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK. + CustomAttributes *string + + // Identifies the production variant that was invoked. + InvokedProductionVariant *string + + eventStream *InvokeEndpointWithResponseStreamEventStream + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +// GetStream returns the type to interact with the event stream. +func (o *InvokeEndpointWithResponseStreamOutput) GetStream() *InvokeEndpointWithResponseStreamEventStream { + return o.eventStream +} + +func (c *Client) addOperationInvokeEndpointWithResponseStreamMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpInvokeEndpointWithResponseStream{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInvokeEndpointWithResponseStream{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addEventStreamInvokeEndpointWithResponseStreamMiddleware(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = addInvokeEndpointWithResponseStreamResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpInvokeEndpointWithResponseStreamValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInvokeEndpointWithResponseStream(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opInvokeEndpointWithResponseStream(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "sagemaker", + OperationName: "InvokeEndpointWithResponseStream", + } +} + +// InvokeEndpointWithResponseStreamEventStream provides the event stream handling for the InvokeEndpointWithResponseStream operation. +// +// For testing and mocking the event stream this type should be initialized via +// the NewInvokeEndpointWithResponseStreamEventStream constructor function. Using the functional options +// to pass in nested mock behavior. +type InvokeEndpointWithResponseStreamEventStream struct { + // ResponseStreamReader is the EventStream reader for the ResponseStream events. + // This value is automatically set by the SDK when the API call is made Use this + // member when unit testing your code with the SDK to mock out the EventStream + // Reader. + // + // Must not be nil. + Reader ResponseStreamReader + + done chan struct{} + closeOnce sync.Once + err *smithysync.OnceErr +} + +// NewInvokeEndpointWithResponseStreamEventStream initializes an InvokeEndpointWithResponseStreamEventStream. +// This function should only be used for testing and mocking the InvokeEndpointWithResponseStreamEventStream +// stream within your application. +// +// The Reader member must be set before reading events from the stream. +func NewInvokeEndpointWithResponseStreamEventStream(optFns ...func(*InvokeEndpointWithResponseStreamEventStream)) *InvokeEndpointWithResponseStreamEventStream { + es := &InvokeEndpointWithResponseStreamEventStream{ + done: make(chan struct{}), + err: smithysync.NewOnceErr(), + } + for _, fn := range optFns { + fn(es) + } + return es +} + +// Events returns a channel to read events from. +func (es *InvokeEndpointWithResponseStreamEventStream) Events() <-chan types.ResponseStream { + return es.Reader.Events() +} + +// Close closes the stream. This will also cause the stream to be closed. +// Close must be called when done using the stream API. Not calling Close +// may result in resource leaks. +// +// Will close the underlying EventStream writer and reader, and no more events can be +// sent or received. +func (es *InvokeEndpointWithResponseStreamEventStream) Close() error { + es.closeOnce.Do(es.safeClose) + return es.Err() +} + +func (es *InvokeEndpointWithResponseStreamEventStream) safeClose() { + close(es.done) + + es.Reader.Close() +} + +// Err returns any error that occurred while reading or writing EventStream Events +// from the service API's response. Returns nil if there were no errors. +func (es *InvokeEndpointWithResponseStreamEventStream) Err() error { + if err := es.err.Err(); err != nil { + return err + } + + if err := es.Reader.Err(); err != nil { + return err + } + + return nil +} + +func (es *InvokeEndpointWithResponseStreamEventStream) waitStreamClose() { + type errorSet interface { + ErrorSet() <-chan struct{} + } + + var outputErrCh <-chan struct{} + if v, ok := es.Reader.(errorSet); ok { + outputErrCh = v.ErrorSet() + } + var outputClosedCh <-chan struct{} + if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { + outputClosedCh = v.Closed() + } + + select { + case <-es.done: + case <-outputErrCh: + es.err.SetError(es.Reader.Err()) + es.Close() + + case <-outputClosedCh: + if err := es.Reader.Err(); err != nil { + es.err.SetError(es.Reader.Err()) + } + es.Close() + + } +} + +type opInvokeEndpointWithResponseStreamResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opInvokeEndpointWithResponseStreamResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opInvokeEndpointWithResponseStreamResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "sagemaker" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "sagemaker" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("sagemaker") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addInvokeEndpointWithResponseStreamResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opInvokeEndpointWithResponseStreamResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/sagemakerruntime/deserializers.go b/service/sagemakerruntime/deserializers.go index 4d4bb1e1fed..6bae0bae952 100644 --- a/service/sagemakerruntime/deserializers.go +++ b/service/sagemakerruntime/deserializers.go @@ -7,6 +7,8 @@ import ( "context" "encoding/json" "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream" + "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/sagemakerruntime/types" smithy "github.com/aws/smithy-go" @@ -349,6 +351,378 @@ func awsRestjson1_deserializeOpDocumentInvokeEndpointAsyncOutput(v **InvokeEndpo return nil } +type awsRestjson1_deserializeOpInvokeEndpointWithResponseStream struct { +} + +func (*awsRestjson1_deserializeOpInvokeEndpointWithResponseStream) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpInvokeEndpointWithResponseStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorInvokeEndpointWithResponseStream(response, &metadata) + } + output := &InvokeEndpointWithResponseStreamOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsInvokeEndpointWithResponseStreamOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorInvokeEndpointWithResponseStream(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("InternalFailure", errorCode): + return awsRestjson1_deserializeErrorInternalFailure(response, errorBody) + + case strings.EqualFold("InternalStreamFailure", errorCode): + return awsRestjson1_deserializeErrorInternalStreamFailure(response, errorBody) + + case strings.EqualFold("ModelError", errorCode): + return awsRestjson1_deserializeErrorModelError(response, errorBody) + + case strings.EqualFold("ModelStreamError", errorCode): + return awsRestjson1_deserializeErrorModelStreamError(response, errorBody) + + case strings.EqualFold("ServiceUnavailable", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailable(response, errorBody) + + case strings.EqualFold("ValidationError", errorCode): + return awsRestjson1_deserializeErrorValidationError(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsInvokeEndpointWithResponseStreamOutput(v *InvokeEndpointWithResponseStreamOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("X-Amzn-SageMaker-Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("X-Amzn-SageMaker-Custom-Attributes"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.CustomAttributes = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("x-Amzn-Invoked-Production-Variant"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.InvokedProductionVariant = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeEventStreamResponseStream(v *types.ResponseStream, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader) + if eventType == nil { + return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader) + } + + switch { + case strings.EqualFold("PayloadPart", eventType.String()): + vv := &types.ResponseStreamMemberPayloadPart{} + if err := awsRestjson1_deserializeEventMessagePayloadPart(&vv.Value, msg); err != nil { + return err + } + *v = vv + return nil + + default: + buffer := bytes.NewBuffer(nil) + eventstream.NewEncoder().Encode(buffer, *msg) + *v = &types.UnknownUnionMember{ + Tag: eventType.String(), + Value: buffer.Bytes(), + } + return nil + + } +} + +func awsRestjson1_deserializeEventStreamExceptionResponseStream(msg *eventstream.Message) error { + exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader) + if exceptionType == nil { + return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader) + } + + switch { + case strings.EqualFold("InternalStreamFailure", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionInternalStreamFailure(msg) + + case strings.EqualFold("ModelStreamError", exceptionType.String()): + return awsRestjson1_deserializeEventMessageExceptionModelStreamError(msg) + + default: + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + return err + } + errorCode := "UnknownError" + errorMessage := errorCode + if ev := exceptionType.String(); len(ev) > 0 { + errorCode = ev + } else if ev := code; len(ev) > 0 { + errorCode = ev + } + if ev := message; len(ev) > 0 { + errorMessage = ev + } + return &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + + } +} + +func awsRestjson1_deserializeEventMessagePayloadPart(v *types.PayloadPart, msg *eventstream.Message) error { + if v == nil { + return fmt.Errorf("unexpected serialization of nil %T", v) + } + + if msg.Payload != nil { + bsv := make([]byte, len(msg.Payload)) + copy(bsv, msg.Payload) + + v.Bytes = bsv + } + return nil +} + +func awsRestjson1_deserializeEventMessageExceptionModelStreamError(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.ModelStreamError{} + if err := awsRestjson1_deserializeDocumentModelStreamError(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeEventMessageExceptionInternalStreamFailure(msg *eventstream.Message) error { + br := bytes.NewReader(msg.Payload) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(br, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + v := &types.InternalStreamFailure{} + if err := awsRestjson1_deserializeDocumentInternalStreamFailure(&v, shape); err != nil { + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + } + return v +} + +func awsRestjson1_deserializeDocumentInternalStreamFailure(v **types.InternalStreamFailure, 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.InternalStreamFailure + if *v == nil { + sv = &types.InternalStreamFailure{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentModelStreamError(v **types.ModelStreamError, 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.ModelStreamError + if *v == nil { + sv = &types.ModelStreamError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeErrorInternalDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalDependencyException{} var buff [1024]byte @@ -421,6 +795,42 @@ func awsRestjson1_deserializeErrorInternalFailure(response *smithyhttp.Response, return output } +func awsRestjson1_deserializeErrorInternalStreamFailure(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalStreamFailure{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalStreamFailure(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorModelError(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ModelError{} var buff [1024]byte @@ -493,6 +903,42 @@ func awsRestjson1_deserializeErrorModelNotReadyException(response *smithyhttp.Re return output } +func awsRestjson1_deserializeErrorModelStreamError(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ModelStreamError{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentModelStreamError(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorServiceUnavailable(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailable{} var buff [1024]byte diff --git a/service/sagemakerruntime/endpoints_test.go b/service/sagemakerruntime/endpoints_test.go index 002d9d3e75f..ef997dfd594 100644 --- a/service/sagemakerruntime/endpoints_test.go +++ b/service/sagemakerruntime/endpoints_test.go @@ -17,8 +17,8 @@ import ( // For region af-south-1 with FIPS disabled and DualStack disabled func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("af-south-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -56,8 +56,8 @@ func TestEndpointCase0(t *testing.T) { // For region ap-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -95,8 +95,8 @@ func TestEndpointCase1(t *testing.T) { // For region ap-northeast-1 with FIPS disabled and DualStack disabled func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-northeast-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -134,8 +134,8 @@ func TestEndpointCase2(t *testing.T) { // For region ap-northeast-2 with FIPS disabled and DualStack disabled func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-northeast-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -173,8 +173,8 @@ func TestEndpointCase3(t *testing.T) { // For region ap-northeast-3 with FIPS disabled and DualStack disabled func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-northeast-3"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -212,8 +212,8 @@ func TestEndpointCase4(t *testing.T) { // For region ap-south-1 with FIPS disabled and DualStack disabled func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-south-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -251,8 +251,8 @@ func TestEndpointCase5(t *testing.T) { // For region ap-southeast-1 with FIPS disabled and DualStack disabled func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-southeast-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -290,8 +290,8 @@ func TestEndpointCase6(t *testing.T) { // For region ap-southeast-2 with FIPS disabled and DualStack disabled func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ap-southeast-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -329,8 +329,8 @@ func TestEndpointCase7(t *testing.T) { // For region ca-central-1 with FIPS disabled and DualStack disabled func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("ca-central-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -368,8 +368,8 @@ func TestEndpointCase8(t *testing.T) { // For region eu-central-1 with FIPS disabled and DualStack disabled func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-central-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -407,8 +407,8 @@ func TestEndpointCase9(t *testing.T) { // For region eu-north-1 with FIPS disabled and DualStack disabled func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-north-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -446,8 +446,8 @@ func TestEndpointCase10(t *testing.T) { // For region eu-south-1 with FIPS disabled and DualStack disabled func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-south-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -485,8 +485,8 @@ func TestEndpointCase11(t *testing.T) { // For region eu-west-1 with FIPS disabled and DualStack disabled func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -524,8 +524,8 @@ func TestEndpointCase12(t *testing.T) { // For region eu-west-2 with FIPS disabled and DualStack disabled func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -563,8 +563,8 @@ func TestEndpointCase13(t *testing.T) { // For region eu-west-3 with FIPS disabled and DualStack disabled func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("eu-west-3"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -602,8 +602,8 @@ func TestEndpointCase14(t *testing.T) { // For region me-south-1 with FIPS disabled and DualStack disabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("me-south-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -641,8 +641,8 @@ func TestEndpointCase15(t *testing.T) { // For region sa-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("sa-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -680,8 +680,8 @@ func TestEndpointCase16(t *testing.T) { // For region us-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -719,8 +719,8 @@ func TestEndpointCase17(t *testing.T) { // For region us-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -758,8 +758,8 @@ func TestEndpointCase18(t *testing.T) { // For region us-east-2 with FIPS disabled and DualStack disabled func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -797,8 +797,8 @@ func TestEndpointCase19(t *testing.T) { // For region us-east-2 with FIPS enabled and DualStack disabled func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-east-2"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -836,8 +836,8 @@ func TestEndpointCase20(t *testing.T) { // For region us-west-1 with FIPS disabled and DualStack disabled func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -875,8 +875,8 @@ func TestEndpointCase21(t *testing.T) { // For region us-west-1 with FIPS enabled and DualStack disabled func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -914,8 +914,8 @@ func TestEndpointCase22(t *testing.T) { // For region us-west-2 with FIPS disabled and DualStack disabled func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-west-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -953,8 +953,8 @@ func TestEndpointCase23(t *testing.T) { // For region us-west-2 with FIPS enabled and DualStack disabled func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-west-2"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -992,8 +992,8 @@ func TestEndpointCase24(t *testing.T) { // For region us-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -1031,8 +1031,8 @@ func TestEndpointCase25(t *testing.T) { // For region us-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1070,8 +1070,8 @@ func TestEndpointCase26(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack disabled func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1109,8 +1109,8 @@ func TestEndpointCase27(t *testing.T) { // For region cn-northwest-1 with FIPS disabled and DualStack disabled func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1148,8 +1148,8 @@ func TestEndpointCase28(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack enabled func TestEndpointCase29(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -1187,8 +1187,8 @@ func TestEndpointCase29(t *testing.T) { // For region cn-north-1 with FIPS enabled and DualStack disabled func TestEndpointCase30(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1226,8 +1226,8 @@ func TestEndpointCase30(t *testing.T) { // For region cn-north-1 with FIPS disabled and DualStack enabled func TestEndpointCase31(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1265,8 +1265,8 @@ func TestEndpointCase31(t *testing.T) { // For region us-gov-west-1 with FIPS disabled and DualStack disabled func TestEndpointCase32(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1304,8 +1304,8 @@ func TestEndpointCase32(t *testing.T) { // For region us-gov-west-1 with FIPS enabled and DualStack disabled func TestEndpointCase33(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1343,8 +1343,8 @@ func TestEndpointCase33(t *testing.T) { // For region us-gov-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase34(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -1382,8 +1382,8 @@ func TestEndpointCase34(t *testing.T) { // For region us-gov-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase35(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1421,8 +1421,8 @@ func TestEndpointCase35(t *testing.T) { // For region us-gov-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase36(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1460,8 +1460,8 @@ func TestEndpointCase36(t *testing.T) { // For region us-gov-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase37(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1499,8 +1499,8 @@ func TestEndpointCase37(t *testing.T) { // For region us-iso-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase38(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1538,8 +1538,8 @@ func TestEndpointCase38(t *testing.T) { // For region us-iso-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase39(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -1558,8 +1558,8 @@ func TestEndpointCase39(t *testing.T) { // For region us-iso-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase40(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1597,8 +1597,8 @@ func TestEndpointCase40(t *testing.T) { // For region us-iso-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase41(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1617,8 +1617,8 @@ func TestEndpointCase41(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase42(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -1637,8 +1637,8 @@ func TestEndpointCase42(t *testing.T) { // For region us-isob-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase43(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1676,8 +1676,8 @@ func TestEndpointCase43(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase44(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1696,8 +1696,8 @@ func TestEndpointCase44(t *testing.T) { // For region us-isob-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase45(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1735,8 +1735,8 @@ func TestEndpointCase45(t *testing.T) { // For custom endpoint with region set and fips disabled and dualstack disabled func TestEndpointCase46(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1814,8 +1814,8 @@ func TestEndpointCase47(t *testing.T) { // For custom endpoint with fips enabled and dualstack disabled func TestEndpointCase48(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(true), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -1835,8 +1835,8 @@ func TestEndpointCase48(t *testing.T) { // For custom endpoint with fips disabled and dualstack enabled func TestEndpointCase49(t *testing.T) { var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } diff --git a/service/sagemakerruntime/eventstream.go b/service/sagemakerruntime/eventstream.go new file mode 100644 index 00000000000..90bac69f74a --- /dev/null +++ b/service/sagemakerruntime/eventstream.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakerruntime + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream" + "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi" + "github.com/aws/aws-sdk-go-v2/service/sagemakerruntime/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + smithysync "github.com/aws/smithy-go/sync" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "sync" +) + +// ResponseStreamReader provides the interface for reading events from a stream. +// +// The writer's Close method must allow multiple concurrent calls. +type ResponseStreamReader interface { + Events() <-chan types.ResponseStream + Close() error + Err() error +} + +type responseStreamReader struct { + stream chan types.ResponseStream + decoder *eventstream.Decoder + eventStream io.ReadCloser + err *smithysync.OnceErr + payloadBuf []byte + done chan struct{} + closeOnce sync.Once +} + +func newResponseStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *responseStreamReader { + w := &responseStreamReader{ + stream: make(chan types.ResponseStream), + decoder: decoder, + eventStream: readCloser, + err: smithysync.NewOnceErr(), + done: make(chan struct{}), + payloadBuf: make([]byte, 10*1024), + } + + go w.readEventStream() + + return w +} + +func (r *responseStreamReader) Events() <-chan types.ResponseStream { + return r.stream +} + +func (r *responseStreamReader) readEventStream() { + defer r.Close() + defer close(r.stream) + + for { + r.payloadBuf = r.payloadBuf[0:0] + decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf) + if err != nil { + if err == io.EOF { + return + } + select { + case <-r.done: + return + default: + r.err.SetError(err) + return + } + } + + event, err := r.deserializeEventMessage(&decodedMessage) + if err != nil { + r.err.SetError(err) + return + } + + select { + case r.stream <- event: + case <-r.done: + return + } + + } +} + +func (r *responseStreamReader) deserializeEventMessage(msg *eventstream.Message) (types.ResponseStream, error) { + messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader) + if messageType == nil { + return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader) + } + + switch messageType.String() { + case eventstreamapi.EventMessageType: + var v types.ResponseStream + if err := awsRestjson1_deserializeEventStreamResponseStream(&v, msg); err != nil { + return nil, err + } + return v, nil + + case eventstreamapi.ExceptionMessageType: + return nil, awsRestjson1_deserializeEventStreamExceptionResponseStream(msg) + + case eventstreamapi.ErrorMessageType: + errorCode := "UnknownError" + errorMessage := errorCode + if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil { + errorCode = header.String() + } + if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil { + errorMessage = header.String() + } + return nil, &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + + default: + mc := msg.Clone() + return nil, &UnknownEventMessageError{ + Type: messageType.String(), + Message: &mc, + } + + } +} + +func (r *responseStreamReader) ErrorSet() <-chan struct{} { + return r.err.ErrorSet() +} + +func (r *responseStreamReader) Close() error { + r.closeOnce.Do(r.safeClose) + return r.Err() +} + +func (r *responseStreamReader) safeClose() { + close(r.done) + r.eventStream.Close() + +} + +func (r *responseStreamReader) Err() error { + return r.err.Err() +} + +func (r *responseStreamReader) Closed() <-chan struct{} { + return r.done +} + +type awsRestjson1_deserializeOpEventStreamInvokeEndpointWithResponseStream struct { + LogEventStreamWrites bool + LogEventStreamReads bool +} + +func (*awsRestjson1_deserializeOpEventStreamInvokeEndpointWithResponseStream) ID() string { + return "OperationEventStreamDeserializer" +} + +func (m *awsRestjson1_deserializeOpEventStreamInvokeEndpointWithResponseStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + defer func() { + if err == nil { + return + } + m.closeResponseBody(out) + }() + + logger := middleware.GetLogger(ctx) + + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request) + } + _ = request + + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse) + } + _ = deserializeOutput + + output, ok := out.Result.(*InvokeEndpointWithResponseStreamOutput) + if out.Result != nil && !ok { + return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result) + } else if out.Result == nil { + output = &InvokeEndpointWithResponseStreamOutput{} + out.Result = output + } + + eventReader := newResponseStreamReader( + deserializeOutput.Body, + eventstream.NewDecoder(func(options *eventstream.DecoderOptions) { + options.Logger = logger + options.LogMessages = m.LogEventStreamReads + + }), + ) + defer func() { + if err == nil { + return + } + _ = eventReader.Close() + }() + + output.eventStream = NewInvokeEndpointWithResponseStreamEventStream(func(stream *InvokeEndpointWithResponseStreamEventStream) { + stream.Reader = eventReader + }) + + go output.eventStream.waitStreamClose() + + return out, metadata, nil +} + +func (*awsRestjson1_deserializeOpEventStreamInvokeEndpointWithResponseStream) closeResponseBody(out middleware.DeserializeOutput) { + if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil { + _, _ = io.Copy(ioutil.Discard, resp.Body) + _ = resp.Body.Close() + } +} + +func addEventStreamInvokeEndpointWithResponseStreamMiddleware(stack *middleware.Stack, options Options) error { + if err := stack.Deserialize.Insert(&awsRestjson1_deserializeOpEventStreamInvokeEndpointWithResponseStream{ + LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(), + LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(), + }, "OperationDeserializer", middleware.Before); err != nil { + return err + } + return nil + +} + +// UnknownEventMessageError provides an error when a message is received from the stream, +// but the reader is unable to determine what kind of message it is. +type UnknownEventMessageError struct { + Type string + Message *eventstream.Message +} + +// Error retruns the error message string. +func (e *UnknownEventMessageError) Error() string { + return "unknown event stream message type, " + e.Type +} + +func setSafeEventStreamClientLogMode(o *Options, operation string) { + switch operation { + case "InvokeEndpointWithResponseStream": + toggleEventStreamClientLogMode(o, false, true) + return + + default: + return + + } +} +func toggleEventStreamClientLogMode(o *Options, request, response bool) { + mode := o.ClientLogMode + + if request && mode.IsRequestWithBody() { + mode.ClearRequestWithBody() + mode |= aws.LogRequest + } + + if response && mode.IsResponseWithBody() { + mode.ClearResponseWithBody() + mode |= aws.LogResponse + } + + o.ClientLogMode = mode + +} diff --git a/service/sagemakerruntime/generated.json b/service/sagemakerruntime/generated.json index 043157919e3..53eae175c56 100644 --- a/service/sagemakerruntime/generated.json +++ b/service/sagemakerruntime/generated.json @@ -1,6 +1,7 @@ { "dependencies": { "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream": "v0.0.0-00010101000000-000000000000", "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", "github.com/aws/smithy-go": "v1.4.0", @@ -11,10 +12,12 @@ "api_client_test.go", "api_op_InvokeEndpoint.go", "api_op_InvokeEndpointAsync.go", + "api_op_InvokeEndpointWithResponseStream.go", "deserializers.go", "doc.go", "endpoints.go", "endpoints_test.go", + "eventstream.go", "generated.json", "internal/endpoints/endpoints.go", "internal/endpoints/endpoints_test.go", @@ -22,6 +25,7 @@ "serializers.go", "types/errors.go", "types/types.go", + "types/types_exported_test.go", "validators.go" ], "go": "1.15", diff --git a/service/sagemakerruntime/go.mod b/service/sagemakerruntime/go.mod index 488c75836b3..03bae0954b6 100644 --- a/service/sagemakerruntime/go.mod +++ b/service/sagemakerruntime/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v1.21.0 + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 github.com/aws/smithy-go v1.14.2 @@ -12,6 +13,8 @@ require ( replace github.com/aws/aws-sdk-go-v2 => ../../ +replace github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream => ../../aws/protocol/eventstream/ + replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/sagemakerruntime/serializers.go b/service/sagemakerruntime/serializers.go index 74f95919d1b..2522100bd3f 100644 --- a/service/sagemakerruntime/serializers.go +++ b/service/sagemakerruntime/serializers.go @@ -228,3 +228,110 @@ func awsRestjson1_serializeOpHttpBindingsInvokeEndpointAsyncInput(v *InvokeEndpo return nil } + +type awsRestjson1_serializeOpInvokeEndpointWithResponseStream struct { +} + +func (*awsRestjson1_serializeOpInvokeEndpointWithResponseStream) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpInvokeEndpointWithResponseStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*InvokeEndpointWithResponseStreamInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/endpoints/{EndpointName}/invocations-response-stream") + 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_serializeOpHttpBindingsInvokeEndpointWithResponseStreamInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/octet-stream") + } + + if input.Body != nil { + payload := bytes.NewReader(input.Body) + if request, err = request.SetStream(payload); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsInvokeEndpointWithResponseStreamInput(v *InvokeEndpointWithResponseStreamInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Accept != nil && len(*v.Accept) > 0 { + locationName := "X-Amzn-Sagemaker-Accept" + encoder.SetHeader(locationName).String(*v.Accept) + } + + if v.ContentType != nil && len(*v.ContentType) > 0 { + locationName := "Content-Type" + encoder.SetHeader(locationName).String(*v.ContentType) + } + + if v.CustomAttributes != nil && len(*v.CustomAttributes) > 0 { + locationName := "X-Amzn-Sagemaker-Custom-Attributes" + encoder.SetHeader(locationName).String(*v.CustomAttributes) + } + + if v.EndpointName == nil || len(*v.EndpointName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member EndpointName must not be empty")} + } + if v.EndpointName != nil { + if err := encoder.SetURI("EndpointName").String(*v.EndpointName); err != nil { + return err + } + } + + if v.InferenceId != nil && len(*v.InferenceId) > 0 { + locationName := "X-Amzn-Sagemaker-Inference-Id" + encoder.SetHeader(locationName).String(*v.InferenceId) + } + + if v.TargetContainerHostname != nil && len(*v.TargetContainerHostname) > 0 { + locationName := "X-Amzn-Sagemaker-Target-Container-Hostname" + encoder.SetHeader(locationName).String(*v.TargetContainerHostname) + } + + if v.TargetVariant != nil && len(*v.TargetVariant) > 0 { + locationName := "X-Amzn-Sagemaker-Target-Variant" + encoder.SetHeader(locationName).String(*v.TargetVariant) + } + + return nil +} diff --git a/service/sagemakerruntime/types/errors.go b/service/sagemakerruntime/types/errors.go index a5d6356ec95..f36a1b0f99a 100644 --- a/service/sagemakerruntime/types/errors.go +++ b/service/sagemakerruntime/types/errors.go @@ -60,6 +60,33 @@ func (e *InternalFailure) ErrorCode() string { } func (e *InternalFailure) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The stream processing failed because of an unknown error, exception or failure. +// Try your request again. +type InternalStreamFailure struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalStreamFailure) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalStreamFailure) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalStreamFailure) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalStreamFailure" + } + return *e.ErrorCodeOverride +} +func (e *InternalStreamFailure) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + // Model (owned by the customer in the container) returned 4xx or 5xx error code. type ModelError struct { Message *string @@ -118,6 +145,38 @@ func (e *ModelNotReadyException) ErrorCode() string { } func (e *ModelNotReadyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// An error occurred while streaming the response body. This error can have the +// following error codes: ModelInvocationTimeExceeded The model failed to finish +// sending the response within the timeout period allowed by Amazon SageMaker. +// StreamBroken The Transmission Control Protocol (TCP) connection between the +// client and the model was reset or closed. +type ModelStreamError struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *string + + noSmithyDocumentSerde +} + +func (e *ModelStreamError) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ModelStreamError) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ModelStreamError) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ModelStreamError" + } + return *e.ErrorCodeOverride +} +func (e *ModelStreamError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The service is unavailable. Try your call again. type ServiceUnavailable struct { Message *string diff --git a/service/sagemakerruntime/types/types.go b/service/sagemakerruntime/types/types.go index 0ec0789f8d9..1c7e743b715 100644 --- a/service/sagemakerruntime/types/types.go +++ b/service/sagemakerruntime/types/types.go @@ -6,4 +6,47 @@ import ( smithydocument "github.com/aws/smithy-go/document" ) +// A wrapper for pieces of the payload that's returned in response to a streaming +// inference request. A streaming inference response consists of one or more +// payload parts. +type PayloadPart struct { + + // A blob that contains part of the response for your streaming inference request. + Bytes []byte + + noSmithyDocumentSerde +} + +// A stream of payload parts. Each part contains a portion of the response for a +// streaming inference request. +// +// The following types satisfy this interface: +// +// ResponseStreamMemberPayloadPart +type ResponseStream interface { + isResponseStream() +} + +// A wrapper for pieces of the payload that's returned in response to a streaming +// inference request. A streaming inference response consists of one or more +// payload parts. +type ResponseStreamMemberPayloadPart struct { + Value PayloadPart + + noSmithyDocumentSerde +} + +func (*ResponseStreamMemberPayloadPart) isResponseStream() {} + type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isResponseStream() {} diff --git a/service/sagemakerruntime/types/types_exported_test.go b/service/sagemakerruntime/types/types_exported_test.go new file mode 100644 index 00000000000..88f4556ebf9 --- /dev/null +++ b/service/sagemakerruntime/types/types_exported_test.go @@ -0,0 +1,26 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/sagemakerruntime/types" +) + +func ExampleResponseStream_outputUsage() { + var union types.ResponseStream + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ResponseStreamMemberPayloadPart: + _ = v.Value // Value is types.PayloadPart + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.PayloadPart diff --git a/service/sagemakerruntime/validators.go b/service/sagemakerruntime/validators.go index c4d2bd63c56..3989db2797c 100644 --- a/service/sagemakerruntime/validators.go +++ b/service/sagemakerruntime/validators.go @@ -49,6 +49,26 @@ func (m *validateOpInvokeEndpoint) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpInvokeEndpointWithResponseStream struct { +} + +func (*validateOpInvokeEndpointWithResponseStream) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpInvokeEndpointWithResponseStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*InvokeEndpointWithResponseStreamInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpInvokeEndpointWithResponseStreamInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpInvokeEndpointAsyncValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpInvokeEndpointAsync{}, middleware.After) } @@ -57,6 +77,10 @@ func addOpInvokeEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpInvokeEndpoint{}, middleware.After) } +func addOpInvokeEndpointWithResponseStreamValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpInvokeEndpointWithResponseStream{}, middleware.After) +} + func validateOpInvokeEndpointAsyncInput(v *InvokeEndpointAsyncInput) error { if v == nil { return nil @@ -92,3 +116,21 @@ func validateOpInvokeEndpointInput(v *InvokeEndpointInput) error { return nil } } + +func validateOpInvokeEndpointWithResponseStreamInput(v *InvokeEndpointWithResponseStreamInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InvokeEndpointWithResponseStreamInput"} + if v.EndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointName")) + } + if v.Body == nil { + invalidParams.Add(smithy.NewErrParamRequired("Body")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/sso/internal/endpoints/endpoints.go b/service/sso/internal/endpoints/endpoints.go index 1da26791c35..18849bab6a5 100644 --- a/service/sso/internal/endpoints/endpoints.go +++ b/service/sso/internal/endpoints/endpoints.go @@ -267,6 +267,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-west-3", }, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.il-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "il-central-1", + }, + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{