diff --git a/.changelog/23ed957e09844b1593b665d99b0c24c9.json b/.changelog/23ed957e09844b1593b665d99b0c24c9.json new file mode 100644 index 00000000000..7d24b3dec5e --- /dev/null +++ b/.changelog/23ed957e09844b1593b665d99b0c24c9.json @@ -0,0 +1,8 @@ +{ + "id": "23ed957e-0984-4b15-93b6-65d99b0c24c9", + "type": "feature", + "description": "This release includes support to add tags when creating a stream", + "modules": [ + "service/kinesis" + ] +} \ No newline at end of file diff --git a/.changelog/45d013d6097149a9849daf613e6dc367.json b/.changelog/45d013d6097149a9849daf613e6dc367.json new file mode 100644 index 00000000000..2b2499bc5e1 --- /dev/null +++ b/.changelog/45d013d6097149a9849daf613e6dc367.json @@ -0,0 +1,8 @@ +{ + "id": "45d013d6-0971-49a9-849d-af613e6dc367", + "type": "feature", + "description": "Adding `HiddenInstanceTypes` and `HiddenSageMakerImageVersionAliases` attribute to SageMaker API", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/4d2a9b13478c4d8483bc8530f9d8c102.json b/.changelog/4d2a9b13478c4d8483bc8530f9d8c102.json new file mode 100644 index 00000000000..1acbf55fe32 --- /dev/null +++ b/.changelog/4d2a9b13478c4d8483bc8530f9d8c102.json @@ -0,0 +1,8 @@ +{ + "id": "4d2a9b13-478c-4d84-83bc-8530f9d8c102", + "type": "feature", + "description": "Releasing minor partitional endpoint updates", + "modules": [ + "service/budgets" + ] +} \ No newline at end of file diff --git a/.changelog/619964665c464cacac59e725fdd55bf7.json b/.changelog/619964665c464cacac59e725fdd55bf7.json new file mode 100644 index 00000000000..dea8bff224e --- /dev/null +++ b/.changelog/619964665c464cacac59e725fdd55bf7.json @@ -0,0 +1,8 @@ +{ + "id": "61996466-5c46-4cac-ac59-e725fdd55bf7", + "type": "feature", + "description": "AWS End User Messaging SMS-Voice V2 has added support for resource policies. Use the three new APIs to create, view, edit, and delete resource policies.", + "modules": [ + "service/pinpointsmsvoicev2" + ] +} \ No newline at end of file diff --git a/.changelog/65bf69cebdd142cb82545c2eee25e407.json b/.changelog/65bf69cebdd142cb82545c2eee25e407.json new file mode 100644 index 00000000000..6010226840e --- /dev/null +++ b/.changelog/65bf69cebdd142cb82545c2eee25e407.json @@ -0,0 +1,8 @@ +{ + "id": "65bf69ce-bdd1-42cb-8254-5c2eee25e407", + "type": "feature", + "description": "Add support for Cross Region Inference in Bedrock Model Evaluations.", + "modules": [ + "service/bedrock" + ] +} \ No newline at end of file diff --git a/feature/dynamodbstreams/attributevalue/go_module_metadata.go b/feature/dynamodbstreams/attributevalue/go_module_metadata.go index c4a0c7e1182..6ae03719086 100644 --- a/feature/dynamodbstreams/attributevalue/go_module_metadata.go +++ b/feature/dynamodbstreams/attributevalue/go_module_metadata.go @@ -3,4 +3,4 @@ package attributevalue // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.19" +const goModuleVersion = "1.15.6" diff --git a/internal/protocoltest/awsrestjson/api_client.go b/internal/protocoltest/awsrestjson/api_client.go index 4c62ec0a7ab..76ba010e677 100644 --- a/internal/protocoltest/awsrestjson/api_client.go +++ b/internal/protocoltest/awsrestjson/api_client.go @@ -190,10 +190,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/internal/protocoltest/ec2query/api_client.go b/internal/protocoltest/ec2query/api_client.go index 493e0ebf1a5..00d38b44420 100644 --- a/internal/protocoltest/ec2query/api_client.go +++ b/internal/protocoltest/ec2query/api_client.go @@ -190,10 +190,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/internal/protocoltest/jsonrpc/api_client.go b/internal/protocoltest/jsonrpc/api_client.go index 784a612eb39..da055389f7d 100644 --- a/internal/protocoltest/jsonrpc/api_client.go +++ b/internal/protocoltest/jsonrpc/api_client.go @@ -186,10 +186,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/internal/protocoltest/jsonrpc10/api_client.go b/internal/protocoltest/jsonrpc10/api_client.go index 9c5a429114a..ef529308e91 100644 --- a/internal/protocoltest/jsonrpc10/api_client.go +++ b/internal/protocoltest/jsonrpc10/api_client.go @@ -186,10 +186,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/internal/protocoltest/query/api_client.go b/internal/protocoltest/query/api_client.go index 767aadd156b..5cb36b09f77 100644 --- a/internal/protocoltest/query/api_client.go +++ b/internal/protocoltest/query/api_client.go @@ -190,10 +190,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/internal/protocoltest/restxml/api_client.go b/internal/protocoltest/restxml/api_client.go index ed99b56c19a..097b0d8cf88 100644 --- a/internal/protocoltest/restxml/api_client.go +++ b/internal/protocoltest/restxml/api_client.go @@ -190,10 +190,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/internal/protocoltest/restxmlwithnamespace/api_client.go b/internal/protocoltest/restxmlwithnamespace/api_client.go index 08be214d175..50321ddc4f6 100644 --- a/internal/protocoltest/restxmlwithnamespace/api_client.go +++ b/internal/protocoltest/restxmlwithnamespace/api_client.go @@ -186,10 +186,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/internal/protocoltest/smithyrpcv2cbor/api_client.go b/internal/protocoltest/smithyrpcv2cbor/api_client.go index 4eb326ee343..a9c14e64adf 100644 --- a/internal/protocoltest/smithyrpcv2cbor/api_client.go +++ b/internal/protocoltest/smithyrpcv2cbor/api_client.go @@ -181,10 +181,10 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveEndpointResolverV2(&options) - resolveTracerProvider(&options) - resolveMeterProvider(&options) + resolveTracerProvider(&options) + resolveAuthSchemeResolver(&options) for _, fn := range optFns { diff --git a/service/applicationinsights/internal/endpoints/endpoints.go b/service/applicationinsights/internal/endpoints/endpoints.go index 6e64efd16a5..74bb6ec776f 100644 --- a/service/applicationinsights/internal/endpoints/endpoints.go +++ b/service/applicationinsights/internal/endpoints/endpoints.go @@ -175,6 +175,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, diff --git a/service/bedrock/api_op_CreateEvaluationJob.go b/service/bedrock/api_op_CreateEvaluationJob.go index ffbc573f03c..2eb7d2c992c 100644 --- a/service/bedrock/api_op_CreateEvaluationJob.go +++ b/service/bedrock/api_op_CreateEvaluationJob.go @@ -39,8 +39,10 @@ type CreateEvaluationJobInput struct { EvaluationConfig types.EvaluationConfig // Specify the models you want to use in your model evaluation job. Automatic - // model evaluation jobs support a single model, and model evaluation job that use - // human workers support two models. + // model evaluation jobs support a single model or [inference profile], and model evaluation job that + // use human workers support two models or inference profiles. + // + // [inference profile]: https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html // // This member is required. InferenceConfig types.EvaluationInferenceConfig diff --git a/service/bedrock/types/types.go b/service/bedrock/types/types.go index 2f12f92902a..a185cdfa97b 100644 --- a/service/bedrock/types/types.go +++ b/service/bedrock/types/types.go @@ -115,7 +115,7 @@ type CustomModelSummary struct { noSmithyDocumentSerde } -// Contains the ARN of the Amazon Bedrock models specified in your model +// Contains the ARN of the Amazon Bedrock model or [inference profile] specified in your model // evaluation job. Each Amazon Bedrock model supports different inferenceParams . // To learn more about supported inference parameters for Amazon Bedrock models, // see [Inference parameters for foundation models]. @@ -126,6 +126,7 @@ type CustomModelSummary struct { // \"temperature\":\"0.25\" to successfully accepted in the request. // // [Inference parameters for foundation models]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html +// [inference profile]: https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html type EvaluationBedrockModel struct { // Each Amazon Bedrock support different inference parameters that change how the @@ -134,7 +135,7 @@ type EvaluationBedrockModel struct { // This member is required. InferenceParams *string - // The ARN of the Amazon Bedrock model specified. + // The ARN of the Amazon Bedrock model or inference profile specified. // // This member is required. ModelIdentifier *string @@ -265,7 +266,8 @@ type EvaluationModelConfig interface { isEvaluationModelConfig() } -// Defines the Amazon Bedrock model and inference parameters you want used. +// Defines the Amazon Bedrock model or inference profile and inference parameters +// you want used. type EvaluationModelConfigMemberBedrockModel struct { Value EvaluationBedrockModel diff --git a/service/budgets/endpoints.go b/service/budgets/endpoints.go index 8f06a67c438..ad07416054a 100644 --- a/service/budgets/endpoints.go +++ b/service/budgets/endpoints.go @@ -426,6 +426,74 @@ func (r *resolver) ResolveEndpoint( } } } + if _PartitionResult.Name == "aws-iso-e" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := "https://budgets.global.cloud.adc-e.uk" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "budgets") + smithyhttp.SetSigV4ASigningName(&sp, "budgets") + + smithyhttp.SetSigV4SigningRegion(&sp, "eu-isoe-west-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if _PartitionResult.Name == "aws-iso-f" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := "https://budgets.global.csp.hci.ic.gov" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "budgets") + smithyhttp.SetSigV4ASigningName(&sp, "budgets") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } if _UseFIPS == true { if _UseDualStack == true { if true == _PartitionResult.SupportsFIPS { diff --git a/service/budgets/endpoints_test.go b/service/budgets/endpoints_test.go index f8d8ebb9b84..f521a1895c6 100644 --- a/service/budgets/endpoints_test.go +++ b/service/budgets/endpoints_test.go @@ -826,8 +826,114 @@ func TestEndpointCase21(t *testing.T) { } } -// For custom endpoint with region set and fips disabled and dualstack disabled +// For region eu-isoe-west-1 with FIPS disabled and DualStack disabled func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://budgets.global.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "budgets") + smithyhttp.SetSigV4ASigningName(&sp, "budgets") + + smithyhttp.SetSigV4SigningRegion(&sp, "eu-isoe-west-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack disabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://budgets.global.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "budgets") + smithyhttp.SetSigV4ASigningName(&sp, "budgets") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -865,7 +971,7 @@ func TestEndpointCase22(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase23(t *testing.T) { +func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), @@ -902,7 +1008,7 @@ func TestEndpointCase23(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase24(t *testing.T) { +func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -923,7 +1029,7 @@ func TestEndpointCase24(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase25(t *testing.T) { +func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -944,7 +1050,7 @@ func TestEndpointCase25(t *testing.T) { } // Missing region -func TestEndpointCase26(t *testing.T) { +func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{} resolver := NewDefaultEndpointResolverV2() diff --git a/service/kinesis/api_op_CreateStream.go b/service/kinesis/api_op_CreateStream.go index 11ee3466938..b495389a3e9 100644 --- a/service/kinesis/api_op_CreateStream.go +++ b/service/kinesis/api_op_CreateStream.go @@ -53,6 +53,12 @@ import ( // // CreateStreamhas a limit of five transactions per second per account. // +// You can add tags to the stream when making a CreateStream request by setting +// the Tags parameter. If you pass Tags parameter, in addition to having +// kinesis:createStream permission, you must also have kinesis:addTagsToStream +// permission for the stream that will be created. Tags will take effect from the +// CREATING status of the stream. +// // [contact Amazon Web Services Support]: https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html // [Amazon Kinesis Data Streams Limits]: https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html func (c *Client) CreateStream(ctx context.Context, params *CreateStreamInput, optFns ...func(*Options)) (*CreateStreamOutput, error) { @@ -93,6 +99,9 @@ type CreateStreamInput struct { // capacity mode for your data streams. StreamModeDetails *types.StreamModeDetails + // A set of up to 10 key-value pairs to use to create the tags. + Tags map[string]string + noSmithyDocumentSerde } diff --git a/service/kinesis/api_op_RegisterStreamConsumer.go b/service/kinesis/api_op_RegisterStreamConsumer.go index 6f86e55d60f..4bc86e3194d 100644 --- a/service/kinesis/api_op_RegisterStreamConsumer.go +++ b/service/kinesis/api_op_RegisterStreamConsumer.go @@ -21,13 +21,15 @@ import ( // You can register up to 20 consumers per stream. A given consumer can only be // registered with one stream at a time. // -// For an example of how to use this operations, see Enhanced Fan-Out Using the Kinesis Data Streams API. +// For an example of how to use this operation, see [Enhanced Fan-Out Using the Kinesis Data Streams API]. // // The use of this operation has a limit of five transactions per second per // account. Also, only 5 consumers can be created simultaneously. In other words, // you cannot have more than 5 consumers in a CREATING status at the same time. // Registering a 6th consumer while there are 5 in a CREATING status results in a // LimitExceededException . +// +// [Enhanced Fan-Out Using the Kinesis Data Streams API]: https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html func (c *Client) RegisterStreamConsumer(ctx context.Context, params *RegisterStreamConsumerInput, optFns ...func(*Options)) (*RegisterStreamConsumerOutput, error) { if params == nil { params = &RegisterStreamConsumerInput{} diff --git a/service/kinesis/api_op_SubscribeToShard.go b/service/kinesis/api_op_SubscribeToShard.go index dec1151539d..0354407b0a1 100644 --- a/service/kinesis/api_op_SubscribeToShard.go +++ b/service/kinesis/api_op_SubscribeToShard.go @@ -37,7 +37,9 @@ import ( // call takes over the subscription and the previous connection expires or fails // with a ResourceInUseException . // -// For an example of how to use this operations, see Enhanced Fan-Out Using the Kinesis Data Streams API. +// For an example of how to use this operation, see [Enhanced Fan-Out Using the Kinesis Data Streams API]. +// +// [Enhanced Fan-Out Using the Kinesis Data Streams API]: https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html func (c *Client) SubscribeToShard(ctx context.Context, params *SubscribeToShardInput, optFns ...func(*Options)) (*SubscribeToShardOutput, error) { if params == nil { params = &SubscribeToShardInput{} diff --git a/service/kinesis/deserializers.go b/service/kinesis/deserializers.go index 05c11d79583..927565066fd 100644 --- a/service/kinesis/deserializers.go +++ b/service/kinesis/deserializers.go @@ -1589,6 +1589,9 @@ func awsAwsjson11_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Respo case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) diff --git a/service/kinesis/serializers.go b/service/kinesis/serializers.go index e3a6e436f76..f48fa8cd76c 100644 --- a/service/kinesis/serializers.go +++ b/service/kinesis/serializers.go @@ -2137,6 +2137,13 @@ func awsAwsjson11_serializeOpDocumentCreateStreamInput(v *CreateStreamInput, val ok.String(*v.StreamName) } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + return nil } diff --git a/service/pinpointsmsvoicev2/api_op_AssociateOriginationIdentity.go b/service/pinpointsmsvoicev2/api_op_AssociateOriginationIdentity.go index d132865211b..fe1f4db9052 100644 --- a/service/pinpointsmsvoicev2/api_op_AssociateOriginationIdentity.go +++ b/service/pinpointsmsvoicev2/api_op_AssociateOriginationIdentity.go @@ -46,12 +46,18 @@ type AssociateOriginationIdentityInput struct { // PhoneNumberArn, while DescribeSenderIdscan be used to get the values for SenderId and // SenderIdArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OriginationIdentity *string // The pool to update with the new Identity. This value can be either the PoolId // or PoolArn, and you can find these values using DescribePools. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. PoolId *string diff --git a/service/pinpointsmsvoicev2/api_op_CreatePool.go b/service/pinpointsmsvoicev2/api_op_CreatePool.go index 3fa53551364..b4de32eafa9 100644 --- a/service/pinpointsmsvoicev2/api_op_CreatePool.go +++ b/service/pinpointsmsvoicev2/api_op_CreatePool.go @@ -61,6 +61,9 @@ type CreatePoolInput struct { // After the pool is created you can add more origination identities to the pool // by using [AssociateOriginationIdentity]. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // [AssociateOriginationIdentity]: https://docs.aws.amazon.com/pinpoint/latest/apireference_smsvoicev2/API_AssociateOriginationIdentity.html // // This member is required. diff --git a/service/pinpointsmsvoicev2/api_op_DeleteKeyword.go b/service/pinpointsmsvoicev2/api_op_DeleteKeyword.go index 7b2aedcd4ed..3da1f076f05 100644 --- a/service/pinpointsmsvoicev2/api_op_DeleteKeyword.go +++ b/service/pinpointsmsvoicev2/api_op_DeleteKeyword.go @@ -46,6 +46,9 @@ type DeleteKeywordInput struct { // or PoolArn. You can use DescribePhoneNumbersto find the values for PhoneNumberId and PhoneNumberArn // and DescribePoolsto find the values of PoolId and PoolArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OriginationIdentity *string diff --git a/service/pinpointsmsvoicev2/api_op_DeleteOptOutList.go b/service/pinpointsmsvoicev2/api_op_DeleteOptOutList.go index 968a210827f..95e0f6f2f7e 100644 --- a/service/pinpointsmsvoicev2/api_op_DeleteOptOutList.go +++ b/service/pinpointsmsvoicev2/api_op_DeleteOptOutList.go @@ -36,6 +36,9 @@ type DeleteOptOutListInput struct { // The OptOutListName or OptOutListArn of the OptOutList to delete. You can use DescribeOptOutLists // to find the values for OptOutListName and OptOutListArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OptOutListName *string diff --git a/service/pinpointsmsvoicev2/api_op_DeleteOptedOutNumber.go b/service/pinpointsmsvoicev2/api_op_DeleteOptedOutNumber.go index bf618af8f76..1a5c4c2776a 100644 --- a/service/pinpointsmsvoicev2/api_op_DeleteOptedOutNumber.go +++ b/service/pinpointsmsvoicev2/api_op_DeleteOptedOutNumber.go @@ -37,6 +37,9 @@ type DeleteOptedOutNumberInput struct { // The OptOutListName or OptOutListArn to remove the phone number from. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OptOutListName *string diff --git a/service/pinpointsmsvoicev2/api_op_DeletePool.go b/service/pinpointsmsvoicev2/api_op_DeletePool.go index 0662a3be5f7..c4640283641 100644 --- a/service/pinpointsmsvoicev2/api_op_DeletePool.go +++ b/service/pinpointsmsvoicev2/api_op_DeletePool.go @@ -41,6 +41,9 @@ type DeletePoolInput struct { // The PoolId or PoolArn of the pool to delete. You can use DescribePools to find the values // for PoolId and PoolArn . // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. PoolId *string diff --git a/service/pinpointsmsvoicev2/api_op_DeleteResourcePolicy.go b/service/pinpointsmsvoicev2/api_op_DeleteResourcePolicy.go new file mode 100644 index 00000000000..a3f3e96bf69 --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_DeleteResourcePolicy.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Deletes the resource-based policy document attached to the AWS End User +// Messaging SMS and Voice resource. A shared resource can be a Pool, Opt-out list, +// Sender Id, or Phone number. +func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { + if params == nil { + params = &DeleteResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteResourcePolicyInput struct { + + // The Amazon Resource Name (ARN) of the AWS End User Messaging SMS and Voice + // resource you're deleting the resource-based policy from. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type DeleteResourcePolicyOutput struct { + + // The time when the resource-based policy was created, in [UNIX epoch time] format. + // + // [UNIX epoch time]: https://www.epochconverter.com/ + CreatedTimestamp *time.Time + + // The JSON formatted resource-based policy that was deleted. + Policy *string + + // The Amazon Resource Name (ARN) of the AWS End User Messaging SMS and Voice + // resource that the resource-based policy was deleted from. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteResourcePolicy", + } +} diff --git a/service/pinpointsmsvoicev2/api_op_DescribeKeywords.go b/service/pinpointsmsvoicev2/api_op_DescribeKeywords.go index 5cb45fae7d6..d20343e8abb 100644 --- a/service/pinpointsmsvoicev2/api_op_DescribeKeywords.go +++ b/service/pinpointsmsvoicev2/api_op_DescribeKeywords.go @@ -42,6 +42,9 @@ type DescribeKeywordsInput struct { // SenderId or SenderIdArn. You can use DescribePhoneNumbersto find the values for PhoneNumberId and // PhoneNumberArn while DescribeSenderIdscan be used to get the values for SenderId and SenderIdArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OriginationIdentity *string diff --git a/service/pinpointsmsvoicev2/api_op_DescribeOptOutLists.go b/service/pinpointsmsvoicev2/api_op_DescribeOptOutLists.go index 6814ff07e6b..7471076ca9c 100644 --- a/service/pinpointsmsvoicev2/api_op_DescribeOptOutLists.go +++ b/service/pinpointsmsvoicev2/api_op_DescribeOptOutLists.go @@ -45,8 +45,16 @@ type DescribeOptOutListsInput struct { // The OptOutLists to show the details of. This is an array of strings that can be // either the OptOutListName or OptOutListArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). OptOutListNames []string + // Use SELF to filter the list of Opt-Out List to ones your account owns or use + // SHARED to filter on Opt-Out List shared with your account. The Owner and + // OptOutListNames parameters can't be used at the same time. + Owner types.Owner + noSmithyDocumentSerde } diff --git a/service/pinpointsmsvoicev2/api_op_DescribeOptedOutNumbers.go b/service/pinpointsmsvoicev2/api_op_DescribeOptedOutNumbers.go index c5a1497e930..757fa2c44ca 100644 --- a/service/pinpointsmsvoicev2/api_op_DescribeOptedOutNumbers.go +++ b/service/pinpointsmsvoicev2/api_op_DescribeOptedOutNumbers.go @@ -41,6 +41,9 @@ type DescribeOptedOutNumbersInput struct { // The OptOutListName or OptOutListArn of the OptOutList. You can use DescribeOptOutLists to find the // values for OptOutListName and OptOutListArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OptOutListName *string diff --git a/service/pinpointsmsvoicev2/api_op_DescribePhoneNumbers.go b/service/pinpointsmsvoicev2/api_op_DescribePhoneNumbers.go index ff682d29c57..4c9cacc7272 100644 --- a/service/pinpointsmsvoicev2/api_op_DescribePhoneNumbers.go +++ b/service/pinpointsmsvoicev2/api_op_DescribePhoneNumbers.go @@ -48,8 +48,16 @@ type DescribePhoneNumbersInput struct { // supply a value for this field in the initial request. NextToken *string + // Use SELF to filter the list of phone numbers to ones your account owns or use + // SHARED to filter on phone numbers shared with your account. The Owner and + // PhoneNumberIds parameters can't be used at the same time. + Owner types.Owner + // The unique identifier of phone numbers to find information about. This is an // array of strings that can be either the PhoneNumberId or PhoneNumberArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). PhoneNumberIds []string noSmithyDocumentSerde diff --git a/service/pinpointsmsvoicev2/api_op_DescribePools.go b/service/pinpointsmsvoicev2/api_op_DescribePools.go index 9692501cf9b..d4cfbea8589 100644 --- a/service/pinpointsmsvoicev2/api_op_DescribePools.go +++ b/service/pinpointsmsvoicev2/api_op_DescribePools.go @@ -51,8 +51,16 @@ type DescribePoolsInput struct { // supply a value for this field in the initial request. NextToken *string + // Use SELF to filter the list of Pools to ones your account owns or use SHARED to + // filter on Pools shared with your account. The Owner and PoolIds parameters + // can't be used at the same time. + Owner types.Owner + // The unique identifier of pools to find. This is an array of strings that can be // either the PoolId or PoolArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). PoolIds []string noSmithyDocumentSerde diff --git a/service/pinpointsmsvoicev2/api_op_DescribeSenderIds.go b/service/pinpointsmsvoicev2/api_op_DescribeSenderIds.go index cf38891a11b..0d62418a276 100644 --- a/service/pinpointsmsvoicev2/api_op_DescribeSenderIds.go +++ b/service/pinpointsmsvoicev2/api_op_DescribeSenderIds.go @@ -47,7 +47,15 @@ type DescribeSenderIdsInput struct { // supply a value for this field in the initial request. NextToken *string + // Use SELF to filter the list of Sender Ids to ones your account owns or use + // SHARED to filter on Sender Ids shared with your account. The Owner and SenderIds + // parameters can't be used at the same time. + Owner types.Owner + // An array of SenderIdAndCountry objects to search for. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). SenderIds []types.SenderIdAndCountry noSmithyDocumentSerde diff --git a/service/pinpointsmsvoicev2/api_op_DisassociateOriginationIdentity.go b/service/pinpointsmsvoicev2/api_op_DisassociateOriginationIdentity.go index 0b17bf4df15..2ea909d989e 100644 --- a/service/pinpointsmsvoicev2/api_op_DisassociateOriginationIdentity.go +++ b/service/pinpointsmsvoicev2/api_op_DisassociateOriginationIdentity.go @@ -41,12 +41,18 @@ type DisassociateOriginationIdentityInput struct { // SenderId or SenderIdArn. You can use DescribePhoneNumbersfind the values for PhoneNumberId and // PhoneNumberArn, or use DescribeSenderIdsto get the values for SenderId and SenderIdArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OriginationIdentity *string // The unique identifier for the pool to disassociate with the origination // identity. This value can be either the PoolId or PoolArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. PoolId *string diff --git a/service/pinpointsmsvoicev2/api_op_GetResourcePolicy.go b/service/pinpointsmsvoicev2/api_op_GetResourcePolicy.go new file mode 100644 index 00000000000..1d31225d93b --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_GetResourcePolicy.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves the JSON text of the resource-based policy document attached to the +// AWS End User Messaging SMS and Voice resource. A shared resource can be a Pool, +// Opt-out list, Sender Id, or Phone number. +func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { + if params == nil { + params = &GetResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, c.addOperationGetResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourcePolicyInput struct { + + // The Amazon Resource Name (ARN) of the AWS End User Messaging SMS and Voice + // resource attached to the resource-based policy. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type GetResourcePolicyOutput struct { + + // The time when the resource-based policy was created, in [UNIX epoch time] format. + // + // [UNIX epoch time]: https://www.epochconverter.com/ + CreatedTimestamp *time.Time + + // The JSON formatted string that contains the resource-based policy attached to + // the AWS End User Messaging SMS and Voice resource. + Policy *string + + // The Amazon Resource Name (ARN) of the AWS End User Messaging SMS and Voice + // resource attached to the resource-based policy. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetResourcePolicy", + } +} diff --git a/service/pinpointsmsvoicev2/api_op_ListPoolOriginationIdentities.go b/service/pinpointsmsvoicev2/api_op_ListPoolOriginationIdentities.go index 9d3de368d6b..1600cecceeb 100644 --- a/service/pinpointsmsvoicev2/api_op_ListPoolOriginationIdentities.go +++ b/service/pinpointsmsvoicev2/api_op_ListPoolOriginationIdentities.go @@ -35,6 +35,9 @@ type ListPoolOriginationIdentitiesInput struct { // The unique identifier for the pool. This value can be either the PoolId or // PoolArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. PoolId *string diff --git a/service/pinpointsmsvoicev2/api_op_PutKeyword.go b/service/pinpointsmsvoicev2/api_op_PutKeyword.go index 9088829c84d..d9d7bb1a5b4 100644 --- a/service/pinpointsmsvoicev2/api_op_PutKeyword.go +++ b/service/pinpointsmsvoicev2/api_op_PutKeyword.go @@ -52,6 +52,9 @@ type PutKeywordInput struct { // SenderId or SenderIdArn. You can use DescribePhoneNumbersget the values for PhoneNumberId and // PhoneNumberArn while DescribeSenderIdscan be used to get the values for SenderId and SenderIdArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OriginationIdentity *string diff --git a/service/pinpointsmsvoicev2/api_op_PutOptedOutNumber.go b/service/pinpointsmsvoicev2/api_op_PutOptedOutNumber.go index 4978b275863..aa0c93a7d85 100644 --- a/service/pinpointsmsvoicev2/api_op_PutOptedOutNumber.go +++ b/service/pinpointsmsvoicev2/api_op_PutOptedOutNumber.go @@ -34,6 +34,9 @@ type PutOptedOutNumberInput struct { // The OptOutListName or OptOutListArn to add the phone number to. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OptOutListName *string diff --git a/service/pinpointsmsvoicev2/api_op_PutResourcePolicy.go b/service/pinpointsmsvoicev2/api_op_PutResourcePolicy.go new file mode 100644 index 00000000000..6f86b6daccd --- /dev/null +++ b/service/pinpointsmsvoicev2/api_op_PutResourcePolicy.go @@ -0,0 +1,178 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Attaches a resource-based policy to a AWS End User Messaging SMS and Voice +// resource(phone number, sender Id, phone poll, or opt-out list) that is used for +// sharing the resource. A shared resource can be a Pool, Opt-out list, Sender Id, +// or Phone number. For more information about resource-based policies, see [Working with shared resources]in the +// AWS End User Messaging SMS User Guide. +// +// [Working with shared resources]: https://docs.aws.amazon.com/sms-voice/latest/userguide/shared-resources.html +func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { + if params == nil { + params = &PutResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutResourcePolicyInput struct { + + // The JSON formatted resource-based policy to attach. + // + // This member is required. + Policy *string + + // The Amazon Resource Name (ARN) of the AWS End User Messaging SMS and Voice + // resource to attach the resource-based policy to. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type PutResourcePolicyOutput struct { + + // The time when the resource-based policy was created, in [UNIX epoch time] format. + // + // [UNIX epoch time]: https://www.epochconverter.com/ + CreatedTimestamp *time.Time + + // The JSON formatted Resource Policy. + Policy *string + + // The Amazon Resource Name (ARN) of the AWS End User Messaging SMS and Voice + // resource attached to the resource-based policy. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutResourcePolicy", + } +} diff --git a/service/pinpointsmsvoicev2/api_op_ReleasePhoneNumber.go b/service/pinpointsmsvoicev2/api_op_ReleasePhoneNumber.go index 62f2bbb88a1..0ee6b0c7ef0 100644 --- a/service/pinpointsmsvoicev2/api_op_ReleasePhoneNumber.go +++ b/service/pinpointsmsvoicev2/api_op_ReleasePhoneNumber.go @@ -37,6 +37,9 @@ type ReleasePhoneNumberInput struct { // The PhoneNumberId or PhoneNumberArn of the phone number to release. You can use DescribePhoneNumbers // to get the values for PhoneNumberId and PhoneNumberArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. PhoneNumberId *string diff --git a/service/pinpointsmsvoicev2/api_op_RequestPhoneNumber.go b/service/pinpointsmsvoicev2/api_op_RequestPhoneNumber.go index 7f01fe32099..4be28ba4c1f 100644 --- a/service/pinpointsmsvoicev2/api_op_RequestPhoneNumber.go +++ b/service/pinpointsmsvoicev2/api_op_RequestPhoneNumber.go @@ -69,10 +69,16 @@ type RequestPhoneNumberInput struct { // The name of the OptOutList to associate with the phone number. You can use the // OptOutListName or OptOutListArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). OptOutListName *string // The pool to associated with the phone number. You can use the PoolId or // PoolArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). PoolId *string // Use this field to attach your phone number for an external registration process. diff --git a/service/pinpointsmsvoicev2/api_op_SendDestinationNumberVerificationCode.go b/service/pinpointsmsvoicev2/api_op_SendDestinationNumberVerificationCode.go index 8e4eee1e950..a243e6af266 100644 --- a/service/pinpointsmsvoicev2/api_op_SendDestinationNumberVerificationCode.go +++ b/service/pinpointsmsvoicev2/api_op_SendDestinationNumberVerificationCode.go @@ -63,6 +63,9 @@ type SendDestinationNumberVerificationCodeInput struct { // The origination identity of the message. This can be either the PhoneNumber, // PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). OriginationIdentity *string noSmithyDocumentSerde diff --git a/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go b/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go index d8e25d8c3bc..ab6b1244e42 100644 --- a/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go +++ b/service/pinpointsmsvoicev2/api_op_SendMediaMessage.go @@ -37,6 +37,9 @@ type SendMediaMessageInput struct { // The origination identity of the message. This can be either the PhoneNumber, // PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OriginationIdentity *string diff --git a/service/pinpointsmsvoicev2/api_op_SendTextMessage.go b/service/pinpointsmsvoicev2/api_op_SendTextMessage.go index cd501eb452d..84010e8054c 100644 --- a/service/pinpointsmsvoicev2/api_op_SendTextMessage.go +++ b/service/pinpointsmsvoicev2/api_op_SendTextMessage.go @@ -98,6 +98,9 @@ type SendTextMessageInput struct { // The origination identity of the message. This can be either the PhoneNumber, // PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). OriginationIdentity *string // The unique identifier for the protect configuration. diff --git a/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go b/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go index 1f1404449f0..307b8025ddb 100644 --- a/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go +++ b/service/pinpointsmsvoicev2/api_op_SendVoiceMessage.go @@ -40,6 +40,9 @@ type SendVoiceMessageInput struct { // The origination identity to use for the voice call. This can be the // PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. OriginationIdentity *string diff --git a/service/pinpointsmsvoicev2/api_op_UpdatePhoneNumber.go b/service/pinpointsmsvoicev2/api_op_UpdatePhoneNumber.go index e612b1d5f7b..e4d8ae5a55b 100644 --- a/service/pinpointsmsvoicev2/api_op_UpdatePhoneNumber.go +++ b/service/pinpointsmsvoicev2/api_op_UpdatePhoneNumber.go @@ -38,6 +38,9 @@ type UpdatePhoneNumberInput struct { // The unique identifier of the phone number. Valid values for this field can be // either the PhoneNumberId or PhoneNumberArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. PhoneNumberId *string diff --git a/service/pinpointsmsvoicev2/api_op_UpdatePool.go b/service/pinpointsmsvoicev2/api_op_UpdatePool.go index 47fd32193f6..fba6d13dfe5 100644 --- a/service/pinpointsmsvoicev2/api_op_UpdatePool.go +++ b/service/pinpointsmsvoicev2/api_op_UpdatePool.go @@ -36,6 +36,9 @@ type UpdatePoolInput struct { // The unique identifier of the pool to update. Valid values are either the PoolId // or PoolArn. // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). + // // This member is required. PoolId *string @@ -44,6 +47,9 @@ type UpdatePoolInput struct { // The OptOutList to associate with the pool. Valid values are either // OptOutListName or OptOutListArn. + // + // If you are using a shared AWS End User Messaging SMS and Voice resource then + // you must use the full Amazon Resource Name(ARN). OptOutListName *string // By default this is set to false. When an end recipient sends a message that diff --git a/service/pinpointsmsvoicev2/deserializers.go b/service/pinpointsmsvoicev2/deserializers.go index e48f80e9eec..6f91b71a7cc 100644 --- a/service/pinpointsmsvoicev2/deserializers.go +++ b/service/pinpointsmsvoicev2/deserializers.go @@ -3296,6 +3296,129 @@ func awsAwsjson10_deserializeOpErrorDeleteRegistrationFieldValue(response *smith } } +type awsAwsjson10_deserializeOpDeleteResourcePolicy struct { +} + +func (*awsAwsjson10_deserializeOpDeleteResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response, &metadata) + } + output := &DeleteResourcePolicyOutput{} + 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 = awsAwsjson10_deserializeOpDocumentDeleteResourcePolicyOutput(&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 awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpDeleteTextMessageSpendLimitOverride struct { } @@ -6482,6 +6605,129 @@ func awsAwsjson10_deserializeOpErrorGetProtectConfigurationCountryRuleSet(respon } } +type awsAwsjson10_deserializeOpGetResourcePolicy struct { +} + +func (*awsAwsjson10_deserializeOpGetResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorGetResourcePolicy(response, &metadata) + } + output := &GetResourcePolicyOutput{} + 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 = awsAwsjson10_deserializeOpDocumentGetResourcePolicyOutput(&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 awsAwsjson10_deserializeOpErrorGetResourcePolicy(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpListPoolOriginationIdentities struct { } @@ -6608,11 +6854,134 @@ func awsAwsjson10_deserializeOpErrorListPoolOriginationIdentities(response *smit type awsAwsjson10_deserializeOpListRegistrationAssociations struct { } -func (*awsAwsjson10_deserializeOpListRegistrationAssociations) ID() string { +func (*awsAwsjson10_deserializeOpListRegistrationAssociations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response, &metadata) + } + output := &ListRegistrationAssociationsOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListRegistrationAssociationsOutput(&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 awsAwsjson10_deserializeOpErrorListRegistrationAssociations(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTagsForResource) 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) @@ -6630,9 +6999,9 @@ func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ListRegistrationAssociationsOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -6652,7 +7021,7 @@ func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeseriali return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListRegistrationAssociationsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6666,7 +7035,7 @@ func (m *awsAwsjson10_deserializeOpListRegistrationAssociations) HandleDeseriali return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTagsForResource(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)} @@ -6728,14 +7097,14 @@ func awsAwsjson10_deserializeOpErrorListRegistrationAssociations(response *smith } } -type awsAwsjson10_deserializeOpListTagsForResource struct { +type awsAwsjson10_deserializeOpPutKeyword struct { } -func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson10_deserializeOpPutKeyword) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutKeyword) 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) @@ -6753,9 +7122,9 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutKeyword(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &PutKeywordOutput{} out.Result = output var buff [1024]byte @@ -6775,7 +7144,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutKeywordOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6789,7 +7158,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutKeyword(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)} @@ -6829,12 +7198,18 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -6851,14 +7226,14 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpPutKeyword struct { +type awsAwsjson10_deserializeOpPutOptedOutNumber struct { } -func (*awsAwsjson10_deserializeOpPutKeyword) ID() string { +func (*awsAwsjson10_deserializeOpPutOptedOutNumber) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) 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) @@ -6876,9 +7251,9 @@ func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutKeyword(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response, &metadata) } - output := &PutKeywordOutput{} + output := &PutOptedOutNumberOutput{} out.Result = output var buff [1024]byte @@ -6898,7 +7273,7 @@ func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutKeywordOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutOptedOutNumberOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6912,7 +7287,7 @@ func (m *awsAwsjson10_deserializeOpPutKeyword) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutKeyword(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(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)} @@ -6952,18 +7327,12 @@ func awsAwsjson10_deserializeOpErrorPutKeyword(response *smithyhttp.Response, me case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -6980,14 +7349,14 @@ func awsAwsjson10_deserializeOpErrorPutKeyword(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpPutOptedOutNumber struct { +type awsAwsjson10_deserializeOpPutRegistrationFieldValue struct { } -func (*awsAwsjson10_deserializeOpPutOptedOutNumber) ID() string { +func (*awsAwsjson10_deserializeOpPutRegistrationFieldValue) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) 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) @@ -7005,9 +7374,9 @@ func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response, &metadata) } - output := &PutOptedOutNumberOutput{} + output := &PutRegistrationFieldValueOutput{} out.Result = output var buff [1024]byte @@ -7027,7 +7396,7 @@ func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutOptedOutNumberOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutRegistrationFieldValueOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7041,7 +7410,7 @@ func (m *awsAwsjson10_deserializeOpPutOptedOutNumber) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(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)} @@ -7081,6 +7450,9 @@ func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -7103,14 +7475,14 @@ func awsAwsjson10_deserializeOpErrorPutOptedOutNumber(response *smithyhttp.Respo } } -type awsAwsjson10_deserializeOpPutRegistrationFieldValue struct { +type awsAwsjson10_deserializeOpPutResourcePolicy struct { } -func (*awsAwsjson10_deserializeOpPutRegistrationFieldValue) ID() string { +func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutResourcePolicy) 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) @@ -7128,9 +7500,9 @@ func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata) } - output := &PutRegistrationFieldValueOutput{} + output := &PutResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -7150,7 +7522,7 @@ func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize( return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutRegistrationFieldValueOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7164,7 +7536,7 @@ func (m *awsAwsjson10_deserializeOpPutRegistrationFieldValue) HandleDeserialize( return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutResourcePolicy(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)} @@ -7204,9 +7576,6 @@ func awsAwsjson10_deserializeOpErrorPutRegistrationFieldValue(response *smithyht case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -16972,6 +17341,71 @@ func awsAwsjson10_deserializeOpDocumentDeleteRegistrationOutput(v **DeleteRegist return nil } +func awsAwsjson10_deserializeOpDocumentDeleteResourcePolicyOutput(v **DeleteResourcePolicyOutput, 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 *DeleteResourcePolicyOutput + if *v == nil { + sv = &DeleteResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicy to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + case "ResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentDeleteTextMessageSpendLimitOverrideOutput(v **DeleteTextMessageSpendLimitOverrideOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18374,6 +18808,71 @@ func awsAwsjson10_deserializeOpDocumentGetProtectConfigurationCountryRuleSetOutp return nil } +func awsAwsjson10_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, 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 *GetResourcePolicyOutput + if *v == nil { + sv = &GetResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicy to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + case "ResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListPoolOriginationIdentitiesOutput(v **ListPoolOriginationIdentitiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18807,6 +19306,71 @@ func awsAwsjson10_deserializeOpDocumentPutRegistrationFieldValueOutput(v **PutRe return nil } +func awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, 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 *PutResourcePolicyOutput + if *v == nil { + sv = &PutResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicy to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + case "ResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentReleasePhoneNumberOutput(v **ReleasePhoneNumberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/pinpointsmsvoicev2/generated.json b/service/pinpointsmsvoicev2/generated.json index 301f54330ed..13a23a82858 100644 --- a/service/pinpointsmsvoicev2/generated.json +++ b/service/pinpointsmsvoicev2/generated.json @@ -34,6 +34,7 @@ "api_op_DeleteRegistration.go", "api_op_DeleteRegistrationAttachment.go", "api_op_DeleteRegistrationFieldValue.go", + "api_op_DeleteResourcePolicy.go", "api_op_DeleteTextMessageSpendLimitOverride.go", "api_op_DeleteVerifiedDestinationNumber.go", "api_op_DeleteVoiceMessageSpendLimitOverride.go", @@ -60,12 +61,14 @@ "api_op_DisassociateProtectConfiguration.go", "api_op_DiscardRegistrationVersion.go", "api_op_GetProtectConfigurationCountryRuleSet.go", + "api_op_GetResourcePolicy.go", "api_op_ListPoolOriginationIdentities.go", "api_op_ListRegistrationAssociations.go", "api_op_ListTagsForResource.go", "api_op_PutKeyword.go", "api_op_PutOptedOutNumber.go", "api_op_PutRegistrationFieldValue.go", + "api_op_PutResourcePolicy.go", "api_op_ReleasePhoneNumber.go", "api_op_ReleaseSenderId.go", "api_op_RequestPhoneNumber.go", diff --git a/service/pinpointsmsvoicev2/serializers.go b/service/pinpointsmsvoicev2/serializers.go index 63117046ea3..b7091bdf8d3 100644 --- a/service/pinpointsmsvoicev2/serializers.go +++ b/service/pinpointsmsvoicev2/serializers.go @@ -1602,6 +1602,67 @@ func (m *awsAwsjson10_serializeOpDeleteRegistrationFieldValue) HandleSerialize(c return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDeleteResourcePolicy struct { +} + +func (*awsAwsjson10_serializeOpDeleteResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.DeleteResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteResourcePolicyInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpDeleteTextMessageSpendLimitOverride struct { } @@ -3188,6 +3249,67 @@ func (m *awsAwsjson10_serializeOpGetProtectConfigurationCountryRuleSet) HandleSe return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpGetResourcePolicy struct { +} + +func (*awsAwsjson10_serializeOpGetResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourcePolicyInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.GetResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetResourcePolicyInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpListPoolOriginationIdentities struct { } @@ -3554,6 +3676,67 @@ func (m *awsAwsjson10_serializeOpPutRegistrationFieldValue) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson10_serializeOpPutResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutResourcePolicyInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("PinpointSMSVoiceV2.PutResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentPutResourcePolicyInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpReleasePhoneNumber struct { } @@ -6363,6 +6546,18 @@ func awsAwsjson10_serializeOpDocumentDeleteRegistrationInput(v *DeleteRegistrati return nil } +func awsAwsjson10_serializeOpDocumentDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDeleteTextMessageSpendLimitOverrideInput(v *DeleteTextMessageSpendLimitOverrideInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6547,6 +6742,11 @@ func awsAwsjson10_serializeOpDocumentDescribeOptOutListsInput(v *DescribeOptOutL } } + if len(v.Owner) > 0 { + ok := object.Key("Owner") + ok.String(string(v.Owner)) + } + return nil } @@ -6571,6 +6771,11 @@ func awsAwsjson10_serializeOpDocumentDescribePhoneNumbersInput(v *DescribePhoneN ok.String(*v.NextToken) } + if len(v.Owner) > 0 { + ok := object.Key("Owner") + ok.String(string(v.Owner)) + } + if v.PhoneNumberIds != nil { ok := object.Key("PhoneNumberIds") if err := awsAwsjson10_serializeDocumentPhoneNumberIdList(v.PhoneNumberIds, ok); err != nil { @@ -6602,6 +6807,11 @@ func awsAwsjson10_serializeOpDocumentDescribePoolsInput(v *DescribePoolsInput, v ok.String(*v.NextToken) } + if len(v.Owner) > 0 { + ok := object.Key("Owner") + ok.String(string(v.Owner)) + } + if v.PoolIds != nil { ok := object.Key("PoolIds") if err := awsAwsjson10_serializeDocumentPoolIdList(v.PoolIds, ok); err != nil { @@ -6895,6 +7105,11 @@ func awsAwsjson10_serializeOpDocumentDescribeSenderIdsInput(v *DescribeSenderIds ok.String(*v.NextToken) } + if len(v.Owner) > 0 { + ok := object.Key("Owner") + ok.String(string(v.Owner)) + } + if v.SenderIds != nil { ok := object.Key("SenderIds") if err := awsAwsjson10_serializeDocumentSenderIdList(v.SenderIds, ok); err != nil { @@ -7033,6 +7248,18 @@ func awsAwsjson10_serializeOpDocumentGetProtectConfigurationCountryRuleSetInput( return nil } +func awsAwsjson10_serializeOpDocumentGetResourcePolicyInput(v *GetResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListPoolOriginationIdentitiesInput(v *ListPoolOriginationIdentitiesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7181,6 +7408,23 @@ func awsAwsjson10_serializeOpDocumentPutRegistrationFieldValueInput(v *PutRegist return nil } +func awsAwsjson10_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Policy != nil { + ok := object.Key("Policy") + ok.String(*v.Policy) + } + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentReleasePhoneNumberInput(v *ReleasePhoneNumberInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_DeleteResourcePolicy.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_DeleteResourcePolicy.go.snap new file mode 100644 index 00000000000..d8bff583fd0 --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_DeleteResourcePolicy.go.snap @@ -0,0 +1,41 @@ +DeleteResourcePolicy + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_GetResourcePolicy.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_GetResourcePolicy.go.snap new file mode 100644 index 00000000000..1741bd523b3 --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_GetResourcePolicy.go.snap @@ -0,0 +1,41 @@ +GetResourcePolicy + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot/api_op_PutResourcePolicy.go.snap b/service/pinpointsmsvoicev2/snapshot/api_op_PutResourcePolicy.go.snap new file mode 100644 index 00000000000..8d75a612149 --- /dev/null +++ b/service/pinpointsmsvoicev2/snapshot/api_op_PutResourcePolicy.go.snap @@ -0,0 +1,41 @@ +PutResourcePolicy + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/pinpointsmsvoicev2/snapshot_test.go b/service/pinpointsmsvoicev2/snapshot_test.go index c30b1520e2f..3c60b29fde8 100644 --- a/service/pinpointsmsvoicev2/snapshot_test.go +++ b/service/pinpointsmsvoicev2/snapshot_test.go @@ -374,6 +374,18 @@ func TestCheckSnapshot_DeleteRegistrationFieldValue(t *testing.T) { } } +func TestCheckSnapshot_DeleteResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteTextMessageSpendLimitOverride(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteTextMessageSpendLimitOverride(context.Background(), nil, func(o *Options) { @@ -686,6 +698,18 @@ func TestCheckSnapshot_GetProtectConfigurationCountryRuleSet(t *testing.T) { } } +func TestCheckSnapshot_GetResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListPoolOriginationIdentities(t *testing.T) { svc := New(Options{}) _, err := svc.ListPoolOriginationIdentities(context.Background(), nil, func(o *Options) { @@ -758,6 +782,18 @@ func TestCheckSnapshot_PutRegistrationFieldValue(t *testing.T) { } } +func TestCheckSnapshot_PutResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ReleasePhoneNumber(t *testing.T) { svc := New(Options{}) _, err := svc.ReleasePhoneNumber(context.Background(), nil, func(o *Options) { @@ -1357,6 +1393,18 @@ func TestUpdateSnapshot_DeleteRegistrationFieldValue(t *testing.T) { } } +func TestUpdateSnapshot_DeleteResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteTextMessageSpendLimitOverride(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteTextMessageSpendLimitOverride(context.Background(), nil, func(o *Options) { @@ -1669,6 +1717,18 @@ func TestUpdateSnapshot_GetProtectConfigurationCountryRuleSet(t *testing.T) { } } +func TestUpdateSnapshot_GetResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListPoolOriginationIdentities(t *testing.T) { svc := New(Options{}) _, err := svc.ListPoolOriginationIdentities(context.Background(), nil, func(o *Options) { @@ -1741,6 +1801,18 @@ func TestUpdateSnapshot_PutRegistrationFieldValue(t *testing.T) { } } +func TestUpdateSnapshot_PutResourcePolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutResourcePolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutResourcePolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ReleasePhoneNumber(t *testing.T) { svc := New(Options{}) _, err := svc.ReleasePhoneNumber(context.Background(), nil, func(o *Options) { diff --git a/service/pinpointsmsvoicev2/types/enums.go b/service/pinpointsmsvoicev2/types/enums.go index 7e4df92fc51..7cdf1bd1c31 100644 --- a/service/pinpointsmsvoicev2/types/enums.go +++ b/service/pinpointsmsvoicev2/types/enums.go @@ -568,6 +568,25 @@ func (OptedOutFilterName) Values() []OptedOutFilterName { } } +type Owner string + +// Enum values for Owner +const ( + OwnerSelf Owner = "SELF" + OwnerShared Owner = "SHARED" +) + +// Values returns all known values for Owner. 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 (Owner) Values() []Owner { + return []Owner{ + "SELF", + "SHARED", + } +} + type PhoneNumberFilterName string // Enum values for PhoneNumberFilterName @@ -954,6 +973,7 @@ const ( ResourceTypeRegistrationAttachment ResourceType = "registration-attachment" ResourceTypeVerifiedDestinationNumber ResourceType = "verified-destination-number" ResourceTypeProtectConfiguration ResourceType = "protect-configuration" + ResourceTypePolicy ResourceType = "policy" ) // Values returns all known values for ResourceType. Note that this can be @@ -975,6 +995,7 @@ func (ResourceType) Values() []ResourceType { "registration-attachment", "verified-destination-number", "protect-configuration", + "policy", } } diff --git a/service/pinpointsmsvoicev2/validators.go b/service/pinpointsmsvoicev2/validators.go index 47806359f83..42c8cb2bd73 100644 --- a/service/pinpointsmsvoicev2/validators.go +++ b/service/pinpointsmsvoicev2/validators.go @@ -490,6 +490,26 @@ func (m *validateOpDeleteRegistration) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDeleteResourcePolicy struct { +} + +func (*validateOpDeleteResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteVerifiedDestinationNumber struct { } @@ -890,6 +910,26 @@ func (m *validateOpGetProtectConfigurationCountryRuleSet) HandleInitialize(ctx c return next.HandleInitialize(ctx, in) } +type validateOpGetResourcePolicy struct { +} + +func (*validateOpGetResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListPoolOriginationIdentities struct { } @@ -1010,6 +1050,26 @@ func (m *validateOpPutRegistrationFieldValue) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpPutResourcePolicy struct { +} + +func (*validateOpPutResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpReleasePhoneNumber struct { } @@ -1586,6 +1646,10 @@ func addOpDeleteRegistrationValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDeleteRegistration{}, middleware.After) } +func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) +} + func addOpDeleteVerifiedDestinationNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteVerifiedDestinationNumber{}, middleware.After) } @@ -1666,6 +1730,10 @@ func addOpGetProtectConfigurationCountryRuleSetValidationMiddleware(stack *middl return stack.Initialize.Add(&validateOpGetProtectConfigurationCountryRuleSet{}, middleware.After) } +func addOpGetResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourcePolicy{}, middleware.After) +} + func addOpListPoolOriginationIdentitiesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPoolOriginationIdentities{}, middleware.After) } @@ -1690,6 +1758,10 @@ func addOpPutRegistrationFieldValueValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpPutRegistrationFieldValue{}, middleware.After) } +func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) +} + func addOpReleasePhoneNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpReleasePhoneNumber{}, middleware.After) } @@ -2887,6 +2959,21 @@ func validateOpDeleteRegistrationInput(v *DeleteRegistrationInput) error { } } +func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteVerifiedDestinationNumberInput(v *DeleteVerifiedDestinationNumberInput) error { if v == nil { return nil @@ -3237,6 +3324,21 @@ func validateOpGetProtectConfigurationCountryRuleSetInput(v *GetProtectConfigura } } +func validateOpGetResourcePolicyInput(v *GetResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListPoolOriginationIdentitiesInput(v *ListPoolOriginationIdentitiesInput) error { if v == nil { return nil @@ -3349,6 +3451,24 @@ func validateOpPutRegistrationFieldValueInput(v *PutRegistrationFieldValueInput) } } +func validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpReleasePhoneNumberInput(v *ReleasePhoneNumberInput) error { if v == nil { return nil diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index 4d2743dfccf..e55b19141c4 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -52592,6 +52592,42 @@ func awsAwsjson11_deserializeDocumentHiddenAppTypesList(v *[]types.AppType, valu return nil } +func awsAwsjson11_deserializeDocumentHiddenInstanceTypesList(v *[]types.AppInstanceType, 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.AppInstanceType + if *v == nil { + cv = []types.AppInstanceType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AppInstanceType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppInstanceType to be of type string, got %T instead", value) + } + col = types.AppInstanceType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentHiddenMlToolsList(v *[]types.MlTools, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -52628,6 +52664,85 @@ func awsAwsjson11_deserializeDocumentHiddenMlToolsList(v *[]types.MlTools, value return nil } +func awsAwsjson11_deserializeDocumentHiddenSageMakerImage(v **types.HiddenSageMakerImage, 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.HiddenSageMakerImage + if *v == nil { + sv = &types.HiddenSageMakerImage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SageMakerImageName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SageMakerImageName to be of type string, got %T instead", value) + } + sv.SageMakerImageName = types.SageMakerImageName(jtv) + } + + case "VersionAliases": + if err := awsAwsjson11_deserializeDocumentVersionAliasesList(&sv.VersionAliases, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentHiddenSageMakerImageVersionAliasesList(v *[]types.HiddenSageMakerImage, 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.HiddenSageMakerImage + if *v == nil { + cv = []types.HiddenSageMakerImage{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.HiddenSageMakerImage + destAddr := &col + if err := awsAwsjson11_deserializeDocumentHiddenSageMakerImage(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentHolidayConfig(v *[]types.HolidayConfigAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -77124,11 +77239,21 @@ func awsAwsjson11_deserializeDocumentStudioWebPortalSettings(v **types.StudioWeb return err } + case "HiddenInstanceTypes": + if err := awsAwsjson11_deserializeDocumentHiddenInstanceTypesList(&sv.HiddenInstanceTypes, value); err != nil { + return err + } + case "HiddenMlTools": if err := awsAwsjson11_deserializeDocumentHiddenMlToolsList(&sv.HiddenMlTools, value); err != nil { return err } + case "HiddenSageMakerImageVersionAliases": + if err := awsAwsjson11_deserializeDocumentHiddenSageMakerImageVersionAliasesList(&sv.HiddenSageMakerImageVersionAliases, value); err != nil { + return err + } + default: _, _ = key, value @@ -82502,6 +82627,42 @@ func awsAwsjson11_deserializeDocumentVectorConfig(v **types.VectorConfig, value return nil } +func awsAwsjson11_deserializeDocumentVersionAliasesList(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 ImageVersionAliasPattern to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentVertex(v **types.Vertex, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/sagemaker/serializers.go b/service/sagemaker/serializers.go index 98192f9846e..b57d1a91c39 100644 --- a/service/sagemaker/serializers.go +++ b/service/sagemaker/serializers.go @@ -24602,6 +24602,17 @@ func awsAwsjson11_serializeDocumentHiddenAppTypesList(v []types.AppType, value s return nil } +func awsAwsjson11_serializeDocumentHiddenInstanceTypesList(v []types.AppInstanceType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsAwsjson11_serializeDocumentHiddenMlToolsList(v []types.MlTools, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -24613,6 +24624,38 @@ func awsAwsjson11_serializeDocumentHiddenMlToolsList(v []types.MlTools, value sm return nil } +func awsAwsjson11_serializeDocumentHiddenSageMakerImage(v *types.HiddenSageMakerImage, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.SageMakerImageName) > 0 { + ok := object.Key("SageMakerImageName") + ok.String(string(v.SageMakerImageName)) + } + + if v.VersionAliases != nil { + ok := object.Key("VersionAliases") + if err := awsAwsjson11_serializeDocumentVersionAliasesList(v.VersionAliases, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentHiddenSageMakerImageVersionAliasesList(v []types.HiddenSageMakerImage, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentHiddenSageMakerImage(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentHolidayConfig(v []types.HolidayConfigAttributes, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -30500,6 +30543,13 @@ func awsAwsjson11_serializeDocumentStudioWebPortalSettings(v *types.StudioWebPor } } + if v.HiddenInstanceTypes != nil { + ok := object.Key("HiddenInstanceTypes") + if err := awsAwsjson11_serializeDocumentHiddenInstanceTypesList(v.HiddenInstanceTypes, ok); err != nil { + return err + } + } + if v.HiddenMlTools != nil { ok := object.Key("HiddenMlTools") if err := awsAwsjson11_serializeDocumentHiddenMlToolsList(v.HiddenMlTools, ok); err != nil { @@ -30507,6 +30557,13 @@ func awsAwsjson11_serializeDocumentStudioWebPortalSettings(v *types.StudioWebPor } } + if v.HiddenSageMakerImageVersionAliases != nil { + ok := object.Key("HiddenSageMakerImageVersionAliases") + if err := awsAwsjson11_serializeDocumentHiddenSageMakerImageVersionAliasesList(v.HiddenSageMakerImageVersionAliases, ok); err != nil { + return err + } + } + return nil } @@ -31724,6 +31781,17 @@ func awsAwsjson11_serializeDocumentVectorConfig(v *types.VectorConfig, value smi return nil } +func awsAwsjson11_serializeDocumentVersionAliasesList(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_serializeDocumentVisibilityConditions(v *types.VisibilityConditions, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/sagemaker/types/enums.go b/service/sagemaker/types/enums.go index 3c2d49a537d..5e817614c8c 100644 --- a/service/sagemaker/types/enums.go +++ b/service/sagemaker/types/enums.go @@ -3966,6 +3966,7 @@ const ( MlToolsEndpoints MlTools = "Endpoints" MlToolsProjects MlTools = "Projects" MlToolsInferenceOptimization MlTools = "InferenceOptimization" + MlToolsPerformanceEvaluation MlTools = "PerformanceEvaluation" ) // Values returns all known values for MlTools. Note that this can be expanded in @@ -3988,6 +3989,7 @@ func (MlTools) Values() []MlTools { "Endpoints", "Projects", "InferenceOptimization", + "PerformanceEvaluation", } } @@ -6292,6 +6294,23 @@ func (S3ModelDataType) Values() []S3ModelDataType { } } +type SageMakerImageName string + +// Enum values for SageMakerImageName +const ( + SageMakerImageNameSagemakerDistribution SageMakerImageName = "sagemaker_distribution" +) + +// Values returns all known values for SageMakerImageName. 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 (SageMakerImageName) Values() []SageMakerImageName { + return []SageMakerImageName{ + "sagemaker_distribution", + } +} + type SagemakerServicecatalogStatus string // Enum values for SagemakerServicecatalogStatus diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index 521c07a0063..329be9e5ca3 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -6451,6 +6451,19 @@ type GitConfigForUpdate struct { noSmithyDocumentSerde } +// The SageMaker images that are hidden from the Studio user interface. You must +// specify the SageMaker image name and version aliases. +type HiddenSageMakerImage struct { + + // The SageMaker image name that you are hiding from the Studio user interface. + SageMakerImageName SageMakerImageName + + // The version aliases you are hiding from the Studio user interface. + VersionAliases []string + + noSmithyDocumentSerde +} + // Stores the holiday featurization attributes applicable to each item of // time-series datasets during the training of a forecasting model. This allows the // model to identify patterns associated with specific holidays. @@ -6906,15 +6919,62 @@ type HumanLoopRequestSource struct { // Information required for human workers to complete a labeling task. type HumanTaskConfig struct { - // Configures how labels are consolidated across human workers. + // The number of human workers that will label an object. // // This member is required. - AnnotationConsolidationConfig *AnnotationConsolidationConfig + NumberOfHumanWorkersPerDataObject *int32 - // The number of human workers that will label an object. + // A description of the task for your human workers. // // This member is required. - NumberOfHumanWorkersPerDataObject *int32 + TaskDescription *string + + // The amount of time that a worker has to complete a task. + // + // If you create a custom labeling job, the maximum value for this parameter is 8 + // hours (28,800 seconds). + // + // If you create a labeling job using a [built-in task type] the maximum for this parameter depends on + // the task type you use: + // + // - For [image]and [text]labeling jobs, the maximum is 8 hours (28,800 seconds). + // + // - For [3D point cloud]and [video frame]labeling jobs, the maximum is 30 days (2952,000 seconds) for non-AL + // mode. For most users, the maximum is also 30 days. + // + // [built-in task type]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-task-types.html + // [image]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-label-images.html + // [video frame]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-video.html + // [3D point cloud]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-point-cloud.html + // [text]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-label-text.html + // + // This member is required. + TaskTimeLimitInSeconds *int32 + + // A title for the task for your human workers. + // + // This member is required. + TaskTitle *string + + // Information about the user interface that workers use to complete the labeling + // task. + // + // This member is required. + UiConfig *UiConfig + + // The Amazon Resource Name (ARN) of the work team assigned to complete the tasks. + // + // This member is required. + WorkteamArn *string + + // Configures how labels are consolidated across human workers. + AnnotationConsolidationConfig *AnnotationConsolidationConfig + + // Defines the maximum number of data objects that can be labeled by human workers + // at the same time. Also referred to as batch size. Each object may have more than + // one worker at one time. The default value is 1000 objects. To increase the + // maximum value to 5000 objects, contact Amazon Web Services Support. + MaxConcurrentTaskCount *int32 // The Amazon Resource Name (ARN) of a Lambda function that is run before a data // object is sent to a human worker. Use this function to provide input to a custom @@ -7699,59 +7759,8 @@ type HumanTaskConfig struct { // [3D Point Cloud Task types]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-point-cloud-task-types.html // [Pre-annotation Lambda]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-custom-templates-step3.html#sms-custom-templates-step3-prelambda // [Verify and Adjust Labels]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-verification-data.html - // - // This member is required. PreHumanTaskLambdaArn *string - // A description of the task for your human workers. - // - // This member is required. - TaskDescription *string - - // The amount of time that a worker has to complete a task. - // - // If you create a custom labeling job, the maximum value for this parameter is 8 - // hours (28,800 seconds). - // - // If you create a labeling job using a [built-in task type] the maximum for this parameter depends on - // the task type you use: - // - // - For [image]and [text]labeling jobs, the maximum is 8 hours (28,800 seconds). - // - // - For [3D point cloud]and [video frame]labeling jobs, the maximum is 30 days (2952,000 seconds) for non-AL - // mode. For most users, the maximum is also 30 days. - // - // [built-in task type]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-task-types.html - // [image]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-label-images.html - // [video frame]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-video.html - // [3D point cloud]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-point-cloud.html - // [text]: https://docs.aws.amazon.com/sagemaker/latest/dg/sms-label-text.html - // - // This member is required. - TaskTimeLimitInSeconds *int32 - - // A title for the task for your human workers. - // - // This member is required. - TaskTitle *string - - // Information about the user interface that workers use to complete the labeling - // task. - // - // This member is required. - UiConfig *UiConfig - - // The Amazon Resource Name (ARN) of the work team assigned to complete the tasks. - // - // This member is required. - WorkteamArn *string - - // Defines the maximum number of data objects that can be labeled by human workers - // at the same time. Also referred to as batch size. Each object may have more than - // one worker at one time. The default value is 1000 objects. To increase the - // maximum value to 5000 objects, contact Amazon Web Services Support. - MaxConcurrentTaskCount *int32 - // The price that you pay for each task performed by an Amazon Mechanical Turk // worker. PublicWorkforceTaskPrice *PublicWorkforceTaskPrice @@ -10047,12 +10056,6 @@ type LabelingJobSummary struct { // This member is required. LastModifiedTime *time.Time - // The Amazon Resource Name (ARN) of a Lambda function. The function is run before - // each data object is sent to a worker. - // - // This member is required. - PreHumanTaskLambdaArn *string - // The Amazon Resource Name (ARN) of the work team assigned to the job. // // This member is required. @@ -10075,6 +10078,10 @@ type LabelingJobSummary struct { // The location of the output produced by the labeling job. LabelingJobOutput *LabelingJobOutput + // The Amazon Resource Name (ARN) of a Lambda function. The function is run before + // each data object is sent to a worker. + PreHumanTaskLambdaArn *string + noSmithyDocumentSerde } @@ -16876,9 +16883,15 @@ type StudioWebPortalSettings struct { // [Applications supported in Studio]: https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-apps.html HiddenAppTypes []AppType + // The instance types you are hiding from the Studio user interface. + HiddenInstanceTypes []AppInstanceType + // The machine learning tools that are hidden from the Studio left navigation pane. HiddenMlTools []MlTools + // The version aliases you are hiding from the Studio user interface. + HiddenSageMakerImageVersionAliases []HiddenSageMakerImage + noSmithyDocumentSerde } diff --git a/service/sagemaker/validators.go b/service/sagemaker/validators.go index 26ba1e87aa5..194048296e1 100644 --- a/service/sagemaker/validators.go +++ b/service/sagemaker/validators.go @@ -9080,9 +9080,6 @@ func validateHumanTaskConfig(v *types.HumanTaskConfig) error { if v.UiConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("UiConfig")) } - if v.PreHumanTaskLambdaArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PreHumanTaskLambdaArn")) - } if v.TaskTitle == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskTitle")) } @@ -9095,9 +9092,7 @@ func validateHumanTaskConfig(v *types.HumanTaskConfig) error { if v.TaskTimeLimitInSeconds == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskTimeLimitInSeconds")) } - if v.AnnotationConsolidationConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("AnnotationConsolidationConfig")) - } else if v.AnnotationConsolidationConfig != nil { + if v.AnnotationConsolidationConfig != nil { if err := validateAnnotationConsolidationConfig(v.AnnotationConsolidationConfig); err != nil { invalidParams.AddNested("AnnotationConsolidationConfig", err.(smithy.InvalidParamsError)) }