| 1 | import type * as mi from "@distilled.cloud/aws/iot-managed-integrations"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Request for {@link SendConnectorEvent}. |
| 7 | */ |
| 8 | export interface SendConnectorEventRequest |
| 9 | extends mi.SendConnectorEventRequest {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `iotmanagedintegrations:SendConnectorEvent` |
| 13 | * (account-level). |
| 14 | * |
| 15 | * The cloud-to-cloud connector data plane: a connector Lambda calls this to |
| 16 | * push third-party device events (state reports, discovery results, command |
| 17 | * responses) into Managed integrations. Provide the implementation with |
| 18 | * `Effect.provide(AWS.IoTManagedIntegrations.SendConnectorEventHttp)`. |
| 19 | * |
| 20 | * ### Connectors |
| 21 | * **Example:** Report a Device State Change from a Connector |
| 22 | * ```typescript |
| 23 | * const sendConnectorEvent = yield* IoTManagedIntegrations.SendConnectorEvent(); |
| 24 | * |
| 25 | * yield* sendConnectorEvent({ |
| 26 | * ConnectorId: connectorId, |
| 27 | * Operation: "DEVICE_EVENT", |
| 28 | * ConnectorDeviceId: "third-party-device-1", |
| 29 | * Devices: [ |
| 30 | * { |
| 31 | * ConnectorDeviceId: "third-party-device-1", |
| 32 | * CapabilityReport: capabilityReport, |
| 33 | * }, |
| 34 | * ], |
| 35 | * }); |
| 36 | * ``` |
| 37 | * |
| 38 | * @binding |
| 39 | */ |
| 40 | export interface SendConnectorEvent extends Binding.Service< |
| 41 | SendConnectorEvent, |
| 42 | "AWS.IoTManagedIntegrations.SendConnectorEvent", |
| 43 | () => Effect.Effect< |
| 44 | ( |
| 45 | request: SendConnectorEventRequest, |
| 46 | ) => Effect.Effect< |
| 47 | mi.SendConnectorEventResponse, |
| 48 | mi.SendConnectorEventError |
| 49 | > |
| 50 | > |
| 51 | > {} |
| 52 | export const SendConnectorEvent = Binding.Service<SendConnectorEvent>( |
| 53 | "AWS.IoTManagedIntegrations.SendConnectorEvent", |
| 54 | ); |