aws-sdk-iot1clickdevicesservice 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 284d573978d5a7f578cf4e246d2239b858194069
4
+ data.tar.gz: 1f61c269ecc7205a608cd2da442b35f02d566565
5
+ SHA512:
6
+ metadata.gz: 24d8fa13e81438ec141690b7e4d03ea95693e1052e45468f5bf7da862b2c7f01903e474b9de7508aa6c6130dbb76bbc7d0f8aa3119ea424008a601c0e67ee9bb
7
+ data.tar.gz: fba7d2638c73a37208aa69633ceaff50048a7a950d4269e03dc6a4ead79fb3c30cfa0c1fec57d853dc9fd6fab99e5b814a2e3187aad93b8c9eb662b11c5c8ee0
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-iot1clickdevicesservice/types'
12
+ require_relative 'aws-sdk-iot1clickdevicesservice/client_api'
13
+ require_relative 'aws-sdk-iot1clickdevicesservice/client'
14
+ require_relative 'aws-sdk-iot1clickdevicesservice/errors'
15
+ require_relative 'aws-sdk-iot1clickdevicesservice/resource'
16
+ require_relative 'aws-sdk-iot1clickdevicesservice/customizations'
17
+
18
+ # This module provides support for AWS IoT 1-Click Devices Service. This module is available in the
19
+ # `aws-sdk-iot1clickdevicesservice` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from AWS IoT 1-Click Devices Service all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::IoT1ClickDevicesService::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::IoT1ClickDevicesService
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,523 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
22
+ require 'aws-sdk-core/plugins/signature_v4.rb'
23
+ require 'aws-sdk-core/plugins/protocols/rest_json.rb'
24
+
25
+ Aws::Plugins::GlobalConfiguration.add_identifier(:iot1clickdevicesservice)
26
+
27
+ module Aws::IoT1ClickDevicesService
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :iot1clickdevicesservice
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::JsonvalueConverter)
50
+ add_plugin(Aws::Plugins::SignatureV4)
51
+ add_plugin(Aws::Plugins::Protocols::RestJson)
52
+
53
+ # @option options [required, Aws::CredentialProvider] :credentials
54
+ # Your AWS credentials. This can be an instance of any one of the
55
+ # following classes:
56
+ #
57
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
58
+ # credentials.
59
+ #
60
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
61
+ # from an EC2 IMDS on an EC2 instance.
62
+ #
63
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
64
+ # shared file, such as `~/.aws/config`.
65
+ #
66
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
67
+ #
68
+ # When `:credentials` are not configured directly, the following
69
+ # locations will be searched for credentials:
70
+ #
71
+ # * `Aws.config[:credentials]`
72
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
73
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
74
+ # * `~/.aws/credentials`
75
+ # * `~/.aws/config`
76
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
77
+ # very aggressive. Construct and pass an instance of
78
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
79
+ # timeouts.
80
+ #
81
+ # @option options [required, String] :region
82
+ # The AWS region to connect to. The configured `:region` is
83
+ # used to determine the service `:endpoint`. When not passed,
84
+ # a default `:region` is search for in the following locations:
85
+ #
86
+ # * `Aws.config[:region]`
87
+ # * `ENV['AWS_REGION']`
88
+ # * `ENV['AMAZON_REGION']`
89
+ # * `ENV['AWS_DEFAULT_REGION']`
90
+ # * `~/.aws/credentials`
91
+ # * `~/.aws/config`
92
+ #
93
+ # @option options [String] :access_key_id
94
+ #
95
+ # @option options [Boolean] :convert_params (true)
96
+ # When `true`, an attempt is made to coerce request parameters into
97
+ # the required types.
98
+ #
99
+ # @option options [String] :endpoint
100
+ # The client endpoint is normally constructed from the `:region`
101
+ # option. You should only configure an `:endpoint` when connecting
102
+ # to test endpoints. This should be avalid HTTP(S) URI.
103
+ #
104
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
105
+ # The log formatter.
106
+ #
107
+ # @option options [Symbol] :log_level (:info)
108
+ # The log level to send messages to the `:logger` at.
109
+ #
110
+ # @option options [Logger] :logger
111
+ # The Logger instance to send log messages to. If this option
112
+ # is not set, logging will be disabled.
113
+ #
114
+ # @option options [String] :profile ("default")
115
+ # Used when loading credentials from the shared credentials file
116
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
117
+ #
118
+ # @option options [Integer] :retry_limit (3)
119
+ # The maximum number of times to retry failed requests. Only
120
+ # ~ 500 level server errors and certain ~ 400 level client errors
121
+ # are retried. Generally, these are throttling errors, data
122
+ # checksum errors, networking errors, timeout errors and auth
123
+ # errors from expired credentials.
124
+ #
125
+ # @option options [String] :secret_access_key
126
+ #
127
+ # @option options [String] :session_token
128
+ #
129
+ # @option options [Boolean] :stub_responses (false)
130
+ # Causes the client to return stubbed responses. By default
131
+ # fake responses are generated and returned. You can specify
132
+ # the response data to return or errors to raise by calling
133
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
134
+ #
135
+ # ** Please note ** When response stubbing is enabled, no HTTP
136
+ # requests are made, and retries are disabled.
137
+ #
138
+ # @option options [Boolean] :validate_params (true)
139
+ # When `true`, request parameters are validated before
140
+ # sending the request.
141
+ #
142
+ def initialize(*args)
143
+ super
144
+ end
145
+
146
+ # @!group API Operations
147
+
148
+ # Adds device(s) to your account (i.e., claim one or more devices) if
149
+ # and only if you received a claim code with the device(s).
150
+ #
151
+ # @option params [required, String] :claim_code
152
+ #
153
+ # @return [Types::ClaimDevicesByClaimCodeResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
154
+ #
155
+ # * {Types::ClaimDevicesByClaimCodeResponse#claim_code #claim_code} => String
156
+ # * {Types::ClaimDevicesByClaimCodeResponse#total #total} => Integer
157
+ #
158
+ # @example Request syntax with placeholder values
159
+ #
160
+ # resp = client.claim_devices_by_claim_code({
161
+ # claim_code: "__string", # required
162
+ # })
163
+ #
164
+ # @example Response structure
165
+ #
166
+ # resp.claim_code #=> String
167
+ # resp.total #=> Integer
168
+ #
169
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCode AWS API Documentation
170
+ #
171
+ # @overload claim_devices_by_claim_code(params = {})
172
+ # @param [Hash] params ({})
173
+ def claim_devices_by_claim_code(params = {}, options = {})
174
+ req = build_request(:claim_devices_by_claim_code, params)
175
+ req.send_request(options)
176
+ end
177
+
178
+ # Given a device ID, returns a DescribeDeviceResponse object describing
179
+ # the details of the device.
180
+ #
181
+ # @option params [required, String] :device_id
182
+ #
183
+ # @return [Types::DescribeDeviceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
184
+ #
185
+ # * {Types::DescribeDeviceResponse#device_description #device_description} => Types::DeviceDescription
186
+ #
187
+ # @example Request syntax with placeholder values
188
+ #
189
+ # resp = client.describe_device({
190
+ # device_id: "__string", # required
191
+ # })
192
+ #
193
+ # @example Response structure
194
+ #
195
+ # resp.device_description.attributes #=> Hash
196
+ # resp.device_description.attributes["__string"] #=> String
197
+ # resp.device_description.device_id #=> String
198
+ # resp.device_description.enabled #=> Boolean
199
+ # resp.device_description.remaining_life #=> Float
200
+ # resp.device_description.type #=> String
201
+ #
202
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDevice AWS API Documentation
203
+ #
204
+ # @overload describe_device(params = {})
205
+ # @param [Hash] params ({})
206
+ def describe_device(params = {}, options = {})
207
+ req = build_request(:describe_device, params)
208
+ req.send_request(options)
209
+ end
210
+
211
+ # Given a device ID, finalizes the claim request for the associated
212
+ # device.
213
+ #
214
+ # <note markdown="1"> Claiming a device consists of initiating a claim, then publishing a
215
+ # device event, and finalizing the claim. For a device of type button, a
216
+ # device event can be published by simply clicking the device.
217
+ #
218
+ # </note>
219
+ #
220
+ # @option params [required, String] :device_id
221
+ #
222
+ # @return [Types::FinalizeDeviceClaimResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
223
+ #
224
+ # * {Types::FinalizeDeviceClaimResponse#state #state} => String
225
+ #
226
+ # @example Request syntax with placeholder values
227
+ #
228
+ # resp = client.finalize_device_claim({
229
+ # device_id: "__string", # required
230
+ # })
231
+ #
232
+ # @example Response structure
233
+ #
234
+ # resp.state #=> String
235
+ #
236
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaim AWS API Documentation
237
+ #
238
+ # @overload finalize_device_claim(params = {})
239
+ # @param [Hash] params ({})
240
+ def finalize_device_claim(params = {}, options = {})
241
+ req = build_request(:finalize_device_claim, params)
242
+ req.send_request(options)
243
+ end
244
+
245
+ # Given a device ID, returns the invokable methods associated with the
246
+ # device.
247
+ #
248
+ # @option params [required, String] :device_id
249
+ #
250
+ # @return [Types::GetDeviceMethodsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
251
+ #
252
+ # * {Types::GetDeviceMethodsResponse#device_methods #device_methods} => Array&lt;Types::DeviceMethod&gt;
253
+ #
254
+ # @example Request syntax with placeholder values
255
+ #
256
+ # resp = client.get_device_methods({
257
+ # device_id: "__string", # required
258
+ # })
259
+ #
260
+ # @example Response structure
261
+ #
262
+ # resp.device_methods #=> Array
263
+ # resp.device_methods[0].device_type #=> String
264
+ # resp.device_methods[0].method_name #=> String
265
+ #
266
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/GetDeviceMethods AWS API Documentation
267
+ #
268
+ # @overload get_device_methods(params = {})
269
+ # @param [Hash] params ({})
270
+ def get_device_methods(params = {}, options = {})
271
+ req = build_request(:get_device_methods, params)
272
+ req.send_request(options)
273
+ end
274
+
275
+ # Given a device ID, initiates a claim request for the associated
276
+ # device.
277
+ #
278
+ # <note markdown="1"> Claiming a device consists of initiating a claim, then publishing a
279
+ # device event, and finalizing the claim. For a device of type button, a
280
+ # device event can be published by simply clicking the device.
281
+ #
282
+ # </note>
283
+ #
284
+ # @option params [required, String] :device_id
285
+ #
286
+ # @return [Types::InitiateDeviceClaimResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
287
+ #
288
+ # * {Types::InitiateDeviceClaimResponse#state #state} => String
289
+ #
290
+ # @example Request syntax with placeholder values
291
+ #
292
+ # resp = client.initiate_device_claim({
293
+ # device_id: "__string", # required
294
+ # })
295
+ #
296
+ # @example Response structure
297
+ #
298
+ # resp.state #=> String
299
+ #
300
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InitiateDeviceClaim AWS API Documentation
301
+ #
302
+ # @overload initiate_device_claim(params = {})
303
+ # @param [Hash] params ({})
304
+ def initiate_device_claim(params = {}, options = {})
305
+ req = build_request(:initiate_device_claim, params)
306
+ req.send_request(options)
307
+ end
308
+
309
+ # Given a device ID, issues a request to invoke a named device method
310
+ # (with possible parameters). See the "Example POST" code snippet
311
+ # below.
312
+ #
313
+ # @option params [required, String] :device_id
314
+ #
315
+ # @option params [Types::DeviceMethod] :device_method
316
+ # The device method to invoke.
317
+ #
318
+ # @option params [String] :device_method_parameters
319
+ # A JSON encoded string containing the device method request parameters.
320
+ #
321
+ # @return [Types::InvokeDeviceMethodResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
322
+ #
323
+ # * {Types::InvokeDeviceMethodResponse#device_method_response #device_method_response} => String
324
+ #
325
+ # @example Request syntax with placeholder values
326
+ #
327
+ # resp = client.invoke_device_method({
328
+ # device_id: "__string", # required
329
+ # device_method: {
330
+ # device_type: "__string",
331
+ # method_name: "__string",
332
+ # },
333
+ # device_method_parameters: "__string",
334
+ # })
335
+ #
336
+ # @example Response structure
337
+ #
338
+ # resp.device_method_response #=> String
339
+ #
340
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InvokeDeviceMethod AWS API Documentation
341
+ #
342
+ # @overload invoke_device_method(params = {})
343
+ # @param [Hash] params ({})
344
+ def invoke_device_method(params = {}, options = {})
345
+ req = build_request(:invoke_device_method, params)
346
+ req.send_request(options)
347
+ end
348
+
349
+ # Using a device ID, returns a DeviceEventsResponse object containing an
350
+ # array of events for the device.
351
+ #
352
+ # @option params [required, String] :device_id
353
+ #
354
+ # @option params [required, Time,DateTime,Date,Integer,String] :from_time_stamp
355
+ #
356
+ # @option params [Integer] :max_results
357
+ #
358
+ # @option params [String] :next_token
359
+ #
360
+ # @option params [required, Time,DateTime,Date,Integer,String] :to_time_stamp
361
+ #
362
+ # @return [Types::ListDeviceEventsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
363
+ #
364
+ # * {Types::ListDeviceEventsResponse#events #events} => Array&lt;Types::DeviceEvent&gt;
365
+ # * {Types::ListDeviceEventsResponse#next_token #next_token} => String
366
+ #
367
+ # @example Request syntax with placeholder values
368
+ #
369
+ # resp = client.list_device_events({
370
+ # device_id: "__string", # required
371
+ # from_time_stamp: Time.now, # required
372
+ # max_results: 1,
373
+ # next_token: "__string",
374
+ # to_time_stamp: Time.now, # required
375
+ # })
376
+ #
377
+ # @example Response structure
378
+ #
379
+ # resp.events #=> Array
380
+ # resp.events[0].device.device_id #=> String
381
+ # resp.events[0].device.type #=> String
382
+ # resp.events[0].std_event #=> String
383
+ # resp.next_token #=> String
384
+ #
385
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDeviceEvents AWS API Documentation
386
+ #
387
+ # @overload list_device_events(params = {})
388
+ # @param [Hash] params ({})
389
+ def list_device_events(params = {}, options = {})
390
+ req = build_request(:list_device_events, params)
391
+ req.send_request(options)
392
+ end
393
+
394
+ # Lists the 1-Click compatible devices associated with your AWS account.
395
+ #
396
+ # @option params [String] :device_type
397
+ #
398
+ # @option params [Integer] :max_results
399
+ #
400
+ # @option params [String] :next_token
401
+ #
402
+ # @return [Types::ListDevicesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
403
+ #
404
+ # * {Types::ListDevicesResponse#devices #devices} => Array&lt;Types::DeviceDescription&gt;
405
+ # * {Types::ListDevicesResponse#next_token #next_token} => String
406
+ #
407
+ # @example Request syntax with placeholder values
408
+ #
409
+ # resp = client.list_devices({
410
+ # device_type: "__string",
411
+ # max_results: 1,
412
+ # next_token: "__string",
413
+ # })
414
+ #
415
+ # @example Response structure
416
+ #
417
+ # resp.devices #=> Array
418
+ # resp.devices[0].attributes #=> Hash
419
+ # resp.devices[0].attributes["__string"] #=> String
420
+ # resp.devices[0].device_id #=> String
421
+ # resp.devices[0].enabled #=> Boolean
422
+ # resp.devices[0].remaining_life #=> Float
423
+ # resp.devices[0].type #=> String
424
+ # resp.next_token #=> String
425
+ #
426
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDevices AWS API Documentation
427
+ #
428
+ # @overload list_devices(params = {})
429
+ # @param [Hash] params ({})
430
+ def list_devices(params = {}, options = {})
431
+ req = build_request(:list_devices, params)
432
+ req.send_request(options)
433
+ end
434
+
435
+ # Disassociates a device from your AWS account using its device ID.
436
+ #
437
+ # @option params [required, String] :device_id
438
+ #
439
+ # @return [Types::UnclaimDeviceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
440
+ #
441
+ # * {Types::UnclaimDeviceResponse#state #state} => String
442
+ #
443
+ # @example Request syntax with placeholder values
444
+ #
445
+ # resp = client.unclaim_device({
446
+ # device_id: "__string", # required
447
+ # })
448
+ #
449
+ # @example Response structure
450
+ #
451
+ # resp.state #=> String
452
+ #
453
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UnclaimDevice AWS API Documentation
454
+ #
455
+ # @overload unclaim_device(params = {})
456
+ # @param [Hash] params ({})
457
+ def unclaim_device(params = {}, options = {})
458
+ req = build_request(:unclaim_device, params)
459
+ req.send_request(options)
460
+ end
461
+
462
+ # Using a Boolean value (true or false), this operation enables or
463
+ # disables the device given a device ID.
464
+ #
465
+ # @option params [required, String] :device_id
466
+ #
467
+ # @option params [Boolean] :enabled
468
+ # If true, the device is enabled. If false, the device is disabled.
469
+ #
470
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
471
+ #
472
+ # @example Request syntax with placeholder values
473
+ #
474
+ # resp = client.update_device_state({
475
+ # device_id: "__string", # required
476
+ # enabled: false,
477
+ # })
478
+ #
479
+ # @see http://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UpdateDeviceState AWS API Documentation
480
+ #
481
+ # @overload update_device_state(params = {})
482
+ # @param [Hash] params ({})
483
+ def update_device_state(params = {}, options = {})
484
+ req = build_request(:update_device_state, params)
485
+ req.send_request(options)
486
+ end
487
+
488
+ # @!endgroup
489
+
490
+ # @param params ({})
491
+ # @api private
492
+ def build_request(operation_name, params = {})
493
+ handlers = @handlers.for(operation_name)
494
+ context = Seahorse::Client::RequestContext.new(
495
+ operation_name: operation_name,
496
+ operation: config.api.operation(operation_name),
497
+ client: self,
498
+ params: params,
499
+ config: config)
500
+ context[:gem_name] = 'aws-sdk-iot1clickdevicesservice'
501
+ context[:gem_version] = '1.0.0'
502
+ Seahorse::Client::Request.new(handlers, context)
503
+ end
504
+
505
+ # @api private
506
+ # @deprecated
507
+ def waiter_names
508
+ []
509
+ end
510
+
511
+ class << self
512
+
513
+ # @api private
514
+ attr_reader :identifier
515
+
516
+ # @api private
517
+ def errors_module
518
+ Errors
519
+ end
520
+
521
+ end
522
+ end
523
+ end