| 1 | import type * as rekognition from "@distilled.cloud/aws/rekognition"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `rekognition:IndexFaces` — detect faces in an image and add them to a face collection for later search. |
| 7 | * |
| 8 | * The binding takes no arguments and grants the function |
| 9 | * `rekognition:IndexFaces` on `*` (Rekognition data-plane resources such |
| 10 | * as collections, users, and jobs are routinely created at runtime, so |
| 11 | * their identifiers are unknown at deploy time). Provide the |
| 12 | * implementation with `Effect.provide(AWS.Rekognition.IndexFacesHttp)`. |
| 13 | * |
| 14 | * ### Face Collections |
| 15 | * **Example:** Index Faces into a Collection |
| 16 | * ```typescript |
| 17 | * // init |
| 18 | * const indexFaces = yield* AWS.Rekognition.IndexFaces(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const result = yield* indexFaces({ |
| 22 | * CollectionId: "tenant-42", |
| 23 | * Image: { S3Object: { Bucket: "photos", Name: "profile.jpg" } }, |
| 24 | * ExternalImageId: userId, |
| 25 | * }); |
| 26 | * const faceIds = (result.FaceRecords ?? []).map((r) => r.Face?.FaceId); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface IndexFaces extends Binding.Service< |
| 32 | IndexFaces, |
| 33 | "AWS.Rekognition.IndexFaces", |
| 34 | () => Effect.Effect< |
| 35 | ( |
| 36 | request: rekognition.IndexFacesRequest, |
| 37 | ) => Effect.Effect< |
| 38 | rekognition.IndexFacesResponse, |
| 39 | rekognition.IndexFacesError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const IndexFaces = Binding.Service<IndexFaces>( |
| 44 | "AWS.Rekognition.IndexFaces", |
| 45 | ); |