| 1 | import type * as dms from "@distilled.cloud/aws/database-migration-service"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Endpoint } from "./Endpoint.ts"; |
| 5 | import type { ReplicationInstance } from "./ReplicationInstance.ts"; |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for `dms:RefreshSchemas`. |
| 9 | * |
| 10 | * Bind this operation to a ({@link ReplicationInstance}, {@link Endpoint}) |
| 11 | * pair to (re)discover the schemas at the endpoint's database using the |
| 12 | * instance's compute. The refresh runs asynchronously — poll it with |
| 13 | * {@link DescribeRefreshSchemasStatus}, then list the result with |
| 14 | * {@link DescribeSchemas}. Provide the implementation with |
| 15 | * `Effect.provide(AWS.DMS.RefreshSchemasHttp)`. |
| 16 | * ### Refreshing Schemas |
| 17 | * **Example:** Kick Off a Schema Refresh |
| 18 | * ```typescript |
| 19 | * // init — bind the operation to the instance + endpoint |
| 20 | * const refreshSchemas = yield* AWS.DMS.RefreshSchemas(instance, source); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const { RefreshSchemasStatus } = yield* refreshSchemas(); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface RefreshSchemas extends Binding.Service< |
| 29 | RefreshSchemas, |
| 30 | "AWS.DMS.RefreshSchemas", |
| 31 | ( |
| 32 | instance: ReplicationInstance, |
| 33 | endpoint: Endpoint, |
| 34 | ) => Effect.Effect< |
| 35 | () => Effect.Effect<dms.RefreshSchemasResponse, dms.RefreshSchemasError> |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const RefreshSchemas = Binding.Service<RefreshSchemas>( |
| 40 | "AWS.DMS.RefreshSchemas", |
| 41 | ); |