| 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:DetectCustomLabels` — detect custom labels in an image using a trained and running Rekognition Custom Labels model version. |
| 7 | * |
| 8 | * The binding takes no arguments and grants the function |
| 9 | * `rekognition:DetectCustomLabels` 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.DetectCustomLabelsHttp)`. |
| 13 | * |
| 14 | * ### Custom Labels |
| 15 | * **Example:** Detect Custom Labels |
| 16 | * ```typescript |
| 17 | * // init |
| 18 | * const detectCustomLabels = yield* AWS.Rekognition.DetectCustomLabels(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const result = yield* detectCustomLabels({ |
| 22 | * ProjectVersionArn: modelArn, |
| 23 | * Image: { Bytes: imageBytes }, |
| 24 | * MinConfidence: 70, |
| 25 | * }); |
| 26 | * const labels = (result.CustomLabels ?? []).map((l) => l.Name); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface DetectCustomLabels extends Binding.Service< |
| 32 | DetectCustomLabels, |
| 33 | "AWS.Rekognition.DetectCustomLabels", |
| 34 | () => Effect.Effect< |
| 35 | ( |
| 36 | request: rekognition.DetectCustomLabelsRequest, |
| 37 | ) => Effect.Effect< |
| 38 | rekognition.DetectCustomLabelsResponse, |
| 39 | rekognition.DetectCustomLabelsError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const DetectCustomLabels = Binding.Service<DetectCustomLabels>( |
| 44 | "AWS.Rekognition.DetectCustomLabels", |
| 45 | ); |