| 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 | |
| 5 | /** |
| 6 | * Runtime binding for `dataexchange:CreateJob`. |
| 7 | * |
| 8 | * Creates an import/export job — the Data Exchange work unit that moves |
| 9 | * assets between S3 (or signed URLs, Redshift datashares, API Gateway |
| 10 | * APIs, Lake Formation permissions) and a revision. Import/export jobs |
| 11 | * additionally need S3 permissions on the source/destination bucket — |
| 12 | * attach the matching `AWS.S3` bindings to the same host. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.DataExchange.CreateJobHttp)`. |
| 15 | * ### Import & Export Jobs |
| 16 | * **Example:** Import S3 Objects Into A Revision |
| 17 | * ```typescript |
| 18 | * const createJob = yield* AWS.DataExchange.CreateJob(); |
| 19 | * const startJob = yield* AWS.DataExchange.StartJob(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const job = yield* createJob({ |
| 23 | * Type: "IMPORT_ASSETS_FROM_S3", |
| 24 | * Details: { |
| 25 | * ImportAssetsFromS3: { |
| 26 | * DataSetId: dataSetId, |
| 27 | * RevisionId: revisionId, |
| 28 | * AssetSources: [{ Bucket: bucket, Key: "prices.csv" }], |
| 29 | * }, |
| 30 | * }, |
| 31 | * }); |
| 32 | * yield* startJob({ JobId: job.Id! }); |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface CreateJob extends Binding.Service< |
| 38 | CreateJob, |
| 39 | "AWS.DataExchange.CreateJob", |
| 40 | () => Effect.Effect< |
| 41 | ( |
| 42 | request: dataexchange.CreateJobRequest, |
| 43 | ) => Effect.Effect< |
| 44 | dataexchange.CreateJobResponse, |
| 45 | dataexchange.CreateJobError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | export const CreateJob = Binding.Service<CreateJob>( |
| 50 | "AWS.DataExchange.CreateJob", |
| 51 | ); |