| 1 | import type * as polly from "@distilled.cloud/aws/polly"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `polly:DescribeVoices` — list the voices available |
| 7 | * for speech synthesis, optionally filtered by engine or language. |
| 8 | * |
| 9 | * Polly voices are account-wide, so the binding takes no arguments and |
| 10 | * grants the function `polly:DescribeVoices`. Provide the implementation |
| 11 | * with `Effect.provide(AWS.Polly.DescribeVoicesHttp)`. |
| 12 | * |
| 13 | * ### Discovering Voices |
| 14 | * **Example:** List US English voices |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const describeVoices = yield* AWS.Polly.DescribeVoices(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const result = yield* describeVoices({ LanguageCode: "en-US" }); |
| 21 | * const voiceIds = (result.Voices ?? []).map((voice) => voice.Id); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface DescribeVoices extends Binding.Service< |
| 27 | DescribeVoices, |
| 28 | "AWS.Polly.DescribeVoices", |
| 29 | () => Effect.Effect< |
| 30 | ( |
| 31 | request?: polly.DescribeVoicesInput, |
| 32 | ) => Effect.Effect<polly.DescribeVoicesOutput, polly.DescribeVoicesError> |
| 33 | > |
| 34 | > {} |
| 35 | export const DescribeVoices = Binding.Service<DescribeVoices>( |
| 36 | "AWS.Polly.DescribeVoices", |
| 37 | ); |