| 1 | import type * as dataexchange from "@distilled.cloud/aws/dataexchange"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Revision } from "./Revision.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `dataexchange:GetAsset`. |
| 8 | * |
| 9 | * Reads one asset of the bound revision — name, type-specific details |
| 10 | * (S3 snapshot size, API Gateway endpoint, …), and timestamps. The data |
| 11 | * set and revision ids are injected from the binding. |
| 12 | * Provide the implementation with |
| 13 | * `Effect.provide(AWS.DataExchange.GetAssetHttp)`. |
| 14 | * ### Reading Revisions & Assets |
| 15 | * **Example:** Read An Asset's Detail |
| 16 | * ```typescript |
| 17 | * const getAsset = yield* AWS.DataExchange.GetAsset(revision); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const asset = yield* getAsset({ AssetId: assetId }); |
| 21 | * yield* Effect.log(`asset ${asset.Name}`); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface GetAsset extends Binding.Service< |
| 27 | GetAsset, |
| 28 | "AWS.DataExchange.GetAsset", |
| 29 | ( |
| 30 | revision: Revision, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request: Omit<dataexchange.GetAssetRequest, "DataSetId" | "RevisionId">, |
| 34 | ) => Effect.Effect< |
| 35 | dataexchange.GetAssetResponse, |
| 36 | dataexchange.GetAssetError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const GetAsset = Binding.Service<GetAsset>("AWS.DataExchange.GetAsset"); |