| 1 | import type * as iotw from "@distilled.cloud/aws/iot-wireless"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { WirelessGateway } from "./WirelessGateway.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request for {@link GetWirelessGatewayStatistics}. The bound gateway's id |
| 8 | * is injected automatically, leaving nothing else to supply. |
| 9 | */ |
| 10 | export interface GetWirelessGatewayStatisticsRequest extends Omit< |
| 11 | iotw.GetWirelessGatewayStatisticsRequest, |
| 12 | "WirelessGatewayId" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `iotwireless:GetWirelessGatewayStatistics` — read the |
| 17 | * bound wireless gateway's operating information (connection status, last |
| 18 | * uplink time) from a deployed Lambda or Task. |
| 19 | * |
| 20 | * ### Reading Gateway Statistics |
| 21 | * Provide the `GetWirelessGatewayStatisticsHttp` implementation layer on |
| 22 | * the Function effect, bind the gateway in the init phase, then call the |
| 23 | * returned client at runtime. |
| 24 | * |
| 25 | * **Example:** Check the Gateway's Connection Status |
| 26 | * ```typescript |
| 27 | * // init |
| 28 | * const getStats = yield* AWS.IoTWireless.GetWirelessGatewayStatistics(gateway); |
| 29 | * |
| 30 | * // runtime |
| 31 | * const stats = yield* getStats(); |
| 32 | * const online = stats.ConnectionStatus === "Connected"; |
| 33 | * // on the Function effect: |
| 34 | * // .pipe(Effect.provide(AWS.IoTWireless.GetWirelessGatewayStatisticsHttp)) |
| 35 | * ``` |
| 36 | * |
| 37 | * @binding |
| 38 | */ |
| 39 | export interface GetWirelessGatewayStatistics extends Binding.Service< |
| 40 | GetWirelessGatewayStatistics, |
| 41 | "AWS.IoTWireless.GetWirelessGatewayStatistics", |
| 42 | ( |
| 43 | gateway: WirelessGateway, |
| 44 | ) => Effect.Effect< |
| 45 | ( |
| 46 | request?: GetWirelessGatewayStatisticsRequest, |
| 47 | ) => Effect.Effect< |
| 48 | iotw.GetWirelessGatewayStatisticsResponse, |
| 49 | iotw.GetWirelessGatewayStatisticsError |
| 50 | > |
| 51 | > |
| 52 | > {} |
| 53 | export const GetWirelessGatewayStatistics = |
| 54 | Binding.Service<GetWirelessGatewayStatistics>( |
| 55 | "AWS.IoTWireless.GetWirelessGatewayStatistics", |
| 56 | ); |