Skip to content

Commit

Permalink
fix(client-rekognitionstreaming): update rekognitionstreaming endpoin…
Browse files Browse the repository at this point in the history
…ts (#4621)
  • Loading branch information
kuhe authored Apr 6, 2023
1 parent 39c4488 commit c64cf47
Show file tree
Hide file tree
Showing 7 changed files with 804 additions and 107 deletions.
23 changes: 23 additions & 0 deletions clients/client-rekognitionstreaming/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@

AWS SDK for JavaScript RekognitionStreaming Client for Node.js, Browser and React Native.

<p>A real-time video processing service based on Rekognition. This section documents the API
operations for Rekognition Face Liveness.</p>
<p>
<b>Amazon Rekognition Face Liveness</b>
</p>
<ul>
<li>
<p>
<a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateFaceLivenessSession.html">CreateFaceLivenessSession</a>
</p>
</li>
<li>
<p>
<a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceLivenessSessionResults.html">GetFaceLivenessSessionResults</a>
</p>
</li>
<li>
<p>
<a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_rekognitionstreaming_StartFaceLivenessSession.html">StartFaceLivenessSession</a>
</p>
</li>
</ul>

## Installing

To install the this package, simply type add or install @aws-sdk/client-rekognitionstreaming
Expand Down
31 changes: 31 additions & 0 deletions clients/client-rekognitionstreaming/src/RekognitionStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,41 @@ import { RekognitionStreamingClient } from "./RekognitionStreamingClient";

/**
* @public
* <p>A real-time video processing service based on Rekognition. This section documents the API
* operations for Rekognition Face Liveness.</p>
* <p>
* <b>Amazon Rekognition Face Liveness</b>
* </p>
* <ul>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateFaceLivenessSession.html">CreateFaceLivenessSession</a>
* </p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceLivenessSessionResults.html">GetFaceLivenessSessionResults</a>
* </p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_rekognitionstreaming_StartFaceLivenessSession.html">StartFaceLivenessSession</a>
* </p>
* </li>
* </ul>
*/
export class RekognitionStreaming extends RekognitionStreamingClient {
/**
* @public
* <p>Starts a Face Liveness video stream and liveness detection process for a given
* session.</p>
* <p>Requires <code>sessionId</code>, <code>ChallengeVersions</code>, <code>VideoWidth</code>,
* <code>VideoHeight</code> and a <code>RequestEventStream</code> as input. The event stream
* contains information about different events for the session, including the challenge
* information used for verification. </p>
* <p>The maximum video size for Face Liveness is 10 MB. Face Liveness throws a
* <code>ValidationException</code> if the video does not match the necessary formatting and
* size parameters. </p>
*/
public startFaceLivenessSession(
args: StartFaceLivenessSessionCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,28 @@ export interface RekognitionStreamingClientResolvedConfig extends RekognitionStr

/**
* @public
* <p>A real-time video processing service based on Rekognition. This section documents the API
* operations for Rekognition Face Liveness.</p>
* <p>
* <b>Amazon Rekognition Face Liveness</b>
* </p>
* <ul>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateFaceLivenessSession.html">CreateFaceLivenessSession</a>
* </p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceLivenessSessionResults.html">GetFaceLivenessSessionResults</a>
* </p>
* </li>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_rekognitionstreaming_StartFaceLivenessSession.html">StartFaceLivenessSession</a>
* </p>
* </li>
* </ul>
*/
export class RekognitionStreamingClient extends __Client<
__HttpHandlerOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,115 @@ export interface StartFaceLivenessSessionCommandInput extends StartFaceLivenessS
*/
export interface StartFaceLivenessSessionCommandOutput extends StartFaceLivenessSessionResponse, __MetadataBearer {}

/**
* @public
* <p>Starts a Face Liveness video stream and liveness detection process for a given
* session.</p>
* <p>Requires <code>sessionId</code>, <code>ChallengeVersions</code>, <code>VideoWidth</code>,
* <code>VideoHeight</code> and a <code>RequestEventStream</code> as input. The event stream
* contains information about different events for the session, including the challenge
* information used for verification. </p>
* <p>The maximum video size for Face Liveness is 10 MB. Face Liveness throws a
* <code>ValidationException</code> if the video does not match the necessary formatting and
* size parameters. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { RekognitionStreamingClient, StartFaceLivenessSessionCommand } from "@aws-sdk/client-rekognitionstreaming"; // ES Modules import
* // const { RekognitionStreamingClient, StartFaceLivenessSessionCommand } = require("@aws-sdk/client-rekognitionstreaming"); // CommonJS import
* const client = new RekognitionStreamingClient(config);
* const input = { // StartFaceLivenessSessionRequest
* SessionId: "STRING_VALUE", // required
* VideoWidth: "STRING_VALUE", // required
* VideoHeight: "STRING_VALUE", // required
* ChallengeVersions: "STRING_VALUE", // required
* LivenessRequestStream: { // LivenessRequestStream Union: only one key present
* VideoEvent: { // VideoEvent
* VideoChunk: "BLOB_VALUE",
* TimestampMillis: Number("long"),
* },
* ClientSessionInformationEvent: { // ClientSessionInformationEvent
* Challenge: { // ClientChallenge Union: only one key present
* FaceMovementAndLightChallenge: { // FaceMovementAndLightClientChallenge
* ChallengeId: "STRING_VALUE", // required
* VideoStartTimestamp: Number("long"),
* VideoEndTimestamp: Number("long"),
* InitialFace: { // InitialFace
* BoundingBox: { // BoundingBox
* Width: Number("float"), // required
* Height: Number("float"), // required
* Left: Number("float"), // required
* Top: Number("float"), // required
* },
* InitialFaceDetectedTimestamp: Number("long"), // required
* },
* TargetFace: { // TargetFace
* BoundingBox: {
* Width: Number("float"), // required
* Height: Number("float"), // required
* Left: Number("float"), // required
* Top: Number("float"), // required
* },
* FaceDetectedInTargetPositionStartTimestamp: Number("long"), // required
* FaceDetectedInTargetPositionEndTimestamp: Number("long"), // required
* },
* ColorDisplayed: { // ColorDisplayed
* CurrentColor: { // FreshnessColor
* RGB: [ // ColorComponentList // required
* Number("int"),
* ],
* },
* PreviousColor: {
* RGB: [ // required
* Number("int"),
* ],
* },
* SequenceNumber: Number("int"), // required
* CurrentColorStartTimestamp: Number("long"), // required
* },
* },
* },
* },
* },
* };
* const command = new StartFaceLivenessSessionCommand(input);
* const response = await client.send(command);
* ```
*
* @param StartFaceLivenessSessionCommandInput - {@link StartFaceLivenessSessionCommandInput}
* @returns {@link StartFaceLivenessSessionCommandOutput}
* @see {@link StartFaceLivenessSessionCommandInput} for command's `input` shape.
* @see {@link StartFaceLivenessSessionCommandOutput} for command's `response` shape.
* @see {@link RekognitionStreamingClientResolvedConfig | config} for RekognitionStreamingClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>Occurs when the client isn't authorized to perform the action.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>Unexpected error during processing of request.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>Occurs when a request would cause a service quota to be exceeded.</p>
*
* @throws {@link ServiceUnavailableException} (server fault)
* <p>Service-wide throttling to recover from an operational event or service is not able to scale.</p>
*
* @throws {@link SessionNotFoundException} (client fault)
* <p>Occurs when the given <code>sessionId</code> is not found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>A request was denied due to request throttling. Occurs when too many requests were made by a user
* (exceeding their service quota), the service isn't able to scale, or a service-wide throttling was done to recover from an operational event.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by the service. Potential reasons
* inlcude: video quality or size is invalid, video container format not supported, video does
* not have enough information - no person detected in video, request couldn't be parsed or is
* invalid, session has expired or is invalid, S3 bucket is invalid/in another AWS region, KMS
* Key is invalid.</p>
*
*
*/
export class StartFaceLivenessSessionCommand extends $Command<
StartFaceLivenessSessionCommandInput,
StartFaceLivenessSessionCommandOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"
n=[i],
o=[j],
p=[{[t]:"Region"}];
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://rekognitionstreaming-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://rekognitionstreaming-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://rekognitionstreaming.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://rekognitionstreaming.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://streaming-rekognition-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://streaming-rekognition-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://streaming-rekognition.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://streaming-rekognition.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
export const ruleSet: RuleSetObject = _data;
Loading

0 comments on commit c64cf47

Please sign in to comment.