iotdata.d.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. import {Request} from '../lib/request';
  2. import {Response} from '../lib/response';
  3. import {AWSError} from '../lib/error';
  4. import {Service} from '../lib/service';
  5. import {ServiceConfigurationOptions} from '../lib/service';
  6. import {ConfigBase as Config} from '../lib/config-base';
  7. interface Blob {}
  8. declare class IotData extends Service {
  9. /**
  10. * Constructs a service object. This object has one method for each API operation.
  11. */
  12. constructor(options?: IotData.Types.ClientConfiguration)
  13. config: Config & IotData.Types.ClientConfiguration;
  14. /**
  15. * Deletes the shadow for the specified thing. Requires permission to access the DeleteThingShadow action. For more information, see DeleteThingShadow in the IoT Developer Guide.
  16. */
  17. deleteThingShadow(params: IotData.Types.DeleteThingShadowRequest, callback?: (err: AWSError, data: IotData.Types.DeleteThingShadowResponse) => void): Request<IotData.Types.DeleteThingShadowResponse, AWSError>;
  18. /**
  19. * Deletes the shadow for the specified thing. Requires permission to access the DeleteThingShadow action. For more information, see DeleteThingShadow in the IoT Developer Guide.
  20. */
  21. deleteThingShadow(callback?: (err: AWSError, data: IotData.Types.DeleteThingShadowResponse) => void): Request<IotData.Types.DeleteThingShadowResponse, AWSError>;
  22. /**
  23. * Gets the details of a single retained message for the specified topic. This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call ListRetainedMessages. Requires permission to access the GetRetainedMessage action. For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
  24. */
  25. getRetainedMessage(params: IotData.Types.GetRetainedMessageRequest, callback?: (err: AWSError, data: IotData.Types.GetRetainedMessageResponse) => void): Request<IotData.Types.GetRetainedMessageResponse, AWSError>;
  26. /**
  27. * Gets the details of a single retained message for the specified topic. This action returns the message payload of the retained message, which can incur messaging costs. To list only the topic names of the retained messages, call ListRetainedMessages. Requires permission to access the GetRetainedMessage action. For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
  28. */
  29. getRetainedMessage(callback?: (err: AWSError, data: IotData.Types.GetRetainedMessageResponse) => void): Request<IotData.Types.GetRetainedMessageResponse, AWSError>;
  30. /**
  31. * Gets the shadow for the specified thing. Requires permission to access the GetThingShadow action. For more information, see GetThingShadow in the IoT Developer Guide.
  32. */
  33. getThingShadow(params: IotData.Types.GetThingShadowRequest, callback?: (err: AWSError, data: IotData.Types.GetThingShadowResponse) => void): Request<IotData.Types.GetThingShadowResponse, AWSError>;
  34. /**
  35. * Gets the shadow for the specified thing. Requires permission to access the GetThingShadow action. For more information, see GetThingShadow in the IoT Developer Guide.
  36. */
  37. getThingShadow(callback?: (err: AWSError, data: IotData.Types.GetThingShadowResponse) => void): Request<IotData.Types.GetThingShadowResponse, AWSError>;
  38. /**
  39. * Lists the shadows for the specified thing. Requires permission to access the ListNamedShadowsForThing action.
  40. */
  41. listNamedShadowsForThing(params: IotData.Types.ListNamedShadowsForThingRequest, callback?: (err: AWSError, data: IotData.Types.ListNamedShadowsForThingResponse) => void): Request<IotData.Types.ListNamedShadowsForThingResponse, AWSError>;
  42. /**
  43. * Lists the shadows for the specified thing. Requires permission to access the ListNamedShadowsForThing action.
  44. */
  45. listNamedShadowsForThing(callback?: (err: AWSError, data: IotData.Types.ListNamedShadowsForThingResponse) => void): Request<IotData.Types.ListNamedShadowsForThingResponse, AWSError>;
  46. /**
  47. * Lists summary information about the retained messages stored for the account. This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs. To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message. Requires permission to access the ListRetainedMessages action. For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
  48. */
  49. listRetainedMessages(params: IotData.Types.ListRetainedMessagesRequest, callback?: (err: AWSError, data: IotData.Types.ListRetainedMessagesResponse) => void): Request<IotData.Types.ListRetainedMessagesResponse, AWSError>;
  50. /**
  51. * Lists summary information about the retained messages stored for the account. This action returns only the topic names of the retained messages. It doesn't return any message payloads. Although this action doesn't return a message payload, it can still incur messaging costs. To get the message payload of a retained message, call GetRetainedMessage with the topic name of the retained message. Requires permission to access the ListRetainedMessages action. For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
  52. */
  53. listRetainedMessages(callback?: (err: AWSError, data: IotData.Types.ListRetainedMessagesResponse) => void): Request<IotData.Types.ListRetainedMessagesResponse, AWSError>;
  54. /**
  55. * Publishes an MQTT message. Requires permission to access the Publish action. For more information about MQTT messages, see MQTT Protocol in the IoT Developer Guide. For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
  56. */
  57. publish(params: IotData.Types.PublishRequest, callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
  58. /**
  59. * Publishes an MQTT message. Requires permission to access the Publish action. For more information about MQTT messages, see MQTT Protocol in the IoT Developer Guide. For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
  60. */
  61. publish(callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
  62. /**
  63. * Updates the shadow for the specified thing. Requires permission to access the UpdateThingShadow action. For more information, see UpdateThingShadow in the IoT Developer Guide.
  64. */
  65. updateThingShadow(params: IotData.Types.UpdateThingShadowRequest, callback?: (err: AWSError, data: IotData.Types.UpdateThingShadowResponse) => void): Request<IotData.Types.UpdateThingShadowResponse, AWSError>;
  66. /**
  67. * Updates the shadow for the specified thing. Requires permission to access the UpdateThingShadow action. For more information, see UpdateThingShadow in the IoT Developer Guide.
  68. */
  69. updateThingShadow(callback?: (err: AWSError, data: IotData.Types.UpdateThingShadowResponse) => void): Request<IotData.Types.UpdateThingShadowResponse, AWSError>;
  70. }
  71. declare namespace IotData {
  72. export type ContentType = string;
  73. export type CorrelationData = string;
  74. export interface DeleteThingShadowRequest {
  75. /**
  76. * The name of the thing.
  77. */
  78. thingName: ThingName;
  79. /**
  80. * The name of the shadow.
  81. */
  82. shadowName?: ShadowName;
  83. }
  84. export interface DeleteThingShadowResponse {
  85. /**
  86. * The state information, in JSON format.
  87. */
  88. payload: JsonDocument;
  89. }
  90. export interface GetRetainedMessageRequest {
  91. /**
  92. * The topic name of the retained message to retrieve.
  93. */
  94. topic: Topic;
  95. }
  96. export interface GetRetainedMessageResponse {
  97. /**
  98. * The topic name to which the retained message was published.
  99. */
  100. topic?: Topic;
  101. /**
  102. * The Base64-encoded message payload of the retained message body.
  103. */
  104. payload?: Payload;
  105. /**
  106. * The quality of service (QoS) level used to publish the retained message.
  107. */
  108. qos?: Qos;
  109. /**
  110. * The Epoch date and time, in milliseconds, when the retained message was stored by IoT.
  111. */
  112. lastModifiedTime?: Timestamp;
  113. /**
  114. * A base64-encoded JSON string that includes an array of JSON objects, or null if the retained message doesn't include any user properties. The following example userProperties parameter is a JSON string that represents two user properties. Note that it will be base64-encoded: [{"deviceName": "alpha"}, {"deviceCnt": "45"}]
  115. */
  116. userProperties?: UserPropertiesBlob;
  117. }
  118. export interface GetThingShadowRequest {
  119. /**
  120. * The name of the thing.
  121. */
  122. thingName: ThingName;
  123. /**
  124. * The name of the shadow.
  125. */
  126. shadowName?: ShadowName;
  127. }
  128. export interface GetThingShadowResponse {
  129. /**
  130. * The state information, in JSON format.
  131. */
  132. payload?: JsonDocument;
  133. }
  134. export type JsonDocument = Buffer|Uint8Array|Blob|string;
  135. export interface ListNamedShadowsForThingRequest {
  136. /**
  137. * The name of the thing.
  138. */
  139. thingName: ThingName;
  140. /**
  141. * The token to retrieve the next set of results.
  142. */
  143. nextToken?: NextToken;
  144. /**
  145. * The result page size.
  146. */
  147. pageSize?: PageSize;
  148. }
  149. export interface ListNamedShadowsForThingResponse {
  150. /**
  151. * The list of shadows for the specified thing.
  152. */
  153. results?: NamedShadowList;
  154. /**
  155. * The token to use to get the next set of results, or null if there are no additional results.
  156. */
  157. nextToken?: NextToken;
  158. /**
  159. * The Epoch date and time the response was generated by IoT.
  160. */
  161. timestamp?: Timestamp;
  162. }
  163. export interface ListRetainedMessagesRequest {
  164. /**
  165. * To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.
  166. */
  167. nextToken?: NextToken;
  168. /**
  169. * The maximum number of results to return at one time.
  170. */
  171. maxResults?: MaxResults;
  172. }
  173. export interface ListRetainedMessagesResponse {
  174. /**
  175. * A summary list the account's retained messages. The information returned doesn't include the message payloads of the retained messages.
  176. */
  177. retainedTopics?: RetainedMessageList;
  178. /**
  179. * The token for the next set of results, or null if there are no additional results.
  180. */
  181. nextToken?: NextToken;
  182. }
  183. export type MaxResults = number;
  184. export type MessageExpiry = number;
  185. export type NamedShadowList = ShadowName[];
  186. export type NextToken = string;
  187. export type PageSize = number;
  188. export type Payload = Buffer|Uint8Array|Blob|string;
  189. export type PayloadFormatIndicator = "UNSPECIFIED_BYTES"|"UTF8_DATA"|string;
  190. export type PayloadSize = number;
  191. export interface PublishRequest {
  192. /**
  193. * The name of the MQTT topic.
  194. */
  195. topic: Topic;
  196. /**
  197. * The Quality of Service (QoS) level. The default QoS level is 0.
  198. */
  199. qos?: Qos;
  200. /**
  201. * A Boolean value that determines whether to set the RETAIN flag when the message is published. Setting the RETAIN flag causes the message to be retained and sent to new subscribers to the topic. Valid values: true | false Default value: false
  202. */
  203. retain?: Retain;
  204. /**
  205. * The message body. MQTT accepts text, binary, and empty (null) message payloads. Publishing an empty (null) payload with retain = true deletes the retained message identified by topic from Amazon Web Services IoT Core.
  206. */
  207. payload?: Payload;
  208. /**
  209. * A JSON string that contains an array of JSON objects. If you don’t use Amazon Web Services SDK or CLI, you must encode the JSON string to base64 format before adding it to the HTTP header. userProperties is an HTTP header value in the API. The following example userProperties parameter is a JSON string which represents two User Properties. Note that it needs to be base64-encoded: [{"deviceName": "alpha"}, {"deviceCnt": "45"}]
  210. */
  211. userProperties?: UserProperties;
  212. /**
  213. * An Enum string value that indicates whether the payload is formatted as UTF-8. payloadFormatIndicator is an HTTP header value in the API.
  214. */
  215. payloadFormatIndicator?: PayloadFormatIndicator;
  216. /**
  217. * A UTF-8 encoded string that describes the content of the publishing message.
  218. */
  219. contentType?: ContentType;
  220. /**
  221. * A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.
  222. */
  223. responseTopic?: ResponseTopic;
  224. /**
  225. * The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received. correlationData is an HTTP header value in the API.
  226. */
  227. correlationData?: CorrelationData;
  228. /**
  229. * A user-defined integer value that represents the message expiry interval in seconds. If absent, the message doesn't expire. For more information about the limits of messageExpiry, see Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
  230. */
  231. messageExpiry?: MessageExpiry;
  232. }
  233. export type Qos = number;
  234. export type ResponseTopic = string;
  235. export type Retain = boolean;
  236. export type RetainedMessageList = RetainedMessageSummary[];
  237. export interface RetainedMessageSummary {
  238. /**
  239. * The topic name to which the retained message was published.
  240. */
  241. topic?: Topic;
  242. /**
  243. * The size of the retained message's payload in bytes.
  244. */
  245. payloadSize?: PayloadSize;
  246. /**
  247. * The quality of service (QoS) level used to publish the retained message.
  248. */
  249. qos?: Qos;
  250. /**
  251. * The Epoch date and time, in milliseconds, when the retained message was stored by IoT.
  252. */
  253. lastModifiedTime?: Timestamp;
  254. }
  255. export type ShadowName = string;
  256. export type ThingName = string;
  257. export type Timestamp = number;
  258. export type Topic = string;
  259. export interface UpdateThingShadowRequest {
  260. /**
  261. * The name of the thing.
  262. */
  263. thingName: ThingName;
  264. /**
  265. * The name of the shadow.
  266. */
  267. shadowName?: ShadowName;
  268. /**
  269. * The state information, in JSON format.
  270. */
  271. payload: JsonDocument;
  272. }
  273. export interface UpdateThingShadowResponse {
  274. /**
  275. * The state information, in JSON format.
  276. */
  277. payload?: JsonDocument;
  278. }
  279. export type UserProperties = string;
  280. export type UserPropertiesBlob = Buffer|Uint8Array|Blob|string;
  281. /**
  282. * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
  283. */
  284. export type apiVersion = "2015-05-28"|"latest"|string;
  285. export interface ClientApiVersions {
  286. /**
  287. * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
  288. */
  289. apiVersion?: apiVersion;
  290. }
  291. export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
  292. /**
  293. * Contains interfaces for use with the IotData client.
  294. */
  295. export import Types = IotData;
  296. }
  297. export = IotData;