diff --git a/.changelog/0466a4eee9aa47108610bde2a17427dd.json b/.changelog/0466a4eee9aa47108610bde2a17427dd.json new file mode 100644 index 00000000000..c8391283a15 --- /dev/null +++ b/.changelog/0466a4eee9aa47108610bde2a17427dd.json @@ -0,0 +1,8 @@ +{ + "id": "0466a4ee-e9aa-4710-8610-bde2a17427dd", + "type": "feature", + "description": "AWS Elemental MediaConvert SDK now supports conversion of 608 paint-on captions to pop-on captions for SCC sources.", + "modules": [ + "service/mediaconvert" + ] +} \ No newline at end of file diff --git a/.changelog/3c76b0e359084320a0a2b841c1e306b3.json b/.changelog/3c76b0e359084320a0a2b841c1e306b3.json new file mode 100644 index 00000000000..da1ba2950af --- /dev/null +++ b/.changelog/3c76b0e359084320a0a2b841c1e306b3.json @@ -0,0 +1,8 @@ +{ + "id": "3c76b0e3-5908-4320-a0a2-b841c1e306b3", + "type": "feature", + "description": "Added three new APIs to support resource sharing: GetResourcePolicy, PutResourcePolicy, and DeleteResourcePolicy. Added new OwnershipType field to ListEntities request to let users filter on entities that are shared with them. Increased max page size of ListEntities response from 20 to 50 results.", + "modules": [ + "service/marketplacecatalog" + ] +} \ No newline at end of file diff --git a/.changelog/4c04e5f4cd144831a176672066b10c93.json b/.changelog/4c04e5f4cd144831a176672066b10c93.json new file mode 100644 index 00000000000..034ebb52dca --- /dev/null +++ b/.changelog/4c04e5f4cd144831a176672066b10c93.json @@ -0,0 +1,8 @@ +{ + "id": "4c04e5f4-cd14-4831-a176-672066b10c93", + "type": "feature", + "description": "This release adds the ability to configure an agent's routing profile to receive contacts from multiple channels at the same time via extending the UpdateRoutingProfileConcurrency, CreateRoutingProfile and DescribeRoutingProfile APIs.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/82df18402f05491cb3075bd17f534999.json b/.changelog/82df18402f05491cb3075bd17f534999.json new file mode 100644 index 00000000000..739a5d51023 --- /dev/null +++ b/.changelog/82df18402f05491cb3075bd17f534999.json @@ -0,0 +1,8 @@ +{ + "id": "82df1840-2f05-491c-b307-5bd17f534999", + "type": "feature", + "description": "This release adds support for enabling FIPS compliance on Amazon ECS Fargate tasks", + "modules": [ + "service/ecs" + ] +} \ No newline at end of file diff --git a/.changelog/af750069274f456e8bc03573382b2a1e.json b/.changelog/af750069274f456e8bc03573382b2a1e.json new file mode 100644 index 00000000000..4dd92edf688 --- /dev/null +++ b/.changelog/af750069274f456e8bc03573382b2a1e.json @@ -0,0 +1,8 @@ +{ + "id": "af750069-274f-456e-8bc0-3573382b2a1e", + "type": "feature", + "description": "This release adds support for Face Liveness APIs in Amazon Rekognition. Updates UpdateStreamProcessor to return ResourceInUseException Exception. Minor updates to API documentation.", + "modules": [ + "service/rekognition" + ] +} \ No newline at end of file diff --git a/.changelog/ba283993ba174f088987002a4dd48c1c.json b/.changelog/ba283993ba174f088987002a4dd48c1c.json new file mode 100644 index 00000000000..763e6c7f1dc --- /dev/null +++ b/.changelog/ba283993ba174f088987002a4dd48c1c.json @@ -0,0 +1,8 @@ +{ + "id": "ba283993-ba17-4f08-8987-002a4dd48c1c", + "type": "feature", + "description": "Remove unexpected API changes.", + "modules": [ + "service/omics" + ] +} \ No newline at end of file diff --git a/service/amplifybackend/internal/endpoints/endpoints.go b/service/amplifybackend/internal/endpoints/endpoints.go index 3daebcc9849..1387c979b0b 100644 --- a/service/amplifybackend/internal/endpoints/endpoints.go +++ b/service/amplifybackend/internal/endpoints/endpoints.go @@ -159,6 +159,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, diff --git a/service/amplifyuibuilder/internal/endpoints/endpoints.go b/service/amplifyuibuilder/internal/endpoints/endpoints.go index 11eac107c67..3766b15d9d9 100644 --- a/service/amplifyuibuilder/internal/endpoints/endpoints.go +++ b/service/amplifyuibuilder/internal/endpoints/endpoints.go @@ -159,6 +159,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, diff --git a/service/connect/api_op_GetMetricDataV2.go b/service/connect/api_op_GetMetricDataV2.go index 0ff3a228bb0..4d66da41fb2 100644 --- a/service/connect/api_op_GetMetricDataV2.go +++ b/service/connect/api_op_GetMetricDataV2.go @@ -42,8 +42,8 @@ type GetMetricDataV2Input struct { // The timestamp, in UNIX Epoch time format, at which to end the reporting // interval for the retrieval of historical metrics data. The time must be later - // than the start time timestamp. The time range between the start and end time - // must be less than 24 hours. + // than the start time timestamp. It cannot be later than the current timestamp. + // The time range between the start and end time must be less than 24 hours. // // This member is required. EndTime *time.Time @@ -124,11 +124,15 @@ type GetMetricDataV2Input struct { // Profile Threshold: For ThresholdValue , enter any whole number from 1 to 604800 // (inclusive), in seconds. For Comparison , you must enter LT (for "Less than"). // SUM_CONTACTS_ANSWERED_IN_X Unit: Count Valid groupings and filters: Queue, - // Channel, Routing Profile SUM_CONTACTS_ABANDONED_IN_X Unit: Count Valid groupings - // and filters: Queue, Channel, Routing Profile SUM_CONTACTS_DISCONNECTED Valid - // metric filter key: DISCONNECT_REASON Unit: Count Valid groupings and filters: - // Queue, Channel, Routing Profile SUM_RETRY_CALLBACK_ATTEMPTS Unit: Count Valid - // groupings and filters: Queue, Channel, Routing Profile + // Channel, Routing Profile Threshold: For ThresholdValue , enter any whole number + // from 1 to 604800 (inclusive), in seconds. For Comparison , you must enter LT + // (for "Less than"). SUM_CONTACTS_ABANDONED_IN_X Unit: Count Valid groupings and + // filters: Queue, Channel, Routing Profile Threshold: For ThresholdValue , enter + // any whole number from 1 to 604800 (inclusive), in seconds. For Comparison , you + // must enter LT (for "Less than"). SUM_CONTACTS_DISCONNECTED Valid metric filter + // key: DISCONNECT_REASON Unit: Count Valid groupings and filters: Queue, Channel, + // Routing Profile SUM_RETRY_CALLBACK_ATTEMPTS Unit: Count Valid groupings and + // filters: Queue, Channel, Routing Profile // // This member is required. Metrics []types.MetricV2 diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index 888525ac04e..f37ed79efc9 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -26446,6 +26446,46 @@ func awsRestjson1_deserializeDocumentCredentials(v **types.Credentials, value in return nil } +func awsRestjson1_deserializeDocumentCrossChannelBehavior(v **types.CrossChannelBehavior, 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.CrossChannelBehavior + if *v == nil { + sv = &types.CrossChannelBehavior{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BehaviorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BehaviorType to be of type string, got %T instead", value) + } + sv.BehaviorType = types.BehaviorType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentCurrentMetric(v **types.CurrentMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -29688,6 +29728,11 @@ func awsRestjson1_deserializeDocumentMediaConcurrency(v **types.MediaConcurrency sv.Concurrency = int32(i64) } + case "CrossChannelBehavior": + if err := awsRestjson1_deserializeDocumentCrossChannelBehavior(&sv.CrossChannelBehavior, value); err != nil { + return err + } + default: _, _ = key, value diff --git a/service/connect/serializers.go b/service/connect/serializers.go index a2e12f96cce..df2e9add44e 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -14275,6 +14275,18 @@ func awsRestjson1_serializeDocumentControlPlaneTagFilter(v *types.ControlPlaneTa return nil } +func awsRestjson1_serializeDocumentCrossChannelBehavior(v *types.CrossChannelBehavior, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.BehaviorType) > 0 { + ok := object.Key("BehaviorType") + ok.String(string(v.BehaviorType)) + } + + return nil +} + func awsRestjson1_serializeDocumentCurrentMetric(v *types.CurrentMetric, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -14832,6 +14844,13 @@ func awsRestjson1_serializeDocumentMediaConcurrency(v *types.MediaConcurrency, v ok.Integer(v.Concurrency) } + if v.CrossChannelBehavior != nil { + ok := object.Key("CrossChannelBehavior") + if err := awsRestjson1_serializeDocumentCrossChannelBehavior(v.CrossChannelBehavior, ok); err != nil { + return err + } + } + return nil } diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index 34018de4a24..ba31c431e5b 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -62,6 +62,24 @@ func (AgentStatusType) Values() []AgentStatusType { } } +type BehaviorType string + +// Enum values for BehaviorType +const ( + BehaviorTypeRouteCurrentChannelOnly BehaviorType = "ROUTE_CURRENT_CHANNEL_ONLY" + BehaviorTypeRouteAnyChannel BehaviorType = "ROUTE_ANY_CHANNEL" +) + +// Values returns all known values for BehaviorType. 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 (BehaviorType) Values() []BehaviorType { + return []BehaviorType{ + "ROUTE_CURRENT_CHANNEL_ONLY", + "ROUTE_ANY_CHANNEL", + } +} + type Channel string // Enum values for Channel diff --git a/service/connect/types/types.go b/service/connect/types/types.go index deec6f39045..db13df87d82 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -196,12 +196,15 @@ type ChatMessage struct { // Maximum of 1024. // - For application/json , the Length Constraints are Minimum of 1, Maximum of // 12000. + // - For application/vnd.amazonaws.connect.message.interactive.response , the + // Length Constraints are Minimum of 1, Maximum of 12288. // // This member is required. Content *string - // The type of the content. Supported types are text/plain , text/markdown , and - // application/json . + // The type of the content. Supported types are text/plain , text/markdown , + // application/json , and + // application/vnd.amazonaws.connect.message.interactive.response . // // This member is required. ContentType *string @@ -505,6 +508,19 @@ type Credentials struct { noSmithyDocumentSerde } +// Defines the cross-channel routing behavior that allows an agent working on a +// contact in one channel to be offered a contact from a different channel. +type CrossChannelBehavior struct { + + // Specifies the other channels that can be routed to an agent handling their + // current channel. + // + // This member is required. + BehaviorType BehaviorType + + noSmithyDocumentSerde +} + // Contains information about a real-time metric. For a description of each // metric, see Real-time Metrics Definitions (https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html) // in the Amazon Connect Administrator Guide. @@ -1274,6 +1290,12 @@ type MediaConcurrency struct { // This member is required. Concurrency int32 + // Defines the cross-channel routing behavior for each channel that is enabled for + // this Routing Profile. For example, this allows you to offer an agent a different + // contact from another channel when they are currently working with a contact from + // a Voice channel. + CrossChannelBehavior *CrossChannelBehavior + noSmithyDocumentSerde } diff --git a/service/connect/validators.go b/service/connect/validators.go index eb4d9b5e0b6..547fb8ee797 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -4064,6 +4064,21 @@ func validateContactReferences(v map[string]types.Reference) error { } } +func validateCrossChannelBehavior(v *types.CrossChannelBehavior) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CrossChannelBehavior"} + if len(v.BehaviorType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("BehaviorType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDistribution(v *types.Distribution) error { if v == nil { return nil @@ -4375,6 +4390,11 @@ func validateMediaConcurrency(v *types.MediaConcurrency) error { if len(v.Channel) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Channel")) } + if v.CrossChannelBehavior != nil { + if err := validateCrossChannelBehavior(v.CrossChannelBehavior); err != nil { + invalidParams.AddNested("CrossChannelBehavior", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/ecs/api_op_CreateService.go b/service/ecs/api_op_CreateService.go index 37844de65b8..57d6cacd5ac 100644 --- a/service/ecs/api_op_CreateService.go +++ b/service/ecs/api_op_CreateService.go @@ -151,7 +151,7 @@ type CreateServiceInput struct { // in the Amazon Elastic Container Service Developer Guide. EnableECSManagedTags bool - // Determines whether the execute command functionality is enabled for the + // Determines whether the execute command functionality is turned on for the // service. If true , this enables execute command functionality on all containers // in the service tasks. EnableExecuteCommand bool @@ -334,7 +334,9 @@ type CreateServiceInput struct { // The family and revision ( family:revision ) or full ARN of the task definition // to run in your service. If a revision isn't specified, the latest ACTIVE // revision is used. A task definition must be specified if the service uses either - // the ECS or CODE_DEPLOY deployment controllers. + // the ECS or CODE_DEPLOY deployment controllers. For more information about + // deployment types, see Amazon ECS deployment types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) + // . TaskDefinition *string noSmithyDocumentSerde diff --git a/service/ecs/api_op_ExecuteCommand.go b/service/ecs/api_op_ExecuteCommand.go index a0bde09650e..0991add517b 100644 --- a/service/ecs/api_op_ExecuteCommand.go +++ b/service/ecs/api_op_ExecuteCommand.go @@ -16,7 +16,7 @@ import ( // example limit the actions to a specific cluster, you receive an // AccessDeniedException when there is a mismatch between the condition key value // and the corresponding parameter value. For information about required -// permissions and considerations, see Using Amazon ECS Exec for debugging (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.htm) +// permissions and considerations, see Using Amazon ECS Exec for debugging (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) // in the Amazon ECS Developer Guide. func (c *Client) ExecuteCommand(ctx context.Context, params *ExecuteCommandInput, optFns ...func(*Options)) (*ExecuteCommandOutput, error) { if params == nil { diff --git a/service/ecs/api_op_GetTaskProtection.go b/service/ecs/api_op_GetTaskProtection.go index 2536a296356..5957f73a9a6 100644 --- a/service/ecs/api_op_GetTaskProtection.go +++ b/service/ecs/api_op_GetTaskProtection.go @@ -49,7 +49,8 @@ type GetTaskProtectionOutput struct { // A list of tasks with the following information. // - taskArn : The task ARN. // - protectionEnabled : The protection status of the task. If scale-in - // protection is enabled for a task, the value is true . Otherwise, it is false . + // protection is turned on for a task, the value is true . Otherwise, it is false + // . // - expirationDate : The epoch time when protection for the task will expire. ProtectedTasks []types.ProtectedTask diff --git a/service/ecs/api_op_PutAccountSetting.go b/service/ecs/api_op_PutAccountSetting.go index 1907aa1875a..f0540ca2c6c 100644 --- a/service/ecs/api_op_PutAccountSetting.go +++ b/service/ecs/api_op_PutAccountSetting.go @@ -12,9 +12,9 @@ import ( ) // Modifies an account setting. Account settings are set on a per-Region basis. If -// you change the account setting for the root user, the default settings for all -// of the users and roles that no individual account setting was specified are -// reset for. For more information, see Account Settings (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html) +// you change the root user account setting, the default settings are reset for +// users and roles that do not have specified individual account settings. For more +// information, see Account Settings (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html) // in the Amazon Elastic Container Service Developer Guide. When // serviceLongArnFormat , taskLongArnFormat , or containerInstanceLongArnFormat // are specified, the Amazon Resource Name (ARN) and resource ID format of the @@ -25,15 +25,15 @@ import ( // on this setting to use Amazon ECS features such as resource tagging. When // awsvpcTrunking is specified, the elastic network interface (ENI) limit for any // new container instances that support the feature is changed. If awsvpcTrunking -// is enabled, any new container instances that support the feature are launched +// is turned on, any new container instances that support the feature are launched // have the increased ENI limits available to them. For more information, see // Elastic Network Interface Trunking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-eni.html) // in the Amazon Elastic Container Service Developer Guide. When containerInsights -// is specified, the default setting indicating whether CloudWatch Container -// Insights is enabled for your clusters is changed. If containerInsights is -// enabled, any new clusters that are created will have Container Insights enabled -// unless you disable it during cluster creation. For more information, see -// CloudWatch Container Insights (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-container-insights.html) +// is specified, the default setting indicating whether Amazon Web Services +// CloudWatch Container Insights is turned on for your clusters is changed. If +// containerInsights is turned on, any new clusters that are created will have +// Container Insights turned on unless you disable it during cluster creation. For +// more information, see CloudWatch Container Insights (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-container-insights.html) // in the Amazon Elastic Container Service Developer Guide. func (c *Client) PutAccountSetting(ctx context.Context, params *PutAccountSettingInput, optFns ...func(*Options)) (*PutAccountSettingOutput, error) { if params == nil { @@ -59,8 +59,9 @@ type PutAccountSettingInput struct { // the ARN and resource ID for your Amazon ECS container instances is affected. If // awsvpcTrunking is specified, the elastic network interface (ENI) limit for your // Amazon ECS container instances is affected. If containerInsights is specified, - // the default setting for CloudWatch Container Insights for your clusters is - // affected. + // the default setting for Amazon Web Services CloudWatch Container Insights for + // your clusters is affected. If fargateFIPSMode is specified, Fargate FIPS 140 + // compliance is affected. // // This member is required. Name types.SettingName diff --git a/service/ecs/api_op_PutAccountSettingDefault.go b/service/ecs/api_op_PutAccountSettingDefault.go index 751cf9f10e7..7e1c1591c98 100644 --- a/service/ecs/api_op_PutAccountSettingDefault.go +++ b/service/ecs/api_op_PutAccountSettingDefault.go @@ -38,11 +38,12 @@ type PutAccountSettingDefaultInput struct { // the ARN and resource ID for your Amazon ECS container instances is affected. If // awsvpcTrunking is specified, the ENI limit for your Amazon ECS container // instances is affected. If containerInsights is specified, the default setting - // for CloudWatch Container Insights for your clusters is affected. Fargate is - // transitioning from task count-based quotas to vCPU-based quotas. You can set the - // name to fargateVCPULimit to opt in or opt out of the vCPU-based quotas. For - // information about the opt in timeline, see Fargate vCPU-based quotas timeline (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#fargate-quota-timeline) - // in the Amazon ECS Developer Guide. + // for Amazon Web Services CloudWatch Container Insights for your clusters is + // affected. When you specify fargateFIPSMode for the name and enabled for the + // value , Fargate uses FIPS-140 compliant cryptographic algorithms on your tasks. + // For more information about FIPS-140 compliance with Fargate, see Amazon Web + // Services Fargate Federal Information Processing Standard (FIPS) 140-2 compliance (https://docs.aws.amazon.com/AWSEC2ContainerServiceDocs/build/server-root/AmazonECS/latest/developerguide/ecs-fips-compliance.html) + // in the Amazon Elastic Container Service Developer Guide. // // This member is required. Name types.SettingName diff --git a/service/ecs/api_op_RegisterTaskDefinition.go b/service/ecs/api_op_RegisterTaskDefinition.go index 793ed474081..86b774f6fc2 100644 --- a/service/ecs/api_op_RegisterTaskDefinition.go +++ b/service/ecs/api_op_RegisterTaskDefinition.go @@ -93,8 +93,8 @@ type RegisterTaskDefinitionInput struct { // used to expand the total amount of ephemeral storage available, beyond the // default amount, for tasks hosted on Fargate. For more information, see Fargate // task storage (https://docs.aws.amazon.com/AmazonECS/latest/userguide/using_data_volumes.html) - // in the Amazon ECS User Guide for Fargate. This parameter is only supported for - // tasks hosted on Fargate using the following platform versions: + // in the Amazon ECS User Guide for Fargate. For tasks using the Fargate launch + // type, the task requires the following platforms: // - Linux platform version 1.4.0 or later. EphemeralStorage *types.EphemeralStorage diff --git a/service/ecs/api_op_StartTask.go b/service/ecs/api_op_StartTask.go index 02cb3a6d604..2de69323ab5 100644 --- a/service/ecs/api_op_StartTask.go +++ b/service/ecs/api_op_StartTask.go @@ -61,7 +61,7 @@ type StartTaskInput struct { // in the Amazon Elastic Container Service Developer Guide. EnableECSManagedTags bool - // Whether or not the execute command functionality is enabled for the task. If + // Whether or not the execute command functionality is turned on for the task. If // true , this enables execute command functionality on all containers in the task. EnableExecuteCommand bool diff --git a/service/ecs/api_op_UpdateTaskProtection.go b/service/ecs/api_op_UpdateTaskProtection.go index 16b737fb128..e55f9843b03 100644 --- a/service/ecs/api_op_UpdateTaskProtection.go +++ b/service/ecs/api_op_UpdateTaskProtection.go @@ -16,7 +16,7 @@ import ( // Autoscaling (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html) // or deployments (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) // . Task-protection, by default, expires after 2 hours at which point Amazon ECS -// unsets the protectionEnabled property making the task eligible for termination +// clears the protectionEnabled property making the task eligible for termination // by a subsequent scale-in event. You can specify a custom expiration period for // task protection from 1 minute to up to 2,880 minutes (48 hours). To specify the // custom expiration period, set the expiresInMinutes property. The @@ -84,7 +84,8 @@ type UpdateTaskProtectionOutput struct { // A list of tasks with the following information. // - taskArn : The task ARN. // - protectionEnabled : The protection status of the task. If scale-in - // protection is enabled for a task, the value is true . Otherwise, it is false . + // protection is turned on for a task, the value is true . Otherwise, it is false + // . // - expirationDate : The epoch time when protection for the task will expire. ProtectedTasks []types.ProtectedTask diff --git a/service/ecs/types/enums.go b/service/ecs/types/enums.go index 759732a4936..55926633c96 100644 --- a/service/ecs/types/enums.go +++ b/service/ecs/types/enums.go @@ -893,6 +893,7 @@ const ( SettingNameContainerInstanceLongArnFormat SettingName = "containerInstanceLongArnFormat" SettingNameAwsvpcTrunking SettingName = "awsvpcTrunking" SettingNameContainerInsights SettingName = "containerInsights" + SettingNameFargateFipsMode SettingName = "fargateFIPSMode" ) // Values returns all known values for SettingName. Note that this can be expanded @@ -905,6 +906,7 @@ func (SettingName) Values() []SettingName { "containerInstanceLongArnFormat", "awsvpcTrunking", "containerInsights", + "fargateFIPSMode", } } diff --git a/service/ecs/types/errors.go b/service/ecs/types/errors.go index 5fb6bc05662..be03e583674 100644 --- a/service/ecs/types/errors.go +++ b/service/ecs/types/errors.go @@ -558,7 +558,7 @@ func (e *ServiceNotFoundException) ErrorFault() smithy.ErrorFault { return smith // - Incorrect IAM permissions // - The SSM agent is not installed or is not running // - There is an interface Amazon VPC endpoint for Amazon ECS, but there is not -// one for for Systems Manager Session Manager +// one for Systems Manager Session Manager // // For information about how to troubleshoot the issues, see Troubleshooting // issues with ECS Exec (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) diff --git a/service/ecs/types/types.go b/service/ecs/types/types.go index 860dd4d9e29..547b04bdc50 100644 --- a/service/ecs/types/types.go +++ b/service/ecs/types/types.go @@ -93,7 +93,7 @@ type AutoScalingGroupProvider struct { // prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks // from being terminated during a scale-in action. The Auto Scaling group and each // instance in the Auto Scaling group must have instance protection from scale-in - // actions enabled as well. For more information, see Instance Protection (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) + // actions on as well. For more information, see Instance Protection (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) // in the Auto Scaling User Guide. When managed termination protection is off, your // Amazon EC2 instances aren't protected from termination when the Auto Scaling // group scales in. @@ -425,8 +425,8 @@ type ClusterServiceConnectDefaultsRequest struct { // you update the service with an empty string "" for the namespace name, the // cluster configuration for Service Connect is removed. Note that the namespace // will remain in Cloud Map and must be deleted separately. For more information - // about Cloud Map, see Working with Services (https://docs.aws.amazon.com/) in - // the Cloud Map Developer Guide. + // about Cloud Map, see Working with Services (https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) + // in the Cloud Map Developer Guide. // // This member is required. Namespace *string @@ -438,14 +438,15 @@ type ClusterServiceConnectDefaultsRequest struct { // CloudWatch Container Insights for a cluster. type ClusterSetting struct { - // The name of the cluster setting. The only supported value is containerInsights . + // The name of the cluster setting. The value is containerInsights . Name ClusterSettingName // The value to set for the cluster setting. The supported values are enabled and - // disabled . If enabled is specified, CloudWatch Container Insights will be - // enabled for the cluster, otherwise it will be off unless the containerInsights - // account setting is turned on. If a cluster value is specified, it will override - // the containerInsights value set with PutAccountSetting (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSetting.html) + // disabled . If you set name to containerInsights and value to enabled , + // CloudWatch Container Insights will be on for the cluster, otherwise it will be + // off unless the containerInsights account setting is turned on. If a cluster + // value is specified, it will override the containerInsights value set with + // PutAccountSetting (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSetting.html) // or PutAccountSettingDefault (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSettingDefault.html) // . Value *string @@ -1333,9 +1334,9 @@ type Deployment struct { // Balancer. The rollout state of the deployment. When a service deployment is // started, it begins in an IN_PROGRESS state. When the service reaches a steady // state, the deployment transitions to a COMPLETED state. If the service fails to - // reach a steady state and circuit breaker is enabled, the deployment transitions - // to a FAILED state. A deployment in FAILED state doesn't launch any new tasks. - // For more information, see DeploymentCircuitBreaker . + // reach a steady state and circuit breaker is turned on, the deployment + // transitions to a FAILED state. A deployment in FAILED state doesn't launch any + // new tasks. For more information, see DeploymentCircuitBreaker . RolloutState DeploymentRolloutState // A description of the rollout state of a deployment. @@ -1411,10 +1412,10 @@ type DeploymentAlarms struct { // The deployment circuit breaker can only be used for services using the rolling // update ( ECS ) deployment type. The deployment circuit breaker determines // whether a service deployment will fail if the service can't reach a steady -// state. If enabled, a service deployment will transition to a failed state and -// stop launching new tasks. You can also configure Amazon ECS to roll back your -// service to the last completed deployment after a failure. For more information, -// see Rolling update (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) +// state. If it is turned on, a service deployment will transition to a failed +// state and stop launching new tasks. You can also configure Amazon ECS to roll +// back your service to the last completed deployment after a failure. For more +// information, see Rolling update (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) // in the Amazon Elastic Container Service Developer Guide. type DeploymentCircuitBreaker struct { @@ -1606,17 +1607,17 @@ type EFSAuthorizationConfig struct { // The Amazon EFS access point ID to use. If an access point is specified, the // root directory value specified in the EFSVolumeConfiguration must either be // omitted or set to / which will enforce the path set on the EFS access point. If - // an access point is used, transit encryption must be enabled in the + // an access point is used, transit encryption must be on in the // EFSVolumeConfiguration . For more information, see Working with Amazon EFS // access points (https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html) // in the Amazon Elastic File System User Guide. AccessPointId *string // Determines whether to use the Amazon ECS task role defined in a task definition - // when mounting the Amazon EFS file system. If enabled, transit encryption must be - // enabled in the EFSVolumeConfiguration . If this parameter is omitted, the - // default value of DISABLED is used. For more information, see Using Amazon EFS - // access points (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html#efs-volume-accesspoints) + // when mounting the Amazon EFS file system. If it is turned on, transit encryption + // must be turned on in the EFSVolumeConfiguration . If this parameter is omitted, + // the default value of DISABLED is used. For more information, see Using Amazon + // EFS access points (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html#efs-volume-accesspoints) // in the Amazon Elastic Container Service Developer Guide. Iam EFSAuthorizationConfigIAM @@ -1645,9 +1646,10 @@ type EFSVolumeConfiguration struct { RootDirectory *string // Determines whether to use encryption for Amazon EFS data in transit between the - // Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if - // Amazon EFS IAM authorization is used. If this parameter is omitted, the default - // value of DISABLED is used. For more information, see Encrypting data in transit (https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html) + // Amazon ECS host and the Amazon EFS server. Transit encryption must be turned on + // if Amazon EFS IAM authorization is used. If this parameter is omitted, the + // default value of DISABLED is used. For more information, see Encrypting data in + // transit (https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html) // in the Amazon Elastic File System User Guide. TransitEncryption EFSTransitEncryption @@ -1697,9 +1699,9 @@ type EnvironmentFile struct { // used to expand the total amount of ephemeral storage available, beyond the // default amount, for tasks hosted on Fargate. For more information, see Fargate // task storage (https://docs.aws.amazon.com/AmazonECS/latest/userguide/using_data_volumes.html) -// in the Amazon ECS User Guide for Fargate. This parameter is only supported for -// tasks hosted on Fargate using Linux platform version 1.4.0 or later. This -// parameter is not supported for Windows containers on Fargate. +// in the Amazon ECS User Guide for Fargate. For tasks using the Fargate launch +// type, the task requires the following platforms: +// - Linux platform version 1.4.0 or later. type EphemeralStorage struct { // The total amount, in GiB, of ephemeral storage to set for the task. The minimum @@ -2266,8 +2268,8 @@ type ManagedAgent struct { // The last known status of the managed agent. LastStatus *string - // The name of the managed agent. When the execute command feature is enabled, the - // managed agent name is ExecuteCommandAgent . + // The name of the managed agent. When the execute command feature is turned on, + // the managed agent name is ExecuteCommandAgent . Name ManagedAgentName // The reason for why the managed agent is in the state it is in. @@ -2301,7 +2303,7 @@ type ManagedAgentStateChange struct { } // The managed scaling settings for the Auto Scaling group capacity provider. When -// managed scaling is enabled, Amazon ECS manages the scale-in and scale-out +// managed scaling is turned on, Amazon ECS manages the scale-in and scale-out // actions of the Auto Scaling group. Amazon ECS manages a target tracking scaling // policy using an Amazon ECS managed CloudWatch metric with the specified // targetCapacity value as the target value for the metric. For more information, @@ -2587,8 +2589,8 @@ type PortMapping struct { // - For containers in a task with the awsvpc network mode, the hostPort is set // to the same value as the containerPort . This is a static mapping strategy. // - For containers in a task with the bridge network mode, the Amazon ECS agent - // finds open ports on the host and automaticaly binds them to the container ports. - // This is a dynamic mapping strategy. + // finds open ports on the host and automatically binds them to the container + // ports. This is a dynamic mapping strategy. // If you use containers in a task with the awsvpc or host network mode, the // hostPort can either be left blank or set to the same value as the containerPort // . If you use containers in a task with the bridge network mode, you can specify @@ -2738,7 +2740,7 @@ type Resource struct { // The type and amount of a resource to assign to a container. The supported // resource types are GPUs and Elastic Inference accelerators. For more // information, see Working with GPUs on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html) -// or Working with Amazon Elastic Inference on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/url-ecs-dev;ecs-inference.html) +// or Working with Amazon Elastic Inference on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html) // in the Amazon Elastic Container Service Developer Guide type ResourceRequirement struct { @@ -2862,8 +2864,8 @@ type Service struct { // in the Amazon Elastic Container Service Developer Guide. EnableECSManagedTags bool - // Determines whether the execute command functionality is enabled for the - // service. If true , the execute command functionality is enabled for all + // Determines whether the execute command functionality is turned on for the + // service. If true , the execute command functionality is turned on for all // containers in tasks as part of the service. EnableExecuteCommand bool @@ -3075,8 +3077,8 @@ type ServiceConnectConfiguration struct { // namespace for use with Service Connect. The namespace must be in the same Amazon // Web Services Region as the Amazon ECS service and cluster. The type of namespace // doesn't affect Service Connect. For more information about Cloud Map, see - // Working with Services (https://docs.aws.amazon.com/) in the Cloud Map Developer - // Guide. + // Working with Services (https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) + // in the Cloud Map Developer Guide. Namespace *string // The list of Service Connect service objects. These are names and aliases (also @@ -3367,9 +3369,8 @@ type Task struct { // . DesiredStatus *string - // Determines whether execute command functionality is enabled for this task. If - // true , execute command functionality is enabled on all the containers in the - // task. + // Determines whether execute command functionality is turned on for this task. If + // true , execute command functionality is turned on all the containers in the task. EnableExecuteCommand bool // The ephemeral storage settings for the task. @@ -3744,8 +3745,8 @@ type TaskDefinition struct { noSmithyDocumentSerde } -// An object representing a constraint on task placement in the task definition. -// For more information, see Task placement constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) +// The constraint on task placement in the task definition. For more information, +// see Task placement constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) // in the Amazon Elastic Container Service Developer Guide. Task placement // constraints aren't supported for tasks run on Fargate. type TaskDefinitionPlacementConstraint struct { diff --git a/service/fms/internal/endpoints/endpoints.go b/service/fms/internal/endpoints/endpoints.go index ba816d62ce5..6b55d8f04a3 100644 --- a/service/fms/internal/endpoints/endpoints.go +++ b/service/fms/internal/endpoints/endpoints.go @@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "fms-fips.ap-south-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, @@ -222,6 +225,9 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "fms-fips.eu-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, @@ -234,6 +240,9 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "fms-fips.eu-south-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, diff --git a/service/iotdataplane/internal/endpoints/endpoints.go b/service/iotdataplane/internal/endpoints/endpoints.go index 8be135cd65e..03373e11fc7 100644 --- a/service/iotdataplane/internal/endpoints/endpoints.go +++ b/service/iotdataplane/internal/endpoints/endpoints.go @@ -330,7 +330,10 @@ var defaultPartitions = endpoints.Partitions{ Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", - }: endpoints.Endpoint{}, + }: endpoints.Endpoint{ + Hostname: "data.ats.iot.cn-north-1.amazonaws.com.cn", + Protocols: []string{"https"}, + }, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, diff --git a/service/licensemanagerlinuxsubscriptions/internal/endpoints/endpoints.go b/service/licensemanagerlinuxsubscriptions/internal/endpoints/endpoints.go index 115372d7efd..8aad9a01d55 100644 --- a/service/licensemanagerlinuxsubscriptions/internal/endpoints/endpoints.go +++ b/service/licensemanagerlinuxsubscriptions/internal/endpoints/endpoints.go @@ -135,6 +135,12 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, @@ -147,21 +153,39 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, @@ -207,6 +231,12 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, diff --git a/service/marketplacecatalog/api_op_DeleteResourcePolicy.go b/service/marketplacecatalog/api_op_DeleteResourcePolicy.go new file mode 100644 index 00000000000..24851e8b937 --- /dev/null +++ b/service/marketplacecatalog/api_op_DeleteResourcePolicy.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a resource-based policy on an Entity that is identified by its resource +// ARN. +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 Entity resource that is associated with + // the resource policy. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type DeleteResourcePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); 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 = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aws-marketplace", + OperationName: "DeleteResourcePolicy", + } +} diff --git a/service/marketplacecatalog/api_op_GetResourcePolicy.go b/service/marketplacecatalog/api_op_GetResourcePolicy.go new file mode 100644 index 00000000000..234a2a341f0 --- /dev/null +++ b/service/marketplacecatalog/api_op_GetResourcePolicy.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets a resource-based policy of an Entity that is identified by its resource +// ARN. +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 Entity resource that is associated with + // the resource policy. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type GetResourcePolicyOutput struct { + + // The policy document to set; formatted in JSON. + Policy *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); 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 = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aws-marketplace", + OperationName: "GetResourcePolicy", + } +} diff --git a/service/marketplacecatalog/api_op_ListEntities.go b/service/marketplacecatalog/api_op_ListEntities.go index 0f43982e639..b199d444341 100644 --- a/service/marketplacecatalog/api_op_ListEntities.go +++ b/service/marketplacecatalog/api_op_ListEntities.go @@ -51,6 +51,8 @@ type ListEntitiesInput struct { // The value of the next token, if it exists. Null if there are no more results. NextToken *string + OwnershipType types.OwnershipType + // An object that contains two attributes, SortBy and SortOrder . Sort *types.Sort diff --git a/service/marketplacecatalog/api_op_PutResourcePolicy.go b/service/marketplacecatalog/api_op_PutResourcePolicy.go new file mode 100644 index 00000000000..48b581101a2 --- /dev/null +++ b/service/marketplacecatalog/api_op_PutResourcePolicy.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Attaches a resource-based policy to an Entity. Examples of an entity include: +// AmiProduct and ContainerProduct . +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 policy document to set; formatted in JSON. + // + // This member is required. + Policy *string + + // The Amazon Resource Name (ARN) of the Entity resource you want to associate + // with a resource policy. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type PutResourcePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); 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 = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "aws-marketplace", + OperationName: "PutResourcePolicy", + } +} diff --git a/service/marketplacecatalog/api_op_StartChangeSet.go b/service/marketplacecatalog/api_op_StartChangeSet.go index 8e091b95dae..3bbef8dc95f 100644 --- a/service/marketplacecatalog/api_op_StartChangeSet.go +++ b/service/marketplacecatalog/api_op_StartChangeSet.go @@ -23,6 +23,10 @@ import ( // later in this topic because it contains two changes to run the same change type // ( AddRevisions ) against the same entity ( entity-id@1 ). For more information // about working with change sets, see Working with change sets (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html#working-with-change-sets) +// . For information on change types for single-AMI products, see Working with +// single-AMI products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products) +// . Als, for more information on change types available for container-based +// products, see Working with container products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products) // . func (c *Client) StartChangeSet(ctx context.Context, params *StartChangeSetInput, optFns ...func(*Options)) (*StartChangeSetOutput, error) { if params == nil { diff --git a/service/marketplacecatalog/deserializers.go b/service/marketplacecatalog/deserializers.go index 6831a4a04d6..6db94a80310 100644 --- a/service/marketplacecatalog/deserializers.go +++ b/service/marketplacecatalog/deserializers.go @@ -193,6 +193,101 @@ func awsRestjson1_deserializeOpDocumentCancelChangeSetOutput(v **CancelChangeSet return nil } +type awsRestjson1_deserializeOpDeleteResourcePolicy struct { +} + +func (*awsRestjson1_deserializeOpDeleteResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_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 + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteResourcePolicy(response, &metadata) + } + output := &DeleteResourcePolicyOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_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") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDescribeChangeSet struct { } @@ -626,6 +721,169 @@ func awsRestjson1_deserializeOpDocumentDescribeEntityOutput(v **DescribeEntityOu return nil } +type awsRestjson1_deserializeOpGetResourcePolicy struct { +} + +func (*awsRestjson1_deserializeOpGetResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_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 + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_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 = awsRestjson1_deserializeOpDocumentGetResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_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") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_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 "Policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicyJson to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListChangeSets struct { } @@ -1127,6 +1385,101 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } +type awsRestjson1_deserializeOpPutResourcePolicy struct { +} + +func (*awsRestjson1_deserializeOpPutResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_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) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutResourcePolicy(response, &metadata) + } + output := &PutResourcePolicyOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_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)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpStartChangeSet struct { } diff --git a/service/marketplacecatalog/generated.json b/service/marketplacecatalog/generated.json index 99aee86d4fd..303ce44378e 100644 --- a/service/marketplacecatalog/generated.json +++ b/service/marketplacecatalog/generated.json @@ -9,11 +9,14 @@ "api_client.go", "api_client_test.go", "api_op_CancelChangeSet.go", + "api_op_DeleteResourcePolicy.go", "api_op_DescribeChangeSet.go", "api_op_DescribeEntity.go", + "api_op_GetResourcePolicy.go", "api_op_ListChangeSets.go", "api_op_ListEntities.go", "api_op_ListTagsForResource.go", + "api_op_PutResourcePolicy.go", "api_op_StartChangeSet.go", "api_op_TagResource.go", "api_op_UntagResource.go", diff --git a/service/marketplacecatalog/serializers.go b/service/marketplacecatalog/serializers.go index 35a05536b95..b69f99bd39d 100644 --- a/service/marketplacecatalog/serializers.go +++ b/service/marketplacecatalog/serializers.go @@ -71,6 +71,59 @@ func awsRestjson1_serializeOpHttpBindingsCancelChangeSetInput(v *CancelChangeSet return nil } +type awsRestjson1_serializeOpDeleteResourcePolicy struct { +} + +func (*awsRestjson1_serializeOpDeleteResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteResourcePolicy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteResourcePolicyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn != nil { + encoder.SetQuery("resourceArn").String(*v.ResourceArn) + } + + return nil +} + type awsRestjson1_serializeOpDescribeChangeSet struct { } @@ -185,6 +238,59 @@ func awsRestjson1_serializeOpHttpBindingsDescribeEntityInput(v *DescribeEntityIn return nil } +type awsRestjson1_serializeOpGetResourcePolicy struct { +} + +func (*awsRestjson1_serializeOpGetResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetResourcePolicy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetResourcePolicyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetResourcePolicyInput(v *GetResourcePolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn != nil { + encoder.SetQuery("resourceArn").String(*v.ResourceArn) + } + + return nil +} + type awsRestjson1_serializeOpListChangeSets struct { } @@ -364,6 +470,11 @@ func awsRestjson1_serializeOpDocumentListEntitiesInput(v *ListEntitiesInput, val ok.String(*v.NextToken) } + if len(v.OwnershipType) > 0 { + ok := object.Key("OwnershipType") + ok.String(string(v.OwnershipType)) + } + if v.Sort != nil { ok := object.Key("Sort") if err := awsRestjson1_serializeDocumentSort(v.Sort, ok); err != nil { @@ -442,6 +553,79 @@ func awsRestjson1_serializeOpDocumentListTagsForResourceInput(v *ListTagsForReso return nil } +type awsRestjson1_serializeOpPutResourcePolicy struct { +} + +func (*awsRestjson1_serializeOpPutResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/PutResourcePolicy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_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 = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutResourcePolicyInput(v *PutResourcePolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_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 +} + type awsRestjson1_serializeOpStartChangeSet struct { } diff --git a/service/marketplacecatalog/types/enums.go b/service/marketplacecatalog/types/enums.go index 1627e1ad18c..5e58925f14f 100644 --- a/service/marketplacecatalog/types/enums.go +++ b/service/marketplacecatalog/types/enums.go @@ -44,6 +44,24 @@ func (FailureCode) Values() []FailureCode { } } +type OwnershipType string + +// Enum values for OwnershipType +const ( + OwnershipTypeSelf OwnershipType = "SELF" + OwnershipTypeShared OwnershipType = "SHARED" +) + +// Values returns all known values for OwnershipType. 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 (OwnershipType) Values() []OwnershipType { + return []OwnershipType{ + "SELF", + "SHARED", + } +} + type SortOrder string // Enum values for SortOrder diff --git a/service/marketplacecatalog/types/errors.go b/service/marketplacecatalog/types/errors.go index 5427235405d..859cc5956f1 100644 --- a/service/marketplacecatalog/types/errors.go +++ b/service/marketplacecatalog/types/errors.go @@ -7,7 +7,7 @@ import ( smithy "github.com/aws/smithy-go" ) -// Access is denied. +// Access is denied. HTTP status code: 403 type AccessDeniedException struct { Message *string @@ -33,7 +33,7 @@ func (e *AccessDeniedException) ErrorCode() string { } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// There was an internal service exception. +// There was an internal service exception. HTTP status code: 500 type InternalServiceException struct { Message *string @@ -85,7 +85,7 @@ func (e *ResourceInUseException) ErrorCode() string { } func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified resource wasn't found. +// The specified resource wasn't found. HTTP status code: 404 type ResourceNotFoundException struct { Message *string @@ -163,7 +163,7 @@ func (e *ServiceQuotaExceededException) ErrorCode() string { } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Too many requests. +// Too many requests. HTTP status code: 429 type ThrottlingException struct { Message *string @@ -189,7 +189,7 @@ func (e *ThrottlingException) ErrorCode() string { } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// An error occurred during validation. +// An error occurred during validation. HTTP status code: 422 type ValidationException struct { Message *string diff --git a/service/marketplacecatalog/types/types.go b/service/marketplacecatalog/types/types.go index 30e65ea5462..c6bba34f11f 100644 --- a/service/marketplacecatalog/types/types.go +++ b/service/marketplacecatalog/types/types.go @@ -11,13 +11,21 @@ type Change struct { // Change types are single string values that describe your intention for the // change. Each change type is unique for each EntityType provided in the change's - // scope. + // scope. For more information on change types available for single-AMI products, + // see Working with single-AMI products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products) + // . Also, for more information on change types available for container-based + // products, see Working with container products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products) + // . // // This member is required. ChangeType *string // This object contains details specific to the change type of the requested - // change. + // change. For more information on change types available for single-AMI products, + // see Working with single-AMI products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/ami-products.html#working-with-single-AMI-products) + // . Also, for more information on change types available for container-based + // products, see Working with container products (https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/container-products.html#working-with-container-products) + // . // // This member is required. Details *string diff --git a/service/marketplacecatalog/validators.go b/service/marketplacecatalog/validators.go index 2b58438c1f2..453b7da6b8f 100644 --- a/service/marketplacecatalog/validators.go +++ b/service/marketplacecatalog/validators.go @@ -30,6 +30,26 @@ func (m *validateOpCancelChangeSet) HandleInitialize(ctx context.Context, in mid 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 validateOpDescribeChangeSet struct { } @@ -70,6 +90,26 @@ func (m *validateOpDescribeEntity) HandleInitialize(ctx context.Context, in midd 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 validateOpListChangeSets struct { } @@ -130,6 +170,26 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in 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 validateOpStartChangeSet struct { } @@ -194,6 +254,10 @@ func addOpCancelChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelChangeSet{}, middleware.After) } +func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) +} + func addOpDescribeChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeChangeSet{}, middleware.After) } @@ -202,6 +266,10 @@ func addOpDescribeEntityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeEntity{}, middleware.After) } +func addOpGetResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourcePolicy{}, middleware.After) +} + func addOpListChangeSetsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListChangeSets{}, middleware.After) } @@ -214,6 +282,10 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) +} + func addOpStartChangeSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartChangeSet{}, middleware.After) } @@ -341,6 +413,21 @@ func validateOpCancelChangeSetInput(v *CancelChangeSetInput) 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 validateOpDescribeChangeSetInput(v *DescribeChangeSetInput) error { if v == nil { return nil @@ -377,6 +464,21 @@ func validateOpDescribeEntityInput(v *DescribeEntityInput) error { } } +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 validateOpListChangeSetsInput(v *ListChangeSetsInput) error { if v == nil { return nil @@ -425,6 +527,24 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +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 validateOpStartChangeSetInput(v *StartChangeSetInput) error { if v == nil { return nil diff --git a/service/mediaconvert/deserializers.go b/service/mediaconvert/deserializers.go index bfd84cd515d..2edfcde7fbf 100644 --- a/service/mediaconvert/deserializers.go +++ b/service/mediaconvert/deserializers.go @@ -5626,6 +5626,40 @@ func awsRestjson1_deserializeDocument__listOfTeletextPageType(v *[]types.Teletex return nil } +func awsRestjson1_deserializeDocument__listOfWarningGroup(v *[]types.WarningGroup, 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.WarningGroup + if *v == nil { + cv = []types.WarningGroup{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WarningGroup + destAddr := &col + if err := awsRestjson1_deserializeDocumentWarningGroup(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocument__mapOf__string(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15040,6 +15074,15 @@ func awsRestjson1_deserializeDocumentJob(v **types.Job, value interface{}) error sv.BillingTagsSource = types.BillingTagsSource(jtv) } + case "clientRequestToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __string to be of type string, got %T instead", value) + } + sv.ClientRequestToken = ptr.String(jtv) + } + case "createdAt": if value != nil { switch jtv := value.(type) { @@ -15224,6 +15267,11 @@ func awsRestjson1_deserializeDocumentJob(v **types.Job, value interface{}) error return err } + case "warnings": + if err := awsRestjson1_deserializeDocument__listOfWarningGroup(&sv.Warnings, value); err != nil { + return err + } + default: _, _ = key, value @@ -21939,6 +21987,63 @@ func awsRestjson1_deserializeDocumentVp9Settings(v **types.Vp9Settings, value in return nil } +func awsRestjson1_deserializeDocumentWarningGroup(v **types.WarningGroup, 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.WarningGroup + if *v == nil { + sv = &types.WarningGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Code = int32(i64) + } + + case "count": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Count = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentWavSettings(v **types.WavSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/mediaconvert/types/types.go b/service/mediaconvert/types/types.go index 2df358d4df7..c479b8f5f5f 100644 --- a/service/mediaconvert/types/types.go +++ b/service/mediaconvert/types/types.go @@ -4397,7 +4397,7 @@ type HopDestination struct { Queue *string // Required for setting up a job to use queue hopping. Minimum wait time in - // minutes until the job can hop to the destination queue. Valid range is 1 to 1440 + // minutes until the job can hop to the destination queue. Valid range is 1 to 4320 // minutes, inclusive. WaitMinutes int32 @@ -4935,6 +4935,14 @@ type Job struct { // Elemental MediaConvert costs on any billing report that you set up. BillingTagsSource BillingTagsSource + // Prevent duplicate jobs from being created and ensure idempotency for your + // requests. A client request token can be any string that includes up to 64 ASCII + // characters. If you reuse a client request token within one minute of a + // successful request, the API returns the job details of the original request + // instead. For more information see + // https://docs.aws.amazon.com/mediaconvert/latest/apireference/idempotency.html. + ClientRequestToken *string + // The time, in Unix epoch format in seconds, when the job got created. CreatedAt *time.Time @@ -5014,6 +5022,11 @@ type Job struct { // specify metadata in key/value pairs. UserMetadata map[string]string + // Contains any warning messages for the job. Use to help identify potential + // issues with your input, output, or job. For more information, see + // https://docs.aws.amazon.com/mediaconvert/latest/ug/warning_codes.html + Warnings []WarningGroup + noSmithyDocumentSerde } @@ -8263,6 +8276,24 @@ type Vp9Settings struct { noSmithyDocumentSerde } +// Contains any warning codes and their count for the job. +type WarningGroup struct { + + // Warning code that identifies a specific warning in the job. For more + // information, see + // https://docs.aws.amazon.com/mediaconvert/latest/ug/warning_codes.html + // + // This member is required. + Code int32 + + // The number of times this warning occurred in the job. + // + // This member is required. + Count int32 + + noSmithyDocumentSerde +} + // Required when you set (Codec) under (AudioDescriptions)>(CodecSettings) to the // value WAV. type WavSettings struct { diff --git a/service/omics/types/enums.go b/service/omics/types/enums.go index 308e4452c25..5f6ef478e4d 100644 --- a/service/omics/types/enums.go +++ b/service/omics/types/enums.go @@ -641,7 +641,6 @@ const ( WorkflowStatusUpdating WorkflowStatus = "UPDATING" WorkflowStatusDeleted WorkflowStatus = "DELETED" WorkflowStatusFailed WorkflowStatus = "FAILED" - WorkflowStatusInactive WorkflowStatus = "INACTIVE" ) // Values returns all known values for WorkflowStatus. Note that this can be @@ -654,7 +653,6 @@ func (WorkflowStatus) Values() []WorkflowStatus { "UPDATING", "DELETED", "FAILED", - "INACTIVE", } } @@ -663,7 +661,6 @@ type WorkflowType string // Enum values for WorkflowType const ( WorkflowTypePrivate WorkflowType = "PRIVATE" - WorkflowTypeService WorkflowType = "SERVICE" ) // Values returns all known values for WorkflowType. Note that this can be @@ -672,6 +669,5 @@ const ( func (WorkflowType) Values() []WorkflowType { return []WorkflowType{ "PRIVATE", - "SERVICE", } } diff --git a/service/rekognition/api_op_CopyProjectVersion.go b/service/rekognition/api_op_CopyProjectVersion.go index 1a9cbf22d21..5abc6c61e1d 100644 --- a/service/rekognition/api_op_CopyProjectVersion.go +++ b/service/rekognition/api_op_CopyProjectVersion.go @@ -26,7 +26,8 @@ import ( // already exist. Copying a model version takes a while to complete. To get the // current status, call DescribeProjectVersions and check the value of Status in // the ProjectVersionDescription object. The copy operation has finished when the -// value of Status is COPYING_COMPLETED . +// value of Status is COPYING_COMPLETED . This operation requires permissions to +// perform the rekognition:CopyProjectVersion action. func (c *Client) CopyProjectVersion(ctx context.Context, params *CopyProjectVersionInput, optFns ...func(*Options)) (*CopyProjectVersionOutput, error) { if params == nil { params = &CopyProjectVersionInput{} diff --git a/service/rekognition/api_op_CreateFaceLivenessSession.go b/service/rekognition/api_op_CreateFaceLivenessSession.go new file mode 100644 index 00000000000..ef6a371b122 --- /dev/null +++ b/service/rekognition/api_op_CreateFaceLivenessSession.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rekognition + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rekognition/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API operation initiates a Face Liveness session. It returns a SessionId , +// which you can use to start streaming Face Liveness video and get the results for +// a Face Liveness session. You can use the OutputConfig option in the Settings +// parameter to provide an Amazon S3 bucket location. The Amazon S3 bucket stores +// reference images and audit images. You can use AuditImagesLimit to limit of +// audit images returned. This number is between 0 and 4. By default, it is set to +// 0. The limit is best effort and based on the duration of the selfie-video. +func (c *Client) CreateFaceLivenessSession(ctx context.Context, params *CreateFaceLivenessSessionInput, optFns ...func(*Options)) (*CreateFaceLivenessSessionOutput, error) { + if params == nil { + params = &CreateFaceLivenessSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateFaceLivenessSession", params, optFns, c.addOperationCreateFaceLivenessSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFaceLivenessSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFaceLivenessSessionInput struct { + + // Idempotent token is used to recognize the Face Liveness request. If the same + // token is used with multiple CreateFaceLivenessSession requests, the same + // session is returned. This token is employed to avoid unintentionally creating + // the same session multiple times. + ClientRequestToken *string + + // The identifier for your AWS Key Management Service key (AWS KMS key). Used to + // encrypt audit images and reference images. + KmsKeyId *string + + // A session settings object. It contains settings for the operation to be + // performed. For Face Liveness, it accepts OutputConfig and AuditImagesLimit . + Settings *types.CreateFaceLivenessSessionRequestSettings + + noSmithyDocumentSerde +} + +type CreateFaceLivenessSessionOutput struct { + + // A unique 128-bit UUID identifying a Face Liveness session. + // + // This member is required. + SessionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFaceLivenessSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFaceLivenessSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFaceLivenessSession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateFaceLivenessSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFaceLivenessSession(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateFaceLivenessSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rekognition", + OperationName: "CreateFaceLivenessSession", + } +} diff --git a/service/rekognition/api_op_CreateStreamProcessor.go b/service/rekognition/api_op_CreateStreamProcessor.go index 77058b430d1..417559affb2 100644 --- a/service/rekognition/api_op_CreateStreamProcessor.go +++ b/service/rekognition/api_op_CreateStreamProcessor.go @@ -18,19 +18,20 @@ import ( // faces and detecting labels. // - If you are creating a stream processor for detecting faces, you provide as // input a Kinesis video stream ( Input ) and a Kinesis data stream ( Output ) -// stream. You also specify the face recognition criteria in Settings . For -// example, the collection containing faces that you want to recognize. After you -// have finished analyzing a streaming video, use StopStreamProcessor to stop -// processing. +// stream for receiving the output. You must use the FaceSearch option in +// Settings , specifying the collection that contains the faces you want to +// recognize. After you have finished analyzing a streaming video, use +// StopStreamProcessor to stop processing. // - If you are creating a stream processor to detect labels, you provide as // input a Kinesis video stream ( Input ), Amazon S3 bucket information ( Output // ), and an Amazon SNS topic ARN ( NotificationChannel ). You can also provide a // KMS key ID to encrypt the data sent to your Amazon S3 bucket. You specify what -// you want to detect in ConnectedHomeSettings , such as people, packages and -// people, or pets, people, and packages. You can also specify where in the frame -// you want Amazon Rekognition to monitor with RegionsOfInterest . When you run -// the StartStreamProcessor operation on a label detection stream processor, you -// input start and stop information to determine the length of the processing time. +// you want to detect by using the ConnectedHome option in settings, and +// selecting one of the following: PERSON , PET , PACKAGE , ALL You can also +// specify where in the frame you want Amazon Rekognition to monitor with +// RegionsOfInterest . When you run the StartStreamProcessor operation on a label +// detection stream processor, you input start and stop information to determine +// the length of the processing time. // // Use Name to assign an identifier for the stream processor. You use Name to // manage the stream processor. For example, you can start processing the source diff --git a/service/rekognition/api_op_DeleteProjectPolicy.go b/service/rekognition/api_op_DeleteProjectPolicy.go index 509e32673c7..0fdb355fd75 100644 --- a/service/rekognition/api_op_DeleteProjectPolicy.go +++ b/service/rekognition/api_op_DeleteProjectPolicy.go @@ -12,7 +12,8 @@ import ( // Deletes an existing project policy. To get a list of project policies attached // to a project, call ListProjectPolicies . To attach a project policy to a -// project, call PutProjectPolicy . +// project, call PutProjectPolicy . This operation requires permissions to perform +// the rekognition:DeleteProjectPolicy action. func (c *Client) DeleteProjectPolicy(ctx context.Context, params *DeleteProjectPolicyInput, optFns ...func(*Options)) (*DeleteProjectPolicyOutput, error) { if params == nil { params = &DeleteProjectPolicyInput{} diff --git a/service/rekognition/api_op_DetectLabels.go b/service/rekognition/api_op_DetectLabels.go index eb01757483a..f0ab99fadf9 100644 --- a/service/rekognition/api_op_DetectLabels.go +++ b/service/rekognition/api_op_DetectLabels.go @@ -33,7 +33,7 @@ import ( // labels returned. The default is 55%. You can also add the MaxLabels parameter // to limit the number of labels returned. The default and upper limit is 1000 // labels. Response Elements For each object, scene, and concept the API returns -// one or more labels. The API returns the following types of information regarding +// one or more labels. The API returns the following types of information about // labels: // - Name - The name of the detected label. // - Confidence - The level of confidence in the label assigned to a detected @@ -82,8 +82,8 @@ import ( // {Name: tulip,Confidence: 99.0562} In this example, the detection algorithm more // precisely identifies the flower as a tulip. If the object detected is a person, // the operation doesn't provide the same facial details that the DetectFaces -// operation provides. This is a stateless API operation. That is, the operation -// does not persist any data. This operation requires permissions to perform the +// operation provides. This is a stateless API operation that doesn't return any +// data. This operation requires permissions to perform the // rekognition:DetectLabels action. func (c *Client) DetectLabels(ctx context.Context, params *DetectLabelsInput, optFns ...func(*Options)) (*DetectLabelsOutput, error) { if params == nil { @@ -132,7 +132,8 @@ type DetectLabelsInput struct { // properties. Specified filters can be inclusive, exclusive, or a combination of // both. Filters can be used for individual labels or label categories. The exact // label names or label categories must be supplied. For a full list of labels and - // label categories, see LINK HERE. + // label categories, see Detecting labels (https://docs.aws.amazon.com/rekognition/latest/dg/labels.html) + // . Settings *types.DetectLabelsSettings noSmithyDocumentSerde diff --git a/service/rekognition/api_op_GetFaceLivenessSessionResults.go b/service/rekognition/api_op_GetFaceLivenessSessionResults.go new file mode 100644 index 00000000000..29a5849ba71 --- /dev/null +++ b/service/rekognition/api_op_GetFaceLivenessSessionResults.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rekognition + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rekognition/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the results of a specific Face Liveness session. It requires the +// sessionId as input, which was created using CreateFaceLivenessSession . Returns +// the corresponding Face Liveness confidence score, a reference image that +// includes a face bounding box, and audit images that also contain face bounding +// boxes. The Face Liveness confidence score ranges from 0 to 100. The reference +// image can optionally be returned. +func (c *Client) GetFaceLivenessSessionResults(ctx context.Context, params *GetFaceLivenessSessionResultsInput, optFns ...func(*Options)) (*GetFaceLivenessSessionResultsOutput, error) { + if params == nil { + params = &GetFaceLivenessSessionResultsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFaceLivenessSessionResults", params, optFns, c.addOperationGetFaceLivenessSessionResultsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFaceLivenessSessionResultsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFaceLivenessSessionResultsInput struct { + + // A unique 128-bit UUID. This is used to uniquely identify the session and also + // acts as an idempotency token for all operations associated with the session. + // + // This member is required. + SessionId *string + + noSmithyDocumentSerde +} + +type GetFaceLivenessSessionResultsOutput struct { + + // The sessionId for which this request was called. + // + // This member is required. + SessionId *string + + // Represents a status corresponding to the state of the session. Possible + // statuses are: CREATED, IN_PROGRESS, SUCCEEDED, FAILED, EXPIRED. + // + // This member is required. + Status types.LivenessSessionStatus + + // A set of images from the Face Liveness video that can be used for audit + // purposes. It includes a bounding box of the face and the Base64-encoded bytes + // that return an image. If the CreateFaceLivenessSession request included an + // OutputConfig argument, the image will be uploaded to an S3Object specified in + // the output configuration. + AuditImages []types.AuditImage + + // Probabalistic confidence score for if the person in the given video was live, + // represented as a float value between 0 to 100. + Confidence *float32 + + // A high-quality image from the Face Liveness video that can be used for face + // comparison or search. It includes a bounding box of the face and the + // Base64-encoded bytes that return an image. If the CreateFaceLivenessSession + // request included an OutputConfig argument, the image will be uploaded to an + // S3Object specified in the output configuration. In case the reference image is + // not returned, it's recommended to retry the Liveness check. + ReferenceImage *types.AuditImage + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFaceLivenessSessionResultsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetFaceLivenessSessionResults{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetFaceLivenessSessionResults{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetFaceLivenessSessionResultsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFaceLivenessSessionResults(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetFaceLivenessSessionResults(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rekognition", + OperationName: "GetFaceLivenessSessionResults", + } +} diff --git a/service/rekognition/api_op_ListProjectPolicies.go b/service/rekognition/api_op_ListProjectPolicies.go index ab47a90a4a8..c68883ee266 100644 --- a/service/rekognition/api_op_ListProjectPolicies.go +++ b/service/rekognition/api_op_ListProjectPolicies.go @@ -14,7 +14,8 @@ import ( // Gets a list of the project policies attached to a project. To attach a project // policy to a project, call PutProjectPolicy . To remove a project policy from a -// project, call DeleteProjectPolicy . +// project, call DeleteProjectPolicy . This operation requires permissions to +// perform the rekognition:ListProjectPolicies action. func (c *Client) ListProjectPolicies(ctx context.Context, params *ListProjectPoliciesInput, optFns ...func(*Options)) (*ListProjectPoliciesOutput, error) { if params == nil { params = &ListProjectPoliciesInput{} diff --git a/service/rekognition/api_op_PutProjectPolicy.go b/service/rekognition/api_op_PutProjectPolicy.go index 29c130376b6..36e7e9d5c89 100644 --- a/service/rekognition/api_op_PutProjectPolicy.go +++ b/service/rekognition/api_op_PutProjectPolicy.go @@ -21,7 +21,8 @@ import ( // existing project policy by specifying the policy revision ID of the existing // policy. To remove a project policy from a project, call DeleteProjectPolicy . To // get a list of project policies attached to a project, call ListProjectPolicies . -// You copy a model version by calling CopyProjectVersion . +// You copy a model version by calling CopyProjectVersion . This operation requires +// permissions to perform the rekognition:PutProjectPolicy action. func (c *Client) PutProjectPolicy(ctx context.Context, params *PutProjectPolicyInput, optFns ...func(*Options)) (*PutProjectPolicyOutput, error) { if params == nil { params = &PutProjectPolicyInput{} diff --git a/service/rekognition/api_op_StopProjectVersion.go b/service/rekognition/api_op_StopProjectVersion.go index 7afd1e46cf4..eefd0500bd5 100644 --- a/service/rekognition/api_op_StopProjectVersion.go +++ b/service/rekognition/api_op_StopProjectVersion.go @@ -12,7 +12,8 @@ import ( ) // Stops a running model. The operation might take a while to complete. To check -// the current status, call DescribeProjectVersions . +// the current status, call DescribeProjectVersions . This operation requires +// permissions to perform the rekognition:StopProjectVersion action. func (c *Client) StopProjectVersion(ctx context.Context, params *StopProjectVersionInput, optFns ...func(*Options)) (*StopProjectVersionOutput, error) { if params == nil { params = &StopProjectVersionInput{} diff --git a/service/rekognition/deserializers.go b/service/rekognition/deserializers.go index 1d23c15ff31..877f560821b 100644 --- a/service/rekognition/deserializers.go +++ b/service/rekognition/deserializers.go @@ -5,6 +5,7 @@ package rekognition import ( "bytes" "context" + "encoding/base64" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" @@ -551,6 +552,129 @@ func awsAwsjson11_deserializeOpErrorCreateDataset(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpCreateFaceLivenessSession struct { +} + +func (*awsAwsjson11_deserializeOpCreateFaceLivenessSession) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateFaceLivenessSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorCreateFaceLivenessSession(response, &metadata) + } + output := &CreateFaceLivenessSessionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentCreateFaceLivenessSessionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateFaceLivenessSession(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateProject struct { } @@ -3926,6 +4050,132 @@ func awsAwsjson11_deserializeOpErrorGetFaceDetection(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpGetFaceLivenessSessionResults struct { +} + +func (*awsAwsjson11_deserializeOpGetFaceLivenessSessionResults) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetFaceLivenessSessionResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetFaceLivenessSessionResults(response, &metadata) + } + output := &GetFaceLivenessSessionResultsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetFaceLivenessSessionResultsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetFaceLivenessSessionResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("SessionNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorSessionNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpGetFaceSearch struct { } @@ -8251,6 +8501,9 @@ func awsAwsjson11_deserializeOpErrorUpdateStreamProcessor(response *smithyhttp.R case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -8845,8 +9098,43 @@ func awsAwsjson11_deserializeErrorResourceNotReadyException(response *smithyhttp return err } - output := &types.ResourceNotReadyException{} - err := awsAwsjson11_deserializeDocumentResourceNotReadyException(&output, shape) + output := &types.ResourceNotReadyException{} + err := awsAwsjson11_deserializeDocumentResourceNotReadyException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson11_deserializeDocumentServiceQuotaExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -8862,7 +9150,7 @@ func awsAwsjson11_deserializeErrorResourceNotReadyException(response *smithyhttp return output } -func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorSessionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -8880,8 +9168,8 @@ func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithy return err } - output := &types.ServiceQuotaExceededException{} - err := awsAwsjson11_deserializeDocumentServiceQuotaExceededException(&output, shape) + output := &types.SessionNotFoundException{} + err := awsAwsjson11_deserializeDocumentSessionNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -9265,6 +9553,94 @@ func awsAwsjson11_deserializeDocumentAudioMetadataList(v *[]types.AudioMetadata, return nil } +func awsAwsjson11_deserializeDocumentAuditImage(v **types.AuditImage, 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.AuditImage + if *v == nil { + sv = &types.AuditImage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BoundingBox": + if err := awsAwsjson11_deserializeDocumentBoundingBox(&sv.BoundingBox, value); err != nil { + return err + } + + case "Bytes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LivenessImageBlob to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode LivenessImageBlob, %w", err) + } + sv.Bytes = dv + } + + case "S3Object": + if err := awsAwsjson11_deserializeDocumentS3Object(&sv.S3Object, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAuditImages(v *[]types.AuditImage, 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.AuditImage + if *v == nil { + cv = []types.AuditImage{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuditImage + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAuditImage(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentBeard(v **types.Beard, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16896,6 +17272,64 @@ func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsAwsjson11_deserializeDocumentSessionNotFoundException(v **types.SessionNotFoundException, 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.SessionNotFoundException + if *v == nil { + sv = &types.SessionNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Logref": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Logref = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentShotSegment(v **types.ShotSegment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18587,6 +19021,46 @@ func awsAwsjson11_deserializeOpDocumentCreateDatasetOutput(v **CreateDatasetOutp return nil } +func awsAwsjson11_deserializeOpDocumentCreateFaceLivenessSessionOutput(v **CreateFaceLivenessSessionOutput, 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 *CreateFaceLivenessSessionOutput + if *v == nil { + sv = &CreateFaceLivenessSessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LivenessSessionId to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateProjectOutput(v **CreateProjectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19890,6 +20364,99 @@ func awsAwsjson11_deserializeOpDocumentGetFaceDetectionOutput(v **GetFaceDetecti return nil } +func awsAwsjson11_deserializeOpDocumentGetFaceLivenessSessionResultsOutput(v **GetFaceLivenessSessionResultsOutput, 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 *GetFaceLivenessSessionResultsOutput + if *v == nil { + sv = &GetFaceLivenessSessionResultsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AuditImages": + if err := awsAwsjson11_deserializeDocumentAuditImages(&sv.AuditImages, value); err != nil { + return err + } + + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } + } + + case "ReferenceImage": + if err := awsAwsjson11_deserializeDocumentAuditImage(&sv.ReferenceImage, value); err != nil { + return err + } + + case "SessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LivenessSessionId to be of type string, got %T instead", value) + } + sv.SessionId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LivenessSessionStatus to be of type string, got %T instead", value) + } + sv.Status = types.LivenessSessionStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetFaceSearchOutput(v **GetFaceSearchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/rekognition/generated.json b/service/rekognition/generated.json index c39cc074cfd..f76426529e3 100644 --- a/service/rekognition/generated.json +++ b/service/rekognition/generated.json @@ -13,6 +13,7 @@ "api_op_CopyProjectVersion.go", "api_op_CreateCollection.go", "api_op_CreateDataset.go", + "api_op_CreateFaceLivenessSession.go", "api_op_CreateProject.go", "api_op_CreateProjectVersion.go", "api_op_CreateStreamProcessor.go", @@ -39,6 +40,7 @@ "api_op_GetCelebrityRecognition.go", "api_op_GetContentModeration.go", "api_op_GetFaceDetection.go", + "api_op_GetFaceLivenessSessionResults.go", "api_op_GetFaceSearch.go", "api_op_GetLabelDetection.go", "api_op_GetPersonTracking.go", diff --git a/service/rekognition/serializers.go b/service/rekognition/serializers.go index 59e1644c0bd..603a734a06b 100644 --- a/service/rekognition/serializers.go +++ b/service/rekognition/serializers.go @@ -236,6 +236,61 @@ func (m *awsAwsjson11_serializeOpCreateDataset) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateFaceLivenessSession struct { +} + +func (*awsAwsjson11_serializeOpCreateFaceLivenessSession) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateFaceLivenessSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateFaceLivenessSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RekognitionService.CreateFaceLivenessSession") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateFaceLivenessSessionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateProject struct { } @@ -1666,6 +1721,61 @@ func (m *awsAwsjson11_serializeOpGetFaceDetection) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetFaceLivenessSessionResults struct { +} + +func (*awsAwsjson11_serializeOpGetFaceLivenessSessionResults) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetFaceLivenessSessionResults) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetFaceLivenessSessionResultsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RekognitionService.GetFaceLivenessSessionResults") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetFaceLivenessSessionResultsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetFaceSearch struct { } @@ -3726,6 +3836,25 @@ func awsAwsjson11_serializeDocumentContentClassifiers(v []types.ContentClassifie return nil } +func awsAwsjson11_serializeDocumentCreateFaceLivenessSessionRequestSettings(v *types.CreateFaceLivenessSessionRequestSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AuditImagesLimit != nil { + ok := object.Key("AuditImagesLimit") + ok.Integer(*v.AuditImagesLimit) + } + + if v.OutputConfig != nil { + ok := object.Key("OutputConfig") + if err := awsAwsjson11_serializeDocumentLivenessOutputConfig(v.OutputConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentDatasetChanges(v *types.DatasetChanges, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4143,6 +4272,23 @@ func awsAwsjson11_serializeDocumentLabelDetectionSettings(v *types.LabelDetectio return nil } +func awsAwsjson11_serializeDocumentLivenessOutputConfig(v *types.LivenessOutputConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Bucket != nil { + ok := object.Key("S3Bucket") + ok.String(*v.S3Bucket) + } + + if v.S3KeyPrefix != nil { + ok := object.Key("S3KeyPrefix") + ok.String(*v.S3KeyPrefix) + } + + return nil +} + func awsAwsjson11_serializeDocumentNotificationChannel(v *types.NotificationChannel, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4814,6 +4960,30 @@ func awsAwsjson11_serializeOpDocumentCreateDatasetInput(v *CreateDatasetInput, v return nil } +func awsAwsjson11_serializeOpDocumentCreateFaceLivenessSessionInput(v *CreateFaceLivenessSessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.KmsKeyId != nil { + ok := object.Key("KmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.Settings != nil { + ok := object.Key("Settings") + if err := awsAwsjson11_serializeDocumentCreateFaceLivenessSessionRequestSettings(v.Settings, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5434,6 +5604,18 @@ func awsAwsjson11_serializeOpDocumentGetFaceDetectionInput(v *GetFaceDetectionIn return nil } +func awsAwsjson11_serializeOpDocumentGetFaceLivenessSessionResultsInput(v *GetFaceLivenessSessionResultsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SessionId != nil { + ok := object.Key("SessionId") + ok.String(*v.SessionId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetFaceSearchInput(v *GetFaceSearchInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/rekognition/types/enums.go b/service/rekognition/types/enums.go index 918b0f9732e..55fc451a544 100644 --- a/service/rekognition/types/enums.go +++ b/service/rekognition/types/enums.go @@ -414,6 +414,28 @@ func (LandmarkType) Values() []LandmarkType { } } +type LivenessSessionStatus string + +// Enum values for LivenessSessionStatus +const ( + LivenessSessionStatusCreated LivenessSessionStatus = "CREATED" + LivenessSessionStatusInProgress LivenessSessionStatus = "IN_PROGRESS" + LivenessSessionStatusSucceeded LivenessSessionStatus = "SUCCEEDED" + LivenessSessionStatusFailed LivenessSessionStatus = "FAILED" +) + +// Values returns all known values for LivenessSessionStatus. 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 (LivenessSessionStatus) Values() []LivenessSessionStatus { + return []LivenessSessionStatus{ + "CREATED", + "IN_PROGRESS", + "SUCCEEDED", + "FAILED", + } +} + type OrientationCorrection string // Enum values for OrientationCorrection diff --git a/service/rekognition/types/errors.go b/service/rekognition/types/errors.go index faa634f0d07..b17e12472b7 100644 --- a/service/rekognition/types/errors.go +++ b/service/rekognition/types/errors.go @@ -552,6 +552,35 @@ func (e *ServiceQuotaExceededException) ErrorCode() string { } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Occurs when a given sessionId is not found. +type SessionNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + Code *string + Logref *string + + noSmithyDocumentSerde +} + +func (e *SessionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SessionNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SessionNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SessionNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *SessionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Amazon Rekognition is temporarily unable to process the request. Try your call // again. type ThrottlingException struct { diff --git a/service/rekognition/types/types.go b/service/rekognition/types/types.go index a0578f54fd2..669aa742743 100644 --- a/service/rekognition/types/types.go +++ b/service/rekognition/types/types.go @@ -55,6 +55,42 @@ type AudioMetadata struct { noSmithyDocumentSerde } +// An image that is picked from the Face Liveness video and returned for audit +// trail purposes, returned as Base64-encoded bytes. +type AuditImage struct { + + // Identifies the bounding box around the label, face, text, object of interest, + // or personal protective equipment. The left (x-coordinate) and top + // (y-coordinate) are coordinates representing the top and left sides of the + // bounding box. Note that the upper-left corner of the image is the origin (0,0). + // The top and left values returned are ratios of the overall image size. For + // example, if the input image is 700x200 pixels, and the top-left coordinate of + // the bounding box is 350x50 pixels, the API returns a left value of 0.5 + // (350/700) and a top value of 0.25 (50/200). The width and height values + // represent the dimensions of the bounding box as a ratio of the overall image + // dimension. For example, if the input image is 700x200 pixels, and the bounding + // box width is 70 pixels, the width returned is 0.1. The bounding box coordinates + // can have negative values. For example, if Amazon Rekognition is able to detect a + // face that is at the image edge and is only partially visible, the service can + // return coordinates that are outside the image bounds and, depending on the image + // edge, you might get negative values or values greater than 1 for the left or top + // values. + BoundingBox *BoundingBox + + // The Base64-encoded bytes representing an image selected from the Face Liveness + // video and returned for audit purposes. + Bytes []byte + + // Provides the S3 bucket name and object name. The region for the S3 bucket + // containing the S3 object must match the region you use for Amazon Rekognition + // operations. For Amazon Rekognition to process an S3 object, the user must have + // permission to access the S3 object. For more information, see How Amazon + // Rekognition works with IAM in the Amazon Rekognition Developer Guide. + S3Object *S3Object + + noSmithyDocumentSerde +} + // Indicates whether or not the face has a beard, and the confidence level in the // determination. type Beard struct { @@ -333,6 +369,26 @@ type CoversBodyPart struct { noSmithyDocumentSerde } +// A session settings object. It contains settings for the operation to be +// performed. It accepts arguments for OutputConfig and AuditImagesLimit. +type CreateFaceLivenessSessionRequestSettings struct { + + // Number of audit images to be returned back. Takes an integer between 0-4. Any + // integer less than 0 will return 0, any integer above 4 will return 4 images in + // the response. By default, it is set to 0. The limit is best effort and is based + // on the actual duration of the selfie-video. + AuditImagesLimit *int32 + + // Can specify the location of an Amazon S3 bucket, where reference and audit + // images will be stored. Note that the Amazon S3 bucket must be located in the + // caller's AWS account and in the same region as the Face Liveness end-point. + // Additionally, the Amazon S3 object keys are auto-generated by the Face Liveness + // system. + OutputConfig *LivenessOutputConfig + + noSmithyDocumentSerde +} + // A custom label detected in an image by a call to DetectCustomLabels . type CustomLabel struct { @@ -936,7 +992,9 @@ type Gender struct { // Contains filters for the object labels returned by DetectLabels. Filters can be // inclusive, exclusive, or a combination of both and can be applied to individual -// l abels or entire label categories. +// labels or entire label categories. To see a list of label categories, see +// Detecting Labels (https://docs.aws.amazon.com/rekognition/latest/dg/labels.html) +// . type GeneralLabelsSettings struct { // The label categories that should be excluded from the return from DetectLabels. @@ -1053,7 +1111,8 @@ type HumanLoopDataAttributes struct { // with IAM in the Amazon Rekognition Developer Guide. type Image struct { - // Blob of image bytes up to 5 MBs. + // Blob of image bytes up to 5 MBs. Note that the maximum image size you can pass + // to DetectCustomLabels is 4MB. Bytes []byte // Identifies an S3 object as the image source. @@ -1221,7 +1280,9 @@ type LabelDetectionSettings struct { // Contains filters for the object labels returned by DetectLabels. Filters can be // inclusive, exclusive, or a combination of both and can be applied to individual - // l abels or entire label categories. + // labels or entire label categories. To see a list of label categories, see + // Detecting Labels (https://docs.aws.amazon.com/rekognition/latest/dg/labels.html) + // . GeneralLabels *GeneralLabelsSettings noSmithyDocumentSerde @@ -1248,6 +1309,24 @@ type Landmark struct { noSmithyDocumentSerde } +// Contains settings that specify the location of an Amazon S3 bucket used to +// store the output of a Face Liveness session. Note that the S3 bucket must be +// located in the caller's AWS account and in the same region as the Face Liveness +// end-point. Additionally, the Amazon S3 object keys are auto-generated by the +// Face Liveness system. +type LivenessOutputConfig struct { + + // The path to an AWS Amazon S3 bucket used to store Face Liveness session results. + // + // This member is required. + S3Bucket *string + + // The prefix appended to the output files for the Face Liveness session results. + S3KeyPrefix *string + + noSmithyDocumentSerde +} + // Provides information about a single type of inappropriate, unwanted, or // offensive content found in an image or video. Each type of moderated content has // a label within a hierarchical taxonomy. For more information, see Content diff --git a/service/rekognition/validators.go b/service/rekognition/validators.go index 0e4a266dbbe..0e8b72c8536 100644 --- a/service/rekognition/validators.go +++ b/service/rekognition/validators.go @@ -90,6 +90,26 @@ func (m *validateOpCreateDataset) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpCreateFaceLivenessSession struct { +} + +func (*validateOpCreateFaceLivenessSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateFaceLivenessSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFaceLivenessSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFaceLivenessSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateProject struct { } @@ -590,6 +610,26 @@ func (m *validateOpGetFaceDetection) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetFaceLivenessSessionResults struct { +} + +func (*validateOpGetFaceLivenessSessionResults) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFaceLivenessSessionResults) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFaceLivenessSessionResultsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFaceLivenessSessionResultsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetFaceSearch struct { } @@ -1226,6 +1266,10 @@ func addOpCreateDatasetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataset{}, middleware.After) } +func addOpCreateFaceLivenessSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateFaceLivenessSession{}, middleware.After) +} + func addOpCreateProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateProject{}, middleware.After) } @@ -1326,6 +1370,10 @@ func addOpGetFaceDetectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFaceDetection{}, middleware.After) } +func addOpGetFaceLivenessSessionResultsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFaceLivenessSessionResults{}, middleware.After) +} + func addOpGetFaceSearchValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFaceSearch{}, middleware.After) } @@ -1465,6 +1513,23 @@ func validateConnectedHomeSettings(v *types.ConnectedHomeSettings) error { } } +func validateCreateFaceLivenessSessionRequestSettings(v *types.CreateFaceLivenessSessionRequestSettings) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFaceLivenessSessionRequestSettings"} + if v.OutputConfig != nil { + if err := validateLivenessOutputConfig(v.OutputConfig); err != nil { + invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDatasetChanges(v *types.DatasetChanges) error { if v == nil { return nil @@ -1530,6 +1595,21 @@ func validateHumanLoopConfig(v *types.HumanLoopConfig) error { } } +func validateLivenessOutputConfig(v *types.LivenessOutputConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LivenessOutputConfig"} + if v.S3Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateNotificationChannel(v *types.NotificationChannel) error { if v == nil { return nil @@ -1688,6 +1768,23 @@ func validateOpCreateDatasetInput(v *CreateDatasetInput) error { } } +func validateOpCreateFaceLivenessSessionInput(v *CreateFaceLivenessSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFaceLivenessSessionInput"} + if v.Settings != nil { + if err := validateCreateFaceLivenessSessionRequestSettings(v.Settings); err != nil { + invalidParams.AddNested("Settings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateProjectInput(v *CreateProjectInput) error { if v == nil { return nil @@ -2118,6 +2215,21 @@ func validateOpGetFaceDetectionInput(v *GetFaceDetectionInput) error { } } +func validateOpGetFaceLivenessSessionResultsInput(v *GetFaceLivenessSessionResultsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFaceLivenessSessionResultsInput"} + if v.SessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SessionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetFaceSearchInput(v *GetFaceSearchInput) error { if v == nil { return nil diff --git a/service/route53resolver/internal/endpoints/endpoints.go b/service/route53resolver/internal/endpoints/endpoints.go index 2929d1a97b1..e804ab58a16 100644 --- a/service/route53resolver/internal/endpoints/endpoints.go +++ b/service/route53resolver/internal/endpoints/endpoints.go @@ -177,6 +177,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{},