| 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 { DataSet } from "./DataSet.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `dataexchange:SendDataSetNotification`. |
| 8 | * |
| 9 | * Sends a provider-generated notification about the bound data set to |
| 10 | * its subscribers (`DATA_UPDATE`, `DATA_DELAY`, `SCHEMA_CHANGE`, or |
| 11 | * `DEPRECATION`) — delivered to each subscriber's default EventBridge |
| 12 | * bus. The data set id is injected from the binding. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.DataExchange.SendDataSetNotificationHttp)`. |
| 15 | * ### Notifying Subscribers |
| 16 | * **Example:** Announce A Data Update |
| 17 | * ```typescript |
| 18 | * const notify = yield* AWS.DataExchange.SendDataSetNotification(dataSet); |
| 19 | * |
| 20 | * // runtime — after publishing a new revision |
| 21 | * yield* notify({ Type: "DATA_UPDATE", Comment: "Daily prices refreshed" }); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface SendDataSetNotification extends Binding.Service< |
| 27 | SendDataSetNotification, |
| 28 | "AWS.DataExchange.SendDataSetNotification", |
| 29 | ( |
| 30 | dataSet: DataSet, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request: Omit<dataexchange.SendDataSetNotificationRequest, "DataSetId">, |
| 34 | ) => Effect.Effect< |
| 35 | dataexchange.SendDataSetNotificationResponse, |
| 36 | dataexchange.SendDataSetNotificationError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const SendDataSetNotification = Binding.Service<SendDataSetNotification>( |
| 41 | "AWS.DataExchange.SendDataSetNotification", |
| 42 | ); |