| 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 | import type { ManagedThing } from "./ManagedThing.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `GetManagedThingConnectivityData` operation (IAM |
| 8 | * action `iotmanagedintegrations:GetManagedThingConnectivityData`), scoped |
| 9 | * to one {@link ManagedThing}. |
| 10 | * |
| 11 | * Reads whether the bound device is currently connected, when its |
| 12 | * connectivity last changed, and the disconnect reason if offline. Provide |
| 13 | * the implementation with |
| 14 | * `Effect.provide(AWS.IoTManagedIntegrations.GetManagedThingConnectivityDataHttp)`. |
| 15 | * |
| 16 | * ### Reading Device State |
| 17 | * **Example:** Check Device Connectivity |
| 18 | * ```typescript |
| 19 | * const getConnectivity = |
| 20 | * yield* IoTManagedIntegrations.GetManagedThingConnectivityData(thing); |
| 21 | * |
| 22 | * const { Connected, DisconnectReason } = yield* getConnectivity(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetManagedThingConnectivityData extends Binding.Service< |
| 28 | GetManagedThingConnectivityData, |
| 29 | "AWS.IoTManagedIntegrations.GetManagedThingConnectivityData", |
| 30 | ( |
| 31 | thing: ManagedThing, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect< |
| 34 | mi.GetManagedThingConnectivityDataResponse, |
| 35 | mi.GetManagedThingConnectivityDataError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetManagedThingConnectivityData = |
| 40 | Binding.Service<GetManagedThingConnectivityData>( |
| 41 | "AWS.IoTManagedIntegrations.GetManagedThingConnectivityData", |
| 42 | ); |