From f19b2c1c72eb5dc6957f79a323894743c8621ade Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:35:48 -0700 Subject: [PATCH] feat(client-rekognitionstreaming): add oval fit timeout configuration option (#5132) Co-authored-by: George Fu --- .../StartFaceLivenessSessionCommand.ts | 3 + .../src/models/models_0.ts | 6 + .../src/protocols/Aws_restJson1.ts | 2 + .../aws-models/rekognitionstreaming.json | 204 ++++++++++-------- 4 files changed, 130 insertions(+), 85 deletions(-) diff --git a/clients/client-rekognitionstreaming/src/commands/StartFaceLivenessSessionCommand.ts b/clients/client-rekognitionstreaming/src/commands/StartFaceLivenessSessionCommand.ts index 32319eb45d82..c43534325c5c 100644 --- a/clients/client-rekognitionstreaming/src/commands/StartFaceLivenessSessionCommand.ts +++ b/clients/client-rekognitionstreaming/src/commands/StartFaceLivenessSessionCommand.ts @@ -57,6 +57,8 @@ export interface StartFaceLivenessSessionCommandOutput extends StartFaceLiveness *

The maximum video size for Face Liveness is 10 MB. Face Liveness throws a * ValidationException if the video does not match the necessary formatting and * size parameters.

+ *

StartFaceLivenessSession supports the websockets and the AWS SDK + * for JavaScript.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript @@ -144,6 +146,7 @@ export interface StartFaceLivenessSessionCommandOutput extends StartFaceLiveness * // OvalIouHeightThreshold: Number("float"), * // FaceIouWidthThreshold: Number("float"), * // FaceIouHeightThreshold: Number("float"), + * // OvalFitTimeout: Number("int"), * // }, * // ColorSequences: [ // ColorSequences // required * // { // ColorSequence diff --git a/clients/client-rekognitionstreaming/src/models/models_0.ts b/clients/client-rekognitionstreaming/src/models/models_0.ts index 1b3e22366aee..705150885393 100644 --- a/clients/client-rekognitionstreaming/src/models/models_0.ts +++ b/clients/client-rekognitionstreaming/src/models/models_0.ts @@ -128,6 +128,12 @@ export interface ChallengeConfig { *

Threshold for height during face IOU (Intersection over Union) match.

*/ FaceIouHeightThreshold?: number; + + /** + * @public + *

Timeout limit in which the end-users need to fit in the oval, in miliseconds.

+ */ + OvalFitTimeout?: number; } /** diff --git a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts index 4e91c3ad110a..1044bfd64b10 100644 --- a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts @@ -4,6 +4,7 @@ import { _json, collectBody, decorateServiceException as __decorateServiceException, + expectInt32 as __expectInt32, expectString as __expectString, expectUnion as __expectUnion, limitedParseFloat32 as __limitedParseFloat32, @@ -540,6 +541,7 @@ const de_ChallengeConfig = (output: any, context: __SerdeContext): ChallengeConf FaceDistanceThresholdMin: __limitedParseFloat32, FaceIouHeightThreshold: __limitedParseFloat32, FaceIouWidthThreshold: __limitedParseFloat32, + OvalFitTimeout: __expectInt32, OvalHeightWidthRatio: __limitedParseFloat32, OvalIouHeightThreshold: __limitedParseFloat32, OvalIouThreshold: __limitedParseFloat32, diff --git a/codegen/sdk-codegen/aws-models/rekognitionstreaming.json b/codegen/sdk-codegen/aws-models/rekognitionstreaming.json index 97c497b48a95..6b060194af73 100644 --- a/codegen/sdk-codegen/aws-models/rekognitionstreaming.json +++ b/codegen/sdk-codegen/aws-models/rekognitionstreaming.json @@ -152,6 +152,12 @@ "traits": { "smithy.api#documentation": "

Threshold for height during face IOU (Intersection over Union) match.

" } + }, + "OvalFitTimeout": { + "target": "com.amazonaws.rekognitionstreaming#TimeoutInMs", + "traits": { + "smithy.api#documentation": "

Timeout limit in which the end-users need to fit in the oval, in miliseconds.

" + } } }, "traits": { @@ -970,55 +976,55 @@ "smithy.rules#endpointTests": { "testCases": [ { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition-fips.us-gov-east-1.api.aws" + "url": "https://streaming-rekognition-fips.us-east-1.api.aws" } }, "params": { - "UseDualStack": true, - "Region": "us-gov-east-1", - "UseFIPS": true + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": true } }, { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition-fips.us-gov-east-1.amazonaws.com" + "url": "https://streaming-rekognition-fips.us-east-1.amazonaws.com" } }, "params": { - "UseDualStack": false, - "Region": "us-gov-east-1", - "UseFIPS": true + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false } }, { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition.us-gov-east-1.api.aws" + "url": "https://streaming-rekognition.us-east-1.api.aws" } }, "params": { - "UseDualStack": true, - "Region": "us-gov-east-1", - "UseFIPS": false + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true } }, { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition.us-gov-east-1.amazonaws.com" + "url": "https://streaming-rekognition.us-east-1.amazonaws.com" } }, "params": { - "UseDualStack": false, - "Region": "us-gov-east-1", - "UseFIPS": false + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false } }, { @@ -1029,9 +1035,9 @@ } }, "params": { - "UseDualStack": true, "Region": "cn-north-1", - "UseFIPS": true + "UseFIPS": true, + "UseDualStack": true } }, { @@ -1042,9 +1048,9 @@ } }, "params": { - "UseDualStack": false, "Region": "cn-north-1", - "UseFIPS": true + "UseFIPS": true, + "UseDualStack": false } }, { @@ -1055,9 +1061,9 @@ } }, "params": { - "UseDualStack": true, "Region": "cn-north-1", - "UseFIPS": false + "UseFIPS": false, + "UseDualStack": true } }, { @@ -1068,109 +1074,109 @@ } }, "params": { - "UseDualStack": false, "Region": "cn-north-1", - "UseFIPS": false + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + "endpoint": { + "url": "https://streaming-rekognition-fips.us-gov-east-1.api.aws" + } }, "params": { - "UseDualStack": true, - "Region": "us-iso-east-1", - "UseFIPS": true + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": true } }, { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition-fips.us-iso-east-1.c2s.ic.gov" + "url": "https://streaming-rekognition-fips.us-gov-east-1.amazonaws.com" } }, "params": { - "UseDualStack": false, - "Region": "us-iso-east-1", - "UseFIPS": true + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": false } }, { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" + "endpoint": { + "url": "https://streaming-rekognition.us-gov-east-1.api.aws" + } }, "params": { - "UseDualStack": true, - "Region": "us-iso-east-1", - "UseFIPS": false + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": true } }, { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition.us-iso-east-1.c2s.ic.gov" + "url": "https://streaming-rekognition.us-gov-east-1.amazonaws.com" } }, "params": { - "UseDualStack": false, - "Region": "us-iso-east-1", - "UseFIPS": false + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", "expect": { - "endpoint": { - "url": "https://streaming-rekognition-fips.us-east-1.api.aws" - } + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" }, "params": { - "UseDualStack": true, - "Region": "us-east-1", - "UseFIPS": true + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": true } }, { - "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition-fips.us-east-1.amazonaws.com" + "url": "https://streaming-rekognition-fips.us-iso-east-1.c2s.ic.gov" } }, "params": { - "UseDualStack": false, - "Region": "us-east-1", - "UseFIPS": true + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": false } }, { - "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", "expect": { - "endpoint": { - "url": "https://streaming-rekognition.us-east-1.api.aws" - } + "error": "DualStack is enabled but this partition does not support DualStack" }, "params": { - "UseDualStack": true, - "Region": "us-east-1", - "UseFIPS": false + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": true } }, { - "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://streaming-rekognition.us-east-1.amazonaws.com" + "url": "https://streaming-rekognition.us-iso-east-1.c2s.ic.gov" } }, "params": { - "UseDualStack": false, - "Region": "us-east-1", - "UseFIPS": false + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": false } }, { @@ -1179,9 +1185,9 @@ "error": "FIPS and DualStack are enabled, but this partition does not support one or both" }, "params": { - "UseDualStack": true, "Region": "us-isob-east-1", - "UseFIPS": true + "UseFIPS": true, + "UseDualStack": true } }, { @@ -1192,9 +1198,9 @@ } }, "params": { - "UseDualStack": false, "Region": "us-isob-east-1", - "UseFIPS": true + "UseFIPS": true, + "UseDualStack": false } }, { @@ -1203,9 +1209,9 @@ "error": "DualStack is enabled but this partition does not support DualStack" }, "params": { - "UseDualStack": true, "Region": "us-isob-east-1", - "UseFIPS": false + "UseFIPS": false, + "UseDualStack": true } }, { @@ -1216,22 +1222,35 @@ } }, "params": { - "UseDualStack": false, "Region": "us-isob-east-1", - "UseFIPS": false + "UseFIPS": false, + "UseDualStack": false } }, { - "documentation": "For custom endpoint with fips disabled and dualstack disabled", + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", "expect": { "endpoint": { "url": "https://example.com" } }, "params": { - "UseDualStack": false, "Region": "us-east-1", "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "UseDualStack": false, "Endpoint": "https://example.com" } }, @@ -1241,9 +1260,9 @@ "error": "Invalid Configuration: FIPS and custom endpoint are not supported" }, "params": { - "UseDualStack": false, "Region": "us-east-1", "UseFIPS": true, + "UseDualStack": false, "Endpoint": "https://example.com" } }, @@ -1253,11 +1272,17 @@ "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" }, "params": { - "UseDualStack": true, "Region": "us-east-1", "UseFIPS": false, + "UseDualStack": true, "Endpoint": "https://example.com" } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } } ], "version": "1.0" @@ -1388,7 +1413,7 @@ } ], "traits": { - "smithy.api#documentation": "

Starts a Face Liveness video stream and liveness detection process for a given\n session.

\n

Requires sessionId, ChallengeVersions, VideoWidth,\n VideoHeight and a RequestEventStream as input. The event stream\n contains information about different events for the session, including the challenge\n information used for verification.

\n

The maximum video size for Face Liveness is 10 MB. Face Liveness throws a\n ValidationException if the video does not match the necessary formatting and\n size parameters.

", + "smithy.api#documentation": "

Starts a Face Liveness video stream and liveness detection process for a given\n session.

\n

Requires sessionId, ChallengeVersions, VideoWidth,\n VideoHeight and a RequestEventStream as input. The event stream\n contains information about different events for the session, including the challenge\n information used for verification.

\n

The maximum video size for Face Liveness is 10 MB. Face Liveness throws a\n ValidationException if the video does not match the necessary formatting and\n size parameters.

\n

StartFaceLivenessSession supports the websockets and the AWS SDK \n for JavaScript.

", "smithy.api#http": { "method": "POST", "uri": "/start-face-liveness-session", @@ -1523,6 +1548,15 @@ "smithy.api#httpError": 429 } }, + "com.amazonaws.rekognitionstreaming#TimeoutInMs": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 10000 + } + } + }, "com.amazonaws.rekognitionstreaming#UUID": { "type": "string", "traits": {