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