Skip to content

Commit

Permalink
feat(clients): update command documentation examples as of 2023-06-13
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Jun 13, 2023
1 parent c1ce7e1 commit 34ef217
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 0 deletions.
45 changes: 45 additions & 0 deletions clients/client-rekognition/src/commands/AssociateFacesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,51 @@ export interface AssociateFacesCommandOutput extends AssociateFacesResponse, __M
* @throws {@link RekognitionServiceException}
* <p>Base exception class for all service exceptions from Rekognition service.</p>
*
* @example AssociateFaces
* ```javascript
* // This operation associates one or more faces with an existing UserID.
* const input = {
* "ClientRequestToken": "550e8400-e29b-41d4-a716-446655440002",
* "CollectionId": "MyCollection",
* "FaceIds": [
* "f5817d37-94f6-4335-bfee-6cf79a3d806e",
* "851cb847-dccc-4fea-9309-9f4805967855",
* "35ebbb41-7f67-4263-908d-dd0ecba05ab9"
* ],
* "UserId": "DemoUser",
* "UserMatchThreshold": 70
* };
* const command = new AssociateFacesCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "AssociatedFaces": [
* {
* "FaceId": "35ebbb41-7f67-4263-908d-dd0ecba05ab9"
* }
* ],
* "UnsuccessfulFaceAssociations": [
* {
* "Confidence": 0.9375374913215637,
* "FaceId": "f5817d37-94f6-4335-bfee-6cf79a3d806e",
* "Reasons": [
* "LOW_MATCH_CONFIDENCE"
* ]
* },
* {
* "FaceId": "851cb847-dccc-4fea-9309-9f4805967855",
* "Reasons": [
* "ASSOCIATED_TO_A_DIFFERENT_USER"
* ],
* "UserId": "demoUser2"
* }
* ],
* "UserStatus": "UPDATING"
* }
* *\/
* // example id: associatefaces-1686181269281
* ```
*
*/
export class AssociateFacesCommand extends $Command<
AssociateFacesCommandInput,
Expand Down
12 changes: 12 additions & 0 deletions clients/client-rekognition/src/commands/CreateUserCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ export interface CreateUserCommandOutput extends CreateUserResponse, __MetadataB
* @throws {@link RekognitionServiceException}
* <p>Base exception class for all service exceptions from Rekognition service.</p>
*
* @example CreateUser
* ```javascript
* // Creates a new User within a collection specified by CollectionId.
* const input = {
* "CollectionId": "MyCollection",
* "UserId": "DemoUser"
* };
* const command = new CreateUserCommand(input);
* await client.send(command);
* // example id: createuser-1686181562299
* ```
*
*/
export class CreateUserCommand extends $Command<
CreateUserCommandInput,
Expand Down
13 changes: 13 additions & 0 deletions clients/client-rekognition/src/commands/DeleteUserCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@ export interface DeleteUserCommandOutput extends DeleteUserResponse, __MetadataB
* @throws {@link RekognitionServiceException}
* <p>Base exception class for all service exceptions from Rekognition service.</p>
*
* @example DeleteUser
* ```javascript
* // Deletes the specified UserID within the collection.
* const input = {
* "ClientRequestToken": "550e8400-e29b-41d4-a716-446655440001",
* "CollectionId": "MyCollection",
* "UserId": "DemoUser"
* };
* const command = new DeleteUserCommand(input);
* await client.send(command);
* // example id: deleteuser-1686181913475
* ```
*
*/
export class DeleteUserCommand extends $Command<
DeleteUserCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,42 @@ export interface DisassociateFacesCommandOutput extends DisassociateFacesRespons
* @throws {@link RekognitionServiceException}
* <p>Base exception class for all service exceptions from Rekognition service.</p>
*
* @example DisassociateFaces
* ```javascript
* // Removes the association between a Face supplied in an array of FaceIds and the User.
* const input = {
* "ClientRequestToken": "550e8400-e29b-41d4-a716-446655440003",
* "CollectionId": "MyCollection",
* "FaceIds": [
* "f5817d37-94f6-4335-bfee-6cf79a3d806e",
* "c92265d4-5f9c-43af-a58e-12be0ce02bc3"
* ],
* "UserId": "DemoUser"
* };
* const command = new DisassociateFacesCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "DisassociatedFaces": [
* {
* "FaceId": "c92265d4-5f9c-43af-a58e-12be0ce02bc3"
* }
* ],
* "UnsuccessfulFaceDisassociations": [
* {
* "FaceId": "f5817d37-94f6-4335-bfee-6cf79a3d806e",
* "Reasons": [
* "ASSOCIATED_TO_A_DIFFERENT_USER"
* ],
* "UserId": "demoUser1"
* }
* ],
* "UserStatus": "UPDATING"
* }
* *\/
* // example id: disassociatefaces-1686182627295
* ```
*
*/
export class DisassociateFacesCommand extends $Command<
DisassociateFacesCommandInput,
Expand Down
26 changes: 26 additions & 0 deletions clients/client-rekognition/src/commands/ListUsersCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,32 @@ export interface ListUsersCommandOutput extends ListUsersResponse, __MetadataBea
* @throws {@link RekognitionServiceException}
* <p>Base exception class for all service exceptions from Rekognition service.</p>
*
* @example ListUsers
* ```javascript
* // Returns metadata of the User such as UserID in the specified collection.
* const input = {
* "CollectionId": "MyCollection"
* };
* const command = new ListUsersCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "NextToken": "MGYZLAHX1T5a....",
* "Users": [
* {
* "UserId": "demoUser4",
* "UserStatus": "CREATED"
* },
* {
* "UserId": "demoUser2",
* "UserStatus": "CREATED"
* }
* ]
* }
* *\/
* // example id: listusers-1686182360075
* ```
*
*/
export class ListUsersCommand extends $Command<
ListUsersCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,78 @@ export interface SearchUsersByImageCommandOutput extends SearchUsersByImageRespo
* @throws {@link RekognitionServiceException}
* <p>Base exception class for all service exceptions from Rekognition service.</p>
*
* @example SearchUsersByImage
* ```javascript
* // Searches for UserIDs using a supplied image.
* const input = {
* "CollectionId": "MyCollection",
* "Image": {
* "S3Object": {
* "Bucket": "bucket",
* "Name": "input.jpg"
* }
* },
* "MaxUsers": 2,
* "QualityFilter": "MEDIUM",
* "UserMatchThreshold": 70
* };
* const command = new SearchUsersByImageCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "FaceModelVersion": "6",
* "SearchedFace": {
* "FaceDetail": {
* "BoundingBox": {
* "Height": 0.07510016113519669,
* "Left": 0.3598678708076477,
* "Top": 0.5391526818275452,
* "Width": 0.03692837432026863
* }
* }
* },
* "UnsearchedFaces": [
* {
* "FaceDetails": {
* "BoundingBox": {
* "Height": 0.0682177022099495,
* "Left": 0.6102562546730042,
* "Top": 0.5593535900115967,
* "Width": 0.031677018851041794
* }
* },
* "Reasons": [
* "FACE_NOT_LARGEST"
* ]
* },
* {
* "FaceDetails": {
* "BoundingBox": {
* "Height": 0.06347997486591339,
* "Left": 0.516062319278717,
* "Top": 0.6080358028411865,
* "Width": 0.03254449740052223
* }
* },
* "Reasons": [
* "FACE_NOT_LARGEST"
* ]
* }
* ],
* "UserMatches": [
* {
* "Similarity": 99.88186645507812,
* "User": {
* "UserId": "demoUser1",
* "UserStatus": "ACTIVE"
* }
* }
* ]
* }
* *\/
* // example id: searchusersbyimage-1686183178610
* ```
*
*/
export class SearchUsersByImageCommand extends $Command<
SearchUsersByImageCommandInput,
Expand Down
31 changes: 31 additions & 0 deletions clients/client-rekognition/src/commands/SearchUsersCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,37 @@ export interface SearchUsersCommandOutput extends SearchUsersResponse, __Metadat
* @throws {@link RekognitionServiceException}
* <p>Base exception class for all service exceptions from Rekognition service.</p>
*
* @example SearchUsers
* ```javascript
* // Searches for UserIDs within a collection based on a FaceId or UserId.
* const input = {
* "CollectionId": "MyCollection",
* "MaxUsers": 2,
* "UserId": "DemoUser",
* "UserMatchThreshold": 70
* };
* const command = new SearchUsersCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "FaceModelVersion": "6",
* "SearchedUser": {
* "UserId": "DemoUser"
* },
* "UserMatches": [
* {
* "Similarity": 99.88186645507812,
* "User": {
* "UserId": "demoUser1",
* "UserStatus": "ACTIVE"
* }
* }
* ]
* }
* *\/
* // example id: searchusers-1686182912030
* ```
*
*/
export class SearchUsersCommand extends $Command<
SearchUsersCommandInput,
Expand Down

0 comments on commit 34ef217

Please sign in to comment.