| 1 | import type * as datazone from "@distilled.cloud/aws/datazone"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Domain } from "./Domain.ts"; |
| 5 | |
| 6 | export interface CreateAssetRequest extends Omit< |
| 7 | datazone.CreateAssetInput, |
| 8 | "domainIdentifier" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `datazone:CreateAsset`. |
| 13 | * |
| 14 | * Creates an asset in the bound domain's inventory, e.g. to register data produced by the function itself. The domain id is injected from the binding. |
| 15 | * Provide the implementation with |
| 16 | * `Effect.provide(AWS.DataZone.CreateAssetHttp)`. |
| 17 | * ### Publishing Assets |
| 18 | * **Example:** Register an Asset |
| 19 | * ```typescript |
| 20 | * // init — bind the operation to the domain |
| 21 | * const createAsset = yield* AWS.DataZone.CreateAsset(domain); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const asset = yield* createAsset({ |
| 25 | * name: "daily-orders", |
| 26 | * typeIdentifier: "amazon.datazone.S3ObjectCollectionAssetType", |
| 27 | * owningProjectIdentifier: projectId, |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface CreateAsset extends Binding.Service< |
| 34 | CreateAsset, |
| 35 | "AWS.DataZone.CreateAsset", |
| 36 | ( |
| 37 | domain: Domain, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: CreateAssetRequest, |
| 41 | ) => Effect.Effect<datazone.CreateAssetOutput, datazone.CreateAssetError> |
| 42 | > |
| 43 | > {} |
| 44 | export const CreateAsset = Binding.Service<CreateAsset>( |
| 45 | "AWS.DataZone.CreateAsset", |
| 46 | ); |