UNPKG

12.9 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class IoTEventsData extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: IoTEventsData.Types.ClientConfiguration)
13 config: Config & IoTEventsData.Types.ClientConfiguration;
14 /**
15 * Sends a set of messages to the AWS IoT Events system. Each message payload is transformed into the input you specify ("inputName") and ingested into any detectors that monitor that input. If multiple messages are sent, the order in which the messages are processed isn't guaranteed. To guarantee ordering, you must send messages one at a time and wait for a successful response.
16 */
17 batchPutMessage(params: IoTEventsData.Types.BatchPutMessageRequest, callback?: (err: AWSError, data: IoTEventsData.Types.BatchPutMessageResponse) => void): Request<IoTEventsData.Types.BatchPutMessageResponse, AWSError>;
18 /**
19 * Sends a set of messages to the AWS IoT Events system. Each message payload is transformed into the input you specify ("inputName") and ingested into any detectors that monitor that input. If multiple messages are sent, the order in which the messages are processed isn't guaranteed. To guarantee ordering, you must send messages one at a time and wait for a successful response.
20 */
21 batchPutMessage(callback?: (err: AWSError, data: IoTEventsData.Types.BatchPutMessageResponse) => void): Request<IoTEventsData.Types.BatchPutMessageResponse, AWSError>;
22 /**
23 * Updates the state, variable values, and timer settings of one or more detectors (instances) of a specified detector model.
24 */
25 batchUpdateDetector(params: IoTEventsData.Types.BatchUpdateDetectorRequest, callback?: (err: AWSError, data: IoTEventsData.Types.BatchUpdateDetectorResponse) => void): Request<IoTEventsData.Types.BatchUpdateDetectorResponse, AWSError>;
26 /**
27 * Updates the state, variable values, and timer settings of one or more detectors (instances) of a specified detector model.
28 */
29 batchUpdateDetector(callback?: (err: AWSError, data: IoTEventsData.Types.BatchUpdateDetectorResponse) => void): Request<IoTEventsData.Types.BatchUpdateDetectorResponse, AWSError>;
30 /**
31 * Returns information about the specified detector (instance).
32 */
33 describeDetector(params: IoTEventsData.Types.DescribeDetectorRequest, callback?: (err: AWSError, data: IoTEventsData.Types.DescribeDetectorResponse) => void): Request<IoTEventsData.Types.DescribeDetectorResponse, AWSError>;
34 /**
35 * Returns information about the specified detector (instance).
36 */
37 describeDetector(callback?: (err: AWSError, data: IoTEventsData.Types.DescribeDetectorResponse) => void): Request<IoTEventsData.Types.DescribeDetectorResponse, AWSError>;
38 /**
39 * Lists detectors (the instances of a detector model).
40 */
41 listDetectors(params: IoTEventsData.Types.ListDetectorsRequest, callback?: (err: AWSError, data: IoTEventsData.Types.ListDetectorsResponse) => void): Request<IoTEventsData.Types.ListDetectorsResponse, AWSError>;
42 /**
43 * Lists detectors (the instances of a detector model).
44 */
45 listDetectors(callback?: (err: AWSError, data: IoTEventsData.Types.ListDetectorsResponse) => void): Request<IoTEventsData.Types.ListDetectorsResponse, AWSError>;
46}
47declare namespace IoTEventsData {
48 export type BatchPutMessageErrorEntries = BatchPutMessageErrorEntry[];
49 export interface BatchPutMessageErrorEntry {
50 /**
51 * The ID of the message that caused the error. (See the value corresponding to the "messageId" key in the "message" object.)
52 */
53 messageId?: MessageId;
54 /**
55 * The code associated with the error.
56 */
57 errorCode?: ErrorCode;
58 /**
59 * More information about the error.
60 */
61 errorMessage?: ErrorMessage;
62 }
63 export interface BatchPutMessageRequest {
64 /**
65 * The list of messages to send. Each message has the following format: '{ "messageId": "string", "inputName": "string", "payload": "string"}'
66 */
67 messages: Messages;
68 }
69 export interface BatchPutMessageResponse {
70 /**
71 * A list of any errors encountered when sending the messages.
72 */
73 BatchPutMessageErrorEntries?: BatchPutMessageErrorEntries;
74 }
75 export type BatchUpdateDetectorErrorEntries = BatchUpdateDetectorErrorEntry[];
76 export interface BatchUpdateDetectorErrorEntry {
77 /**
78 * The "messageId" of the update request that caused the error. (The value of the "messageId" in the update request "Detector" object.)
79 */
80 messageId?: MessageId;
81 /**
82 * The code of the error.
83 */
84 errorCode?: ErrorCode;
85 /**
86 * A message describing the error.
87 */
88 errorMessage?: ErrorMessage;
89 }
90 export interface BatchUpdateDetectorRequest {
91 /**
92 * The list of detectors (instances) to update, along with the values to update.
93 */
94 detectors: UpdateDetectorRequests;
95 }
96 export interface BatchUpdateDetectorResponse {
97 /**
98 * A list of those detector updates that resulted in errors. (If an error is listed here, the specific update did not occur.)
99 */
100 batchUpdateDetectorErrorEntries?: BatchUpdateDetectorErrorEntries;
101 }
102 export interface DescribeDetectorRequest {
103 /**
104 * The name of the detector model whose detectors (instances) you want information about.
105 */
106 detectorModelName: DetectorModelName;
107 /**
108 * A filter used to limit results to detectors (instances) created because of the given key ID.
109 */
110 keyValue?: KeyValue;
111 }
112 export interface DescribeDetectorResponse {
113 /**
114 * Information about the detector (instance).
115 */
116 detector?: Detector;
117 }
118 export interface Detector {
119 /**
120 * The name of the detector model that created this detector (instance).
121 */
122 detectorModelName?: DetectorModelName;
123 /**
124 * The value of the key (identifying the device or system) that caused the creation of this detector (instance).
125 */
126 keyValue?: KeyValue;
127 /**
128 * The version of the detector model that created this detector (instance).
129 */
130 detectorModelVersion?: DetectorModelVersion;
131 /**
132 * The current state of the detector (instance).
133 */
134 state?: DetectorState;
135 /**
136 * The time the detector (instance) was created.
137 */
138 creationTime?: Timestamp;
139 /**
140 * The time the detector (instance) was last updated.
141 */
142 lastUpdateTime?: Timestamp;
143 }
144 export type DetectorModelName = string;
145 export type DetectorModelVersion = string;
146 export interface DetectorState {
147 /**
148 * The name of the state.
149 */
150 stateName: StateName;
151 /**
152 * The current values of the detector's variables.
153 */
154 variables: Variables;
155 /**
156 * The current state of the detector's timers.
157 */
158 timers: Timers;
159 }
160 export interface DetectorStateDefinition {
161 /**
162 * The name of the new state of the detector (instance).
163 */
164 stateName: StateName;
165 /**
166 * The new values of the detector's variables. Any variable whose value isn't specified is cleared.
167 */
168 variables: VariableDefinitions;
169 /**
170 * The new values of the detector's timers. Any timer whose value isn't specified is cleared, and its timeout event won't occur.
171 */
172 timers: TimerDefinitions;
173 }
174 export interface DetectorStateSummary {
175 /**
176 * The name of the state.
177 */
178 stateName?: StateName;
179 }
180 export type DetectorSummaries = DetectorSummary[];
181 export interface DetectorSummary {
182 /**
183 * The name of the detector model that created this detector (instance).
184 */
185 detectorModelName?: DetectorModelName;
186 /**
187 * The value of the key (identifying the device or system) that caused the creation of this detector (instance).
188 */
189 keyValue?: KeyValue;
190 /**
191 * The version of the detector model that created this detector (instance).
192 */
193 detectorModelVersion?: DetectorModelVersion;
194 /**
195 * The current state of the detector (instance).
196 */
197 state?: DetectorStateSummary;
198 /**
199 * The time the detector (instance) was created.
200 */
201 creationTime?: Timestamp;
202 /**
203 * The time the detector (instance) was last updated.
204 */
205 lastUpdateTime?: Timestamp;
206 }
207 export type ErrorCode = "ResourceNotFoundException"|"InvalidRequestException"|"InternalFailureException"|"ServiceUnavailableException"|"ThrottlingException"|string;
208 export type ErrorMessage = string;
209 export type InputName = string;
210 export type KeyValue = string;
211 export interface ListDetectorsRequest {
212 /**
213 * The name of the detector model whose detectors (instances) are listed.
214 */
215 detectorModelName: DetectorModelName;
216 /**
217 * A filter that limits results to those detectors (instances) in the given state.
218 */
219 stateName?: StateName;
220 /**
221 * The token for the next set of results.
222 */
223 nextToken?: NextToken;
224 /**
225 * The maximum number of results to return at one time.
226 */
227 maxResults?: MaxResults;
228 }
229 export interface ListDetectorsResponse {
230 /**
231 * A list of summary information about the detectors (instances).
232 */
233 detectorSummaries?: DetectorSummaries;
234 /**
235 * A token to retrieve the next set of results, or null if there are no additional results.
236 */
237 nextToken?: NextToken;
238 }
239 export type MaxResults = number;
240 export interface Message {
241 /**
242 * The ID to assign to the message. Within each batch sent, each "messageId" must be unique.
243 */
244 messageId: MessageId;
245 /**
246 * The name of the input into which the message payload is transformed.
247 */
248 inputName: InputName;
249 /**
250 * The payload of the message. This can be a JSON string or a Base-64-encoded string representing binary data (in which case you must decode it).
251 */
252 payload: Payload;
253 }
254 export type MessageId = string;
255 export type Messages = Message[];
256 export type NextToken = string;
257 export type Payload = Buffer|Uint8Array|Blob|string;
258 export type Seconds = number;
259 export type StateName = string;
260 export interface Timer {
261 /**
262 * The name of the timer.
263 */
264 name: TimerName;
265 /**
266 * The number of seconds which have elapsed on the timer.
267 */
268 timestamp: Timestamp;
269 }
270 export interface TimerDefinition {
271 /**
272 * The name of the timer.
273 */
274 name: TimerName;
275 /**
276 * The new setting of the timer (the number of seconds before the timer elapses).
277 */
278 seconds: Seconds;
279 }
280 export type TimerDefinitions = TimerDefinition[];
281 export type TimerName = string;
282 export type Timers = Timer[];
283 export type Timestamp = Date;
284 export interface UpdateDetectorRequest {
285 /**
286 * The ID to assign to the detector update "message". Each "messageId" must be unique within each batch sent.
287 */
288 messageId: MessageId;
289 /**
290 * The name of the detector model that created the detectors (instances).
291 */
292 detectorModelName: DetectorModelName;
293 /**
294 * The value of the input key attribute (identifying the device or system) that caused the creation of this detector (instance).
295 */
296 keyValue?: KeyValue;
297 /**
298 * The new state, variable values, and timer settings of the detector (instance).
299 */
300 state: DetectorStateDefinition;
301 }
302 export type UpdateDetectorRequests = UpdateDetectorRequest[];
303 export interface Variable {
304 /**
305 * The name of the variable.
306 */
307 name: VariableName;
308 /**
309 * The current value of the variable.
310 */
311 value: VariableValue;
312 }
313 export interface VariableDefinition {
314 /**
315 * The name of the variable.
316 */
317 name: VariableName;
318 /**
319 * The new value of the variable.
320 */
321 value: VariableValue;
322 }
323 export type VariableDefinitions = VariableDefinition[];
324 export type VariableName = string;
325 export type VariableValue = string;
326 export type Variables = Variable[];
327 /**
328 * 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.
329 */
330 export type apiVersion = "2018-10-23"|"latest"|string;
331 export interface ClientApiVersions {
332 /**
333 * 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.
334 */
335 apiVersion?: apiVersion;
336 }
337 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
338 /**
339 * Contains interfaces for use with the IoTEventsData client.
340 */
341 export import Types = IoTEventsData;
342}
343export = IoTEventsData;