| 1 | import type * as bcm from "@distilled.cloud/aws/bcm-data-exports"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Export } from "./Export.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `bcm-data-exports:GetExport`. |
| 8 | * |
| 9 | * Bind this operation to an {@link Export} to read the export's live |
| 10 | * definition — SQL query, table configurations, S3 destination, and refresh |
| 11 | * cadence — from inside a function runtime. Useful for cost dashboards that |
| 12 | * surface where their billing data lands. Provide the implementation with |
| 13 | * `Effect.provide(AWS.BCMDataExports.GetExportHttp)`. |
| 14 | * ### Inspecting an Export |
| 15 | * **Example:** Read the Export's Definition |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the export |
| 18 | * const getExport = yield* AWS.BCMDataExports.GetExport(cur); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Export: definition } = yield* getExport(); |
| 22 | * const bucket = definition?.DestinationConfigurations.S3Destination.S3Bucket; |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetExport extends Binding.Service< |
| 28 | GetExport, |
| 29 | "AWS.BCMDataExports.GetExport", |
| 30 | ( |
| 31 | dataExport: Export, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect<bcm.GetExportResponse, bcm.GetExportError> |
| 34 | > |
| 35 | > {} |
| 36 | |
| 37 | export const GetExport = Binding.Service<GetExport>( |
| 38 | "AWS.BCMDataExports.GetExport", |
| 39 | ); |