| 1 | import type * as schemas from "@distilled.cloud/aws/schemas"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Schema } from "./Schema.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `schemas:DescribeCodeBinding`. |
| 8 | * |
| 9 | * Reads the code-binding generation status for the bound {@link Schema} in a |
| 10 | * target language — poll it after {@link PutCodeBinding} until the status is |
| 11 | * `CREATE_COMPLETE`. The registry and schema names are injected from the |
| 12 | * binding. Provide the implementation with |
| 13 | * `Effect.provide(AWS.Schemas.DescribeCodeBindingHttp)`. |
| 14 | * ### Code Bindings |
| 15 | * **Example:** Poll Generation Status |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the schema |
| 18 | * const describeCodeBinding = yield* AWS.Schemas.DescribeCodeBinding(schema); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Status } = yield* describeCodeBinding({ Language: "Python36" }); |
| 22 | * if (Status === "CREATE_COMPLETE") { |
| 23 | * // the package is ready to download via GetCodeBindingSource |
| 24 | * } |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface DescribeCodeBinding extends Binding.Service< |
| 30 | DescribeCodeBinding, |
| 31 | "AWS.Schemas.DescribeCodeBinding", |
| 32 | (schema: Schema) => Effect.Effect< |
| 33 | (request: { |
| 34 | /** The target language: `Java8`, `Python36`, `TypeScript3`, or `Go1`. */ |
| 35 | Language: string; |
| 36 | /** The version of the schema. Defaults to the latest. */ |
| 37 | SchemaVersion?: string; |
| 38 | }) => Effect.Effect< |
| 39 | schemas.DescribeCodeBindingResponse, |
| 40 | schemas.DescribeCodeBindingError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const DescribeCodeBinding = Binding.Service<DescribeCodeBinding>( |
| 45 | "AWS.Schemas.DescribeCodeBinding", |
| 46 | ); |