UNPKG

aws-iot-device-sdk-v2

Version:
182 lines (181 loc) 7.36 kB
/** * @packageDocumentation * @module shadow */ import { mqtt, mqtt5 } from 'aws-crt'; import { mqtt_request_response as mqtt_rr_internal } from 'aws-crt'; import * as mqtt_request_response from '../mqtt_request_response'; import * as model from './model'; /** * The AWS IoT Device Shadow service adds shadows to AWS IoT thing objects. Shadows are a simple data store for device properties and state. Shadows can make a device’s state available to apps and other services whether the device is connected to AWS IoT or not. * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html * * @category IotShadow */ export declare class IotShadowClientv2 { private rrClient; private serviceModel; private constructor(); /** * Creates a new service client that will use an SDK MQTT 311 client as transport. * * @param protocolClient the MQTT 311 client to use for transport * @param options additional service client configuration options * * @return a new service client * */ static newFromMqtt311(protocolClient: mqtt.MqttClientConnection, options: mqtt_rr_internal.RequestResponseClientOptions): IotShadowClientv2; /** * Creates a new service client that will use an SDK MQTT 5 client as transport. * * @param protocolClient the MQTT 5 client to use for transport * @param options additional service client configuration options * * @return a new service client * */ static newFromMqtt5(protocolClient: mqtt5.Mqtt5Client, options: mqtt_rr_internal.RequestResponseClientOptions): IotShadowClientv2; /** * Triggers cleanup of all resources associated with the service client. Closing a client will fail * all incomplete requests and close all unclosed streaming operations. * * This must be called when finished with a client; otherwise, native resources will leak. */ close(): void; /** * Deletes a named shadow for an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-pub-sub-topic * * @param request operation to perform * * @return Promise which resolves into the response to the request * * @category IotShadow */ deleteNamedShadow(request: model.DeleteNamedShadowRequest): Promise<model.DeleteShadowResponse>; /** * Deletes the (classic) shadow for an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-pub-sub-topic * * @param request operation to perform * * @return Promise which resolves into the response to the request * * @category IotShadow */ deleteShadow(request: model.DeleteShadowRequest): Promise<model.DeleteShadowResponse>; /** * Gets a named shadow for an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-pub-sub-topic * * @param request operation to perform * * @return Promise which resolves into the response to the request * * @category IotShadow */ getNamedShadow(request: model.GetNamedShadowRequest): Promise<model.GetShadowResponse>; /** * Gets the (classic) shadow for an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-pub-sub-topic * * @param request operation to perform * * @return Promise which resolves into the response to the request * * @category IotShadow */ getShadow(request: model.GetShadowRequest): Promise<model.GetShadowResponse>; /** * Update a named shadow for a device. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-pub-sub-topic * * @param request operation to perform * * @return Promise which resolves into the response to the request * * @category IotShadow */ updateNamedShadow(request: model.UpdateNamedShadowRequest): Promise<model.UpdateShadowResponse>; /** * Update a device's (classic) shadow. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-pub-sub-topic * * @param request operation to perform * * @return Promise which resolves into the response to the request * * @category IotShadow */ updateShadow(request: model.UpdateShadowRequest): Promise<model.UpdateShadowResponse>; /** * Create a stream for NamedShadowDelta events for a named shadow of an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-delta-pub-sub-topic * * @param config streaming operation configuration options * * @return a streaming operation which will emit an event every time a message is received on the * associated MQTT topic * * @category IotShadow */ createNamedShadowDeltaUpdatedStream(config: model.NamedShadowDeltaUpdatedSubscriptionRequest): mqtt_request_response.StreamingOperation<model.ShadowDeltaUpdatedEvent>; /** * Create a stream for ShadowUpdated events for a named shadow of an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-documents-pub-sub-topic * * @param config streaming operation configuration options * * @return a streaming operation which will emit an event every time a message is received on the * associated MQTT topic * * @category IotShadow */ createNamedShadowUpdatedStream(config: model.NamedShadowUpdatedSubscriptionRequest): mqtt_request_response.StreamingOperation<model.ShadowUpdatedEvent>; /** * Create a stream for ShadowDelta events for the (classic) shadow of an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-delta-pub-sub-topic * * @param config streaming operation configuration options * * @return a streaming operation which will emit an event every time a message is received on the * associated MQTT topic * * @category IotShadow */ createShadowDeltaUpdatedStream(config: model.ShadowDeltaUpdatedSubscriptionRequest): mqtt_request_response.StreamingOperation<model.ShadowDeltaUpdatedEvent>; /** * Create a stream for ShadowUpdated events for the (classic) shadow of an AWS IoT thing. * * * AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-documents-pub-sub-topic * * @param config streaming operation configuration options * * @return a streaming operation which will emit an event every time a message is received on the * associated MQTT topic * * @category IotShadow */ createShadowUpdatedStream(config: model.ShadowUpdatedSubscriptionRequest): mqtt_request_response.StreamingOperation<model.ShadowUpdatedEvent>; }