UNPKG

18.3 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 IoT1ClickDevicesService extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: IoT1ClickDevicesService.Types.ClientConfiguration)
13 config: Config & IoT1ClickDevicesService.Types.ClientConfiguration;
14 /**
15 * Adds device(s) to your account (i.e., claim one or more devices) if and only if you
16 received a claim code with the device(s).
17 */
18 claimDevicesByClaimCode(params: IoT1ClickDevicesService.Types.ClaimDevicesByClaimCodeRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ClaimDevicesByClaimCodeResponse) => void): Request<IoT1ClickDevicesService.Types.ClaimDevicesByClaimCodeResponse, AWSError>;
19 /**
20 * Adds device(s) to your account (i.e., claim one or more devices) if and only if you
21 received a claim code with the device(s).
22 */
23 claimDevicesByClaimCode(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ClaimDevicesByClaimCodeResponse) => void): Request<IoT1ClickDevicesService.Types.ClaimDevicesByClaimCodeResponse, AWSError>;
24 /**
25 * Given a device ID, returns a DescribeDeviceResponse object describing the
26 details of the device.
27 */
28 describeDevice(params: IoT1ClickDevicesService.Types.DescribeDeviceRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.DescribeDeviceResponse) => void): Request<IoT1ClickDevicesService.Types.DescribeDeviceResponse, AWSError>;
29 /**
30 * Given a device ID, returns a DescribeDeviceResponse object describing the
31 details of the device.
32 */
33 describeDevice(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.DescribeDeviceResponse) => void): Request<IoT1ClickDevicesService.Types.DescribeDeviceResponse, AWSError>;
34 /**
35 * Given a device ID, finalizes the claim request for the associated device.
36 Claiming a device consists of initiating a claim, then publishing a device event,
37 and finalizing the claim. For a device of type button, a device event can
38 be published by simply clicking the device.
39
40 */
41 finalizeDeviceClaim(params: IoT1ClickDevicesService.Types.FinalizeDeviceClaimRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.FinalizeDeviceClaimResponse) => void): Request<IoT1ClickDevicesService.Types.FinalizeDeviceClaimResponse, AWSError>;
42 /**
43 * Given a device ID, finalizes the claim request for the associated device.
44 Claiming a device consists of initiating a claim, then publishing a device event,
45 and finalizing the claim. For a device of type button, a device event can
46 be published by simply clicking the device.
47
48 */
49 finalizeDeviceClaim(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.FinalizeDeviceClaimResponse) => void): Request<IoT1ClickDevicesService.Types.FinalizeDeviceClaimResponse, AWSError>;
50 /**
51 * Given a device ID, returns the invokable methods associated with the device.
52 */
53 getDeviceMethods(params: IoT1ClickDevicesService.Types.GetDeviceMethodsRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.GetDeviceMethodsResponse) => void): Request<IoT1ClickDevicesService.Types.GetDeviceMethodsResponse, AWSError>;
54 /**
55 * Given a device ID, returns the invokable methods associated with the device.
56 */
57 getDeviceMethods(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.GetDeviceMethodsResponse) => void): Request<IoT1ClickDevicesService.Types.GetDeviceMethodsResponse, AWSError>;
58 /**
59 * Given a device ID, initiates a claim request for the associated device.
60 Claiming a device consists of initiating a claim, then publishing a device event,
61 and finalizing the claim. For a device of type button, a device event can
62 be published by simply clicking the device.
63
64 */
65 initiateDeviceClaim(params: IoT1ClickDevicesService.Types.InitiateDeviceClaimRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.InitiateDeviceClaimResponse) => void): Request<IoT1ClickDevicesService.Types.InitiateDeviceClaimResponse, AWSError>;
66 /**
67 * Given a device ID, initiates a claim request for the associated device.
68 Claiming a device consists of initiating a claim, then publishing a device event,
69 and finalizing the claim. For a device of type button, a device event can
70 be published by simply clicking the device.
71
72 */
73 initiateDeviceClaim(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.InitiateDeviceClaimResponse) => void): Request<IoT1ClickDevicesService.Types.InitiateDeviceClaimResponse, AWSError>;
74 /**
75 * Given a device ID, issues a request to invoke a named device method (with possible
76 parameters). See the "Example POST" code snippet below.
77 */
78 invokeDeviceMethod(params: IoT1ClickDevicesService.Types.InvokeDeviceMethodRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.InvokeDeviceMethodResponse) => void): Request<IoT1ClickDevicesService.Types.InvokeDeviceMethodResponse, AWSError>;
79 /**
80 * Given a device ID, issues a request to invoke a named device method (with possible
81 parameters). See the "Example POST" code snippet below.
82 */
83 invokeDeviceMethod(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.InvokeDeviceMethodResponse) => void): Request<IoT1ClickDevicesService.Types.InvokeDeviceMethodResponse, AWSError>;
84 /**
85 * Using a device ID, returns a DeviceEventsResponse object containing an
86 array of events for the device.
87 */
88 listDeviceEvents(params: IoT1ClickDevicesService.Types.ListDeviceEventsRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ListDeviceEventsResponse) => void): Request<IoT1ClickDevicesService.Types.ListDeviceEventsResponse, AWSError>;
89 /**
90 * Using a device ID, returns a DeviceEventsResponse object containing an
91 array of events for the device.
92 */
93 listDeviceEvents(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ListDeviceEventsResponse) => void): Request<IoT1ClickDevicesService.Types.ListDeviceEventsResponse, AWSError>;
94 /**
95 * Lists the 1-Click compatible devices associated with your AWS account.
96 */
97 listDevices(params: IoT1ClickDevicesService.Types.ListDevicesRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ListDevicesResponse) => void): Request<IoT1ClickDevicesService.Types.ListDevicesResponse, AWSError>;
98 /**
99 * Lists the 1-Click compatible devices associated with your AWS account.
100 */
101 listDevices(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ListDevicesResponse) => void): Request<IoT1ClickDevicesService.Types.ListDevicesResponse, AWSError>;
102 /**
103 * Lists the tags associated with the specified resource ARN.
104 */
105 listTagsForResource(params: IoT1ClickDevicesService.Types.ListTagsForResourceRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ListTagsForResourceResponse) => void): Request<IoT1ClickDevicesService.Types.ListTagsForResourceResponse, AWSError>;
106 /**
107 * Lists the tags associated with the specified resource ARN.
108 */
109 listTagsForResource(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.ListTagsForResourceResponse) => void): Request<IoT1ClickDevicesService.Types.ListTagsForResourceResponse, AWSError>;
110 /**
111 * Adds or updates the tags associated with the resource ARN. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per
112 resource.
113 */
114 tagResource(params: IoT1ClickDevicesService.Types.TagResourceRequest, callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
115 /**
116 * Adds or updates the tags associated with the resource ARN. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per
117 resource.
118 */
119 tagResource(callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
120 /**
121 * Disassociates a device from your AWS account using its device ID.
122 */
123 unclaimDevice(params: IoT1ClickDevicesService.Types.UnclaimDeviceRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.UnclaimDeviceResponse) => void): Request<IoT1ClickDevicesService.Types.UnclaimDeviceResponse, AWSError>;
124 /**
125 * Disassociates a device from your AWS account using its device ID.
126 */
127 unclaimDevice(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.UnclaimDeviceResponse) => void): Request<IoT1ClickDevicesService.Types.UnclaimDeviceResponse, AWSError>;
128 /**
129 * Using tag keys, deletes the tags (key/value pairs) associated with the specified
130 resource ARN.
131 */
132 untagResource(params: IoT1ClickDevicesService.Types.UntagResourceRequest, callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
133 /**
134 * Using tag keys, deletes the tags (key/value pairs) associated with the specified
135 resource ARN.
136 */
137 untagResource(callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
138 /**
139 * Using a Boolean value (true or false), this operation
140 enables or disables the device given a device ID.
141 */
142 updateDeviceState(params: IoT1ClickDevicesService.Types.UpdateDeviceStateRequest, callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.UpdateDeviceStateResponse) => void): Request<IoT1ClickDevicesService.Types.UpdateDeviceStateResponse, AWSError>;
143 /**
144 * Using a Boolean value (true or false), this operation
145 enables or disables the device given a device ID.
146 */
147 updateDeviceState(callback?: (err: AWSError, data: IoT1ClickDevicesService.Types.UpdateDeviceStateResponse) => void): Request<IoT1ClickDevicesService.Types.UpdateDeviceStateResponse, AWSError>;
148}
149declare namespace IoT1ClickDevicesService {
150 export interface Attributes {
151 }
152 export interface ClaimDevicesByClaimCodeRequest {
153 /**
154 * The claim code, starting with "C-", as provided by the device manufacturer.
155 */
156 ClaimCode: __string;
157 }
158 export interface ClaimDevicesByClaimCodeResponse {
159 /**
160 * The claim code provided by the device manufacturer.
161 */
162 ClaimCode?: __stringMin12Max40;
163 /**
164 * The total number of devices associated with the claim code that has been processed in
165 the claim request.
166 */
167 Total?: __integer;
168 }
169 export interface DescribeDeviceRequest {
170 /**
171 * The unique identifier of the device.
172 */
173 DeviceId: __string;
174 }
175 export interface DescribeDeviceResponse {
176 /**
177 * Device details.
178 */
179 DeviceDescription?: DeviceDescription;
180 }
181 export interface Device {
182 /**
183 * The user specified attributes associated with the device for an event.
184 */
185 Attributes?: Attributes;
186 /**
187 * The unique identifier of the device.
188 */
189 DeviceId?: __string;
190 /**
191 * The device type, such as "button".
192 */
193 Type?: __string;
194 }
195 export type DeviceAttributes = {[key: string]: __string};
196 export interface DeviceDescription {
197 /**
198 * The ARN of the device.
199 */
200 Arn?: __string;
201 /**
202 * An array of zero or more elements of DeviceAttribute objects providing
203 user specified device attributes.
204 */
205 Attributes?: DeviceAttributes;
206 /**
207 * The unique identifier of the device.
208 */
209 DeviceId?: __string;
210 /**
211 * A Boolean value indicating whether or not the device is enabled.
212 */
213 Enabled?: __boolean;
214 /**
215 * A value between 0 and 1 inclusive, representing the fraction of life remaining for the
216 device.
217 */
218 RemainingLife?: __doubleMin0Max100;
219 /**
220 * The type of the device, such as "button".
221 */
222 Type?: __string;
223 /**
224 * The tags currently associated with the AWS IoT 1-Click device.
225 */
226 Tags?: __mapOf__string;
227 }
228 export interface DeviceEvent {
229 /**
230 * An object representing the device associated with the event.
231 */
232 Device?: Device;
233 /**
234 * A serialized JSON object representing the device-type specific event.
235 */
236 StdEvent?: __string;
237 }
238 export interface DeviceMethod {
239 /**
240 * The type of the device, such as "button".
241 */
242 DeviceType?: __string;
243 /**
244 * The name of the method applicable to the deviceType.
245 */
246 MethodName?: __string;
247 }
248 export interface FinalizeDeviceClaimRequest {
249 /**
250 * The unique identifier of the device.
251 */
252 DeviceId: __string;
253 /**
254 * A collection of key/value pairs defining the resource tags. For example, {
255 "tags": {"key1": "value1", "key2": "value2"} }. For more information, see AWS
256 Tagging Strategies.
257
258
259 */
260 Tags?: __mapOf__string;
261 }
262 export interface FinalizeDeviceClaimResponse {
263 /**
264 * The device's final claim state.
265 */
266 State?: __string;
267 }
268 export interface GetDeviceMethodsRequest {
269 /**
270 * The unique identifier of the device.
271 */
272 DeviceId: __string;
273 }
274 export interface GetDeviceMethodsResponse {
275 /**
276 * List of available device APIs.
277 */
278 DeviceMethods?: __listOfDeviceMethod;
279 }
280 export interface InitiateDeviceClaimRequest {
281 /**
282 * The unique identifier of the device.
283 */
284 DeviceId: __string;
285 }
286 export interface InitiateDeviceClaimResponse {
287 /**
288 * The device's final claim state.
289 */
290 State?: __string;
291 }
292 export interface InvokeDeviceMethodRequest {
293 /**
294 * The unique identifier of the device.
295 */
296 DeviceId: __string;
297 /**
298 * The device method to invoke.
299 */
300 DeviceMethod?: DeviceMethod;
301 /**
302 * A JSON encoded string containing the device method request parameters.
303 */
304 DeviceMethodParameters?: __string;
305 }
306 export interface InvokeDeviceMethodResponse {
307 /**
308 * A JSON encoded string containing the device method response.
309 */
310 DeviceMethodResponse?: __string;
311 }
312 export interface ListDeviceEventsRequest {
313 /**
314 * The unique identifier of the device.
315 */
316 DeviceId: __string;
317 /**
318 * The start date for the device event query, in ISO8061 format. For example,
319 2018-03-28T15:45:12.880Z
320
321 */
322 FromTimeStamp: __timestampIso8601;
323 /**
324 * The maximum number of results to return per request. If not set, a default value of
325 100 is used.
326 */
327 MaxResults?: MaxResults;
328 /**
329 * The token to retrieve the next set of results.
330 */
331 NextToken?: __string;
332 /**
333 * The end date for the device event query, in ISO8061 format. For example,
334 2018-03-28T15:45:12.880Z
335
336 */
337 ToTimeStamp: __timestampIso8601;
338 }
339 export interface ListDeviceEventsResponse {
340 /**
341 * An array of zero or more elements describing the event(s) associated with the
342 device.
343 */
344 Events?: __listOfDeviceEvent;
345 /**
346 * The token to retrieve the next set of results.
347 */
348 NextToken?: __string;
349 }
350 export interface ListDevicesRequest {
351 /**
352 * The type of the device, such as "button".
353 */
354 DeviceType?: __string;
355 /**
356 * The maximum number of results to return per request. If not set, a default value of
357 100 is used.
358 */
359 MaxResults?: MaxResults;
360 /**
361 * The token to retrieve the next set of results.
362 */
363 NextToken?: __string;
364 }
365 export interface ListDevicesResponse {
366 /**
367 * A list of devices.
368 */
369 Devices?: __listOfDeviceDescription;
370 /**
371 * The token to retrieve the next set of results.
372 */
373 NextToken?: __string;
374 }
375 export interface ListTagsForResourceRequest {
376 /**
377 * The ARN of the resource.
378 */
379 ResourceArn: __string;
380 }
381 export interface ListTagsForResourceResponse {
382 /**
383 * A collection of key/value pairs defining the resource tags. For example, {
384 "tags": {"key1": "value1", "key2": "value2"} }. For more information, see AWS
385 Tagging Strategies.
386
387
388 */
389 Tags?: __mapOf__string;
390 }
391 export type MaxResults = number;
392 export interface TagResourceRequest {
393 /**
394 * The ARN of the resource.
395 */
396 ResourceArn: __string;
397 /**
398 * A collection of key/value pairs defining the resource tags. For example, {
399 "tags": {"key1": "value1", "key2": "value2"} }. For more information, see AWS
400 Tagging Strategies.
401
402
403 */
404 Tags: __mapOf__string;
405 }
406 export interface UnclaimDeviceRequest {
407 /**
408 * The unique identifier of the device.
409 */
410 DeviceId: __string;
411 }
412 export interface UnclaimDeviceResponse {
413 /**
414 * The device's final claim state.
415 */
416 State?: __string;
417 }
418 export interface UntagResourceRequest {
419 /**
420 * The ARN of the resource.
421 */
422 ResourceArn: __string;
423 /**
424 * A collections of tag keys. For example, {"key1","key2"}
425 */
426 TagKeys: __listOf__string;
427 }
428 export interface UpdateDeviceStateRequest {
429 /**
430 * The unique identifier of the device.
431 */
432 DeviceId: __string;
433 /**
434 * If true, the device is enabled. If false, the device is
435 disabled.
436 */
437 Enabled?: __boolean;
438 }
439 export interface UpdateDeviceStateResponse {
440 }
441 export type __boolean = boolean;
442 export type __doubleMin0Max100 = number;
443 export type __integer = number;
444 export type __listOfDeviceDescription = DeviceDescription[];
445 export type __listOfDeviceEvent = DeviceEvent[];
446 export type __listOfDeviceMethod = DeviceMethod[];
447 export type __listOf__string = __string[];
448 export type __mapOf__string = {[key: string]: __string};
449 export type __string = string;
450 export type __stringMin12Max40 = string;
451 export type __timestampIso8601 = Date;
452 /**
453 * 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.
454 */
455 export type apiVersion = "2018-05-14"|"latest"|string;
456 export interface ClientApiVersions {
457 /**
458 * 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.
459 */
460 apiVersion?: apiVersion;
461 }
462 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
463 /**
464 * Contains interfaces for use with the IoT1ClickDevicesService client.
465 */
466 export import Types = IoT1ClickDevicesService;
467}
468export = IoT1ClickDevicesService;