| 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:SearchFacesByImage` — search a face collection for faces matching the largest face in a supplied image. |
| 7 | * |
| 8 | * The binding takes no arguments and grants the function |
| 9 | * `rekognition:SearchFacesByImage` 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.SearchFacesByImageHttp)`. |
| 13 | * |
| 14 | * ### Face Collections |
| 15 | * **Example:** Search by Image |
| 16 | * ```typescript |
| 17 | * // init |
| 18 | * const searchFacesByImage = yield* AWS.Rekognition.SearchFacesByImage(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const result = yield* searchFacesByImage({ |
| 22 | * CollectionId: "tenant-42", |
| 23 | * Image: { Bytes: imageBytes }, |
| 24 | * FaceMatchThreshold: 95, |
| 25 | * }); |
| 26 | * const bestMatch = result.FaceMatches?.[0]?.Face?.ExternalImageId; |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface SearchFacesByImage extends Binding.Service< |
| 32 | SearchFacesByImage, |
| 33 | "AWS.Rekognition.SearchFacesByImage", |
| 34 | () => Effect.Effect< |
| 35 | ( |
| 36 | request: rekognition.SearchFacesByImageRequest, |
| 37 | ) => Effect.Effect< |
| 38 | rekognition.SearchFacesByImageResponse, |
| 39 | rekognition.SearchFacesByImageError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const SearchFacesByImage = Binding.Service<SearchFacesByImage>( |
| 44 | "AWS.Rekognition.SearchFacesByImage", |
| 45 | ); |