google-cloud-iot-v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/iot/v1"
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/iot/v1/device_manager"
20
+ require "google/cloud/iot/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Iot
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/iot/v1"
29
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new
30
+ #
31
+ module V1
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/iot/v1/version"
24
+
25
+ require "google/cloud/iot/v1/device_manager/credentials"
26
+ require "google/cloud/iot/v1/device_manager/paths"
27
+ require "google/cloud/iot/v1/device_manager/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Iot
32
+ module V1
33
+ ##
34
+ # Internet of Things (IoT) service. Securely connect and manage IoT devices.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/iot/v1/device_manager"
39
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new
40
+ #
41
+ module DeviceManager
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "device_manager", "helpers.rb"
49
+ require "google/cloud/iot/v1/device_manager/helpers" if ::File.file? helper_path
@@ -0,0 +1,1936 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/iot/v1/device_manager_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Iot
25
+ module V1
26
+ module DeviceManager
27
+ ##
28
+ # Client for the DeviceManager service.
29
+ #
30
+ # Internet of Things (IoT) service. Securely connect and manage IoT devices.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :device_manager_stub
37
+
38
+ ##
39
+ # Configure the DeviceManager Client class.
40
+ #
41
+ # See {::Google::Cloud::Iot::V1::DeviceManager::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all DeviceManager clients:
47
+ #
48
+ # ::Google::Cloud::Iot::V1::DeviceManager::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Iot", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const&.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.rpcs.create_device_registry.timeout = 120.0
69
+
70
+ default_config.rpcs.get_device_registry.timeout = 120.0
71
+ default_config.rpcs.get_device_registry.retry_policy = {
72
+ initial_delay: 0.1,
73
+ max_delay: 60.0,
74
+ multiplier: 1.3,
75
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
76
+ }
77
+
78
+ default_config.rpcs.update_device_registry.timeout = 120.0
79
+
80
+ default_config.rpcs.delete_device_registry.timeout = 120.0
81
+ default_config.rpcs.delete_device_registry.retry_policy = {
82
+ initial_delay: 0.1,
83
+ max_delay: 60.0,
84
+ multiplier: 1.3,
85
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
86
+ }
87
+
88
+ default_config.rpcs.list_device_registries.timeout = 120.0
89
+ default_config.rpcs.list_device_registries.retry_policy = {
90
+ initial_delay: 0.1,
91
+ max_delay: 60.0,
92
+ multiplier: 1.3,
93
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
94
+ }
95
+
96
+ default_config.rpcs.create_device.timeout = 120.0
97
+
98
+ default_config.rpcs.get_device.timeout = 120.0
99
+ default_config.rpcs.get_device.retry_policy = {
100
+ initial_delay: 0.1,
101
+ max_delay: 60.0,
102
+ multiplier: 1.3,
103
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
104
+ }
105
+
106
+ default_config.rpcs.update_device.timeout = 120.0
107
+
108
+ default_config.rpcs.delete_device.timeout = 120.0
109
+ default_config.rpcs.delete_device.retry_policy = {
110
+ initial_delay: 0.1,
111
+ max_delay: 60.0,
112
+ multiplier: 1.3,
113
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
114
+ }
115
+
116
+ default_config.rpcs.list_devices.timeout = 120.0
117
+ default_config.rpcs.list_devices.retry_policy = {
118
+ initial_delay: 0.1,
119
+ max_delay: 60.0,
120
+ multiplier: 1.3,
121
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
122
+ }
123
+
124
+ default_config.rpcs.modify_cloud_to_device_config.timeout = 120.0
125
+ default_config.rpcs.modify_cloud_to_device_config.retry_policy = {
126
+ initial_delay: 1.0,
127
+ max_delay: 60.0,
128
+ multiplier: 1.3,
129
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED", "RESOURCE_EXHAUSTED"]
130
+ }
131
+
132
+ default_config.rpcs.list_device_config_versions.timeout = 120.0
133
+ default_config.rpcs.list_device_config_versions.retry_policy = {
134
+ initial_delay: 0.1,
135
+ max_delay: 60.0,
136
+ multiplier: 1.3,
137
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
138
+ }
139
+
140
+ default_config.rpcs.list_device_states.timeout = 120.0
141
+ default_config.rpcs.list_device_states.retry_policy = {
142
+ initial_delay: 0.1,
143
+ max_delay: 60.0,
144
+ multiplier: 1.3,
145
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
146
+ }
147
+
148
+ default_config.rpcs.set_iam_policy.timeout = 120.0
149
+
150
+ default_config.rpcs.get_iam_policy.timeout = 120.0
151
+
152
+ default_config.rpcs.test_iam_permissions.timeout = 120.0
153
+
154
+ default_config.rpcs.send_command_to_device.timeout = 120.0
155
+ default_config.rpcs.send_command_to_device.retry_policy = {
156
+ initial_delay: 1.0,
157
+ max_delay: 60.0,
158
+ multiplier: 1.3,
159
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED", "RESOURCE_EXHAUSTED"]
160
+ }
161
+
162
+ default_config.rpcs.bind_device_to_gateway.timeout = 120.0
163
+
164
+ default_config.rpcs.unbind_device_from_gateway.timeout = 120.0
165
+
166
+ default_config
167
+ end
168
+ yield @configure if block_given?
169
+ @configure
170
+ end
171
+
172
+ ##
173
+ # Configure the DeviceManager Client instance.
174
+ #
175
+ # The configuration is set to the derived mode, meaning that values can be changed,
176
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
177
+ # should be made on {Client.configure}.
178
+ #
179
+ # See {::Google::Cloud::Iot::V1::DeviceManager::Client::Configuration}
180
+ # for a description of the configuration fields.
181
+ #
182
+ # @yield [config] Configure the Client client.
183
+ # @yieldparam config [Client::Configuration]
184
+ #
185
+ # @return [Client::Configuration]
186
+ #
187
+ def configure
188
+ yield @config if block_given?
189
+ @config
190
+ end
191
+
192
+ ##
193
+ # Create a new DeviceManager client object.
194
+ #
195
+ # ## Examples
196
+ #
197
+ # To create a new DeviceManager client with the default
198
+ # configuration:
199
+ #
200
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new
201
+ #
202
+ # To create a new DeviceManager client with a custom
203
+ # configuration:
204
+ #
205
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config|
206
+ # config.timeout = 10.0
207
+ # end
208
+ #
209
+ # @yield [config] Configure the DeviceManager client.
210
+ # @yieldparam config [Client::Configuration]
211
+ #
212
+ def initialize
213
+ # These require statements are intentionally placed here to initialize
214
+ # the gRPC module only when it's required.
215
+ # See https://github.com/googleapis/toolkit/issues/446
216
+ require "gapic/grpc"
217
+ require "google/cloud/iot/v1/device_manager_services_pb"
218
+
219
+ # Create the configuration object
220
+ @config = Configuration.new Client.configure
221
+
222
+ # Yield the configuration if needed
223
+ yield @config if block_given?
224
+
225
+ # Create credentials
226
+ credentials = @config.credentials
227
+ credentials ||= Credentials.default scope: @config.scope
228
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
229
+ credentials = Credentials.new credentials, scope: @config.scope
230
+ end
231
+ @quota_project_id = @config.quota_project
232
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
233
+
234
+ @device_manager_stub = ::Gapic::ServiceStub.new(
235
+ ::Google::Cloud::Iot::V1::DeviceManager::Stub,
236
+ credentials: credentials,
237
+ endpoint: @config.endpoint,
238
+ channel_args: @config.channel_args,
239
+ interceptors: @config.interceptors
240
+ )
241
+ end
242
+
243
+ # Service calls
244
+
245
+ ##
246
+ # Creates a device registry that contains devices.
247
+ #
248
+ # @overload create_device_registry(request, options = nil)
249
+ # Pass arguments to `create_device_registry` via a request object, either of type
250
+ # {::Google::Cloud::Iot::V1::CreateDeviceRegistryRequest} or an equivalent Hash.
251
+ #
252
+ # @param request [::Google::Cloud::Iot::V1::CreateDeviceRegistryRequest, ::Hash]
253
+ # A request object representing the call parameters. Required. To specify no
254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
255
+ # @param options [::Gapic::CallOptions, ::Hash]
256
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
257
+ #
258
+ # @overload create_device_registry(parent: nil, device_registry: nil)
259
+ # Pass arguments to `create_device_registry` via keyword arguments. Note that at
260
+ # least one keyword argument is required. To specify no parameters, or to keep all
261
+ # the default parameter values, pass an empty Hash as a request object (see above).
262
+ #
263
+ # @param parent [::String]
264
+ # Required. The project and cloud region where this device registry must be created.
265
+ # For example, `projects/example-project/locations/us-central1`.
266
+ # @param device_registry [::Google::Cloud::Iot::V1::DeviceRegistry, ::Hash]
267
+ # Required. The device registry. The field `name` must be empty. The server will
268
+ # generate that field from the device registry `id` provided and the
269
+ # `parent` field.
270
+ #
271
+ # @yield [response, operation] Access the result along with the RPC operation
272
+ # @yieldparam response [::Google::Cloud::Iot::V1::DeviceRegistry]
273
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
274
+ #
275
+ # @return [::Google::Cloud::Iot::V1::DeviceRegistry]
276
+ #
277
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
278
+ #
279
+ def create_device_registry request, options = nil
280
+ raise ::ArgumentError, "request must be provided" if request.nil?
281
+
282
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::CreateDeviceRegistryRequest
283
+
284
+ # Converts hash and nil to an options object
285
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
286
+
287
+ # Customize the options with defaults
288
+ metadata = @config.rpcs.create_device_registry.metadata.to_h
289
+
290
+ # Set x-goog-api-client and x-goog-user-project headers
291
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
292
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
293
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
294
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
+
296
+ header_params = {
297
+ "parent" => request.parent
298
+ }
299
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
300
+ metadata[:"x-goog-request-params"] ||= request_params_header
301
+
302
+ options.apply_defaults timeout: @config.rpcs.create_device_registry.timeout,
303
+ metadata: metadata,
304
+ retry_policy: @config.rpcs.create_device_registry.retry_policy
305
+ options.apply_defaults metadata: @config.metadata,
306
+ retry_policy: @config.retry_policy
307
+
308
+ @device_manager_stub.call_rpc :create_device_registry, request, options: options do |response, operation|
309
+ yield response, operation if block_given?
310
+ return response
311
+ end
312
+ rescue ::GRPC::BadStatus => e
313
+ raise ::Google::Cloud::Error.from_error(e)
314
+ end
315
+
316
+ ##
317
+ # Gets a device registry configuration.
318
+ #
319
+ # @overload get_device_registry(request, options = nil)
320
+ # Pass arguments to `get_device_registry` via a request object, either of type
321
+ # {::Google::Cloud::Iot::V1::GetDeviceRegistryRequest} or an equivalent Hash.
322
+ #
323
+ # @param request [::Google::Cloud::Iot::V1::GetDeviceRegistryRequest, ::Hash]
324
+ # A request object representing the call parameters. Required. To specify no
325
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
326
+ # @param options [::Gapic::CallOptions, ::Hash]
327
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
328
+ #
329
+ # @overload get_device_registry(name: nil)
330
+ # Pass arguments to `get_device_registry` via keyword arguments. Note that at
331
+ # least one keyword argument is required. To specify no parameters, or to keep all
332
+ # the default parameter values, pass an empty Hash as a request object (see above).
333
+ #
334
+ # @param name [::String]
335
+ # Required. The name of the device registry. For example,
336
+ # `projects/example-project/locations/us-central1/registries/my-registry`.
337
+ #
338
+ # @yield [response, operation] Access the result along with the RPC operation
339
+ # @yieldparam response [::Google::Cloud::Iot::V1::DeviceRegistry]
340
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
341
+ #
342
+ # @return [::Google::Cloud::Iot::V1::DeviceRegistry]
343
+ #
344
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
345
+ #
346
+ def get_device_registry request, options = nil
347
+ raise ::ArgumentError, "request must be provided" if request.nil?
348
+
349
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::GetDeviceRegistryRequest
350
+
351
+ # Converts hash and nil to an options object
352
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
353
+
354
+ # Customize the options with defaults
355
+ metadata = @config.rpcs.get_device_registry.metadata.to_h
356
+
357
+ # Set x-goog-api-client and x-goog-user-project headers
358
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
359
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
360
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
361
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
362
+
363
+ header_params = {
364
+ "name" => request.name
365
+ }
366
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
367
+ metadata[:"x-goog-request-params"] ||= request_params_header
368
+
369
+ options.apply_defaults timeout: @config.rpcs.get_device_registry.timeout,
370
+ metadata: metadata,
371
+ retry_policy: @config.rpcs.get_device_registry.retry_policy
372
+ options.apply_defaults metadata: @config.metadata,
373
+ retry_policy: @config.retry_policy
374
+
375
+ @device_manager_stub.call_rpc :get_device_registry, request, options: options do |response, operation|
376
+ yield response, operation if block_given?
377
+ return response
378
+ end
379
+ rescue ::GRPC::BadStatus => e
380
+ raise ::Google::Cloud::Error.from_error(e)
381
+ end
382
+
383
+ ##
384
+ # Updates a device registry configuration.
385
+ #
386
+ # @overload update_device_registry(request, options = nil)
387
+ # Pass arguments to `update_device_registry` via a request object, either of type
388
+ # {::Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest} or an equivalent Hash.
389
+ #
390
+ # @param request [::Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest, ::Hash]
391
+ # A request object representing the call parameters. Required. To specify no
392
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
393
+ # @param options [::Gapic::CallOptions, ::Hash]
394
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
395
+ #
396
+ # @overload update_device_registry(device_registry: nil, update_mask: nil)
397
+ # Pass arguments to `update_device_registry` via keyword arguments. Note that at
398
+ # least one keyword argument is required. To specify no parameters, or to keep all
399
+ # the default parameter values, pass an empty Hash as a request object (see above).
400
+ #
401
+ # @param device_registry [::Google::Cloud::Iot::V1::DeviceRegistry, ::Hash]
402
+ # Required. The new values for the device registry. The `id` field must be empty, and
403
+ # the `name` field must indicate the path of the resource. For example,
404
+ # `projects/example-project/locations/us-central1/registries/my-registry`.
405
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
406
+ # Required. Only updates the `device_registry` fields indicated by this mask.
407
+ # The field mask must not be empty, and it must not contain fields that
408
+ # are immutable or only set by the server.
409
+ # Mutable top-level fields: `event_notification_config`, `http_config`,
410
+ # `mqtt_config`, and `state_notification_config`.
411
+ #
412
+ # @yield [response, operation] Access the result along with the RPC operation
413
+ # @yieldparam response [::Google::Cloud::Iot::V1::DeviceRegistry]
414
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
415
+ #
416
+ # @return [::Google::Cloud::Iot::V1::DeviceRegistry]
417
+ #
418
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
419
+ #
420
+ def update_device_registry request, options = nil
421
+ raise ::ArgumentError, "request must be provided" if request.nil?
422
+
423
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest
424
+
425
+ # Converts hash and nil to an options object
426
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
427
+
428
+ # Customize the options with defaults
429
+ metadata = @config.rpcs.update_device_registry.metadata.to_h
430
+
431
+ # Set x-goog-api-client and x-goog-user-project headers
432
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
434
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
435
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
436
+
437
+ header_params = {
438
+ "device_registry.name" => request.device_registry.name
439
+ }
440
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
441
+ metadata[:"x-goog-request-params"] ||= request_params_header
442
+
443
+ options.apply_defaults timeout: @config.rpcs.update_device_registry.timeout,
444
+ metadata: metadata,
445
+ retry_policy: @config.rpcs.update_device_registry.retry_policy
446
+ options.apply_defaults metadata: @config.metadata,
447
+ retry_policy: @config.retry_policy
448
+
449
+ @device_manager_stub.call_rpc :update_device_registry, request, options: options do |response, operation|
450
+ yield response, operation if block_given?
451
+ return response
452
+ end
453
+ rescue ::GRPC::BadStatus => e
454
+ raise ::Google::Cloud::Error.from_error(e)
455
+ end
456
+
457
+ ##
458
+ # Deletes a device registry configuration.
459
+ #
460
+ # @overload delete_device_registry(request, options = nil)
461
+ # Pass arguments to `delete_device_registry` via a request object, either of type
462
+ # {::Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest} or an equivalent Hash.
463
+ #
464
+ # @param request [::Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest, ::Hash]
465
+ # A request object representing the call parameters. Required. To specify no
466
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
467
+ # @param options [::Gapic::CallOptions, ::Hash]
468
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
469
+ #
470
+ # @overload delete_device_registry(name: nil)
471
+ # Pass arguments to `delete_device_registry` via keyword arguments. Note that at
472
+ # least one keyword argument is required. To specify no parameters, or to keep all
473
+ # the default parameter values, pass an empty Hash as a request object (see above).
474
+ #
475
+ # @param name [::String]
476
+ # Required. The name of the device registry. For example,
477
+ # `projects/example-project/locations/us-central1/registries/my-registry`.
478
+ #
479
+ # @yield [response, operation] Access the result along with the RPC operation
480
+ # @yieldparam response [::Google::Protobuf::Empty]
481
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
482
+ #
483
+ # @return [::Google::Protobuf::Empty]
484
+ #
485
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
486
+ #
487
+ def delete_device_registry request, options = nil
488
+ raise ::ArgumentError, "request must be provided" if request.nil?
489
+
490
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest
491
+
492
+ # Converts hash and nil to an options object
493
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
494
+
495
+ # Customize the options with defaults
496
+ metadata = @config.rpcs.delete_device_registry.metadata.to_h
497
+
498
+ # Set x-goog-api-client and x-goog-user-project headers
499
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
500
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
501
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
502
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
503
+
504
+ header_params = {
505
+ "name" => request.name
506
+ }
507
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
508
+ metadata[:"x-goog-request-params"] ||= request_params_header
509
+
510
+ options.apply_defaults timeout: @config.rpcs.delete_device_registry.timeout,
511
+ metadata: metadata,
512
+ retry_policy: @config.rpcs.delete_device_registry.retry_policy
513
+ options.apply_defaults metadata: @config.metadata,
514
+ retry_policy: @config.retry_policy
515
+
516
+ @device_manager_stub.call_rpc :delete_device_registry, request, options: options do |response, operation|
517
+ yield response, operation if block_given?
518
+ return response
519
+ end
520
+ rescue ::GRPC::BadStatus => e
521
+ raise ::Google::Cloud::Error.from_error(e)
522
+ end
523
+
524
+ ##
525
+ # Lists device registries.
526
+ #
527
+ # @overload list_device_registries(request, options = nil)
528
+ # Pass arguments to `list_device_registries` via a request object, either of type
529
+ # {::Google::Cloud::Iot::V1::ListDeviceRegistriesRequest} or an equivalent Hash.
530
+ #
531
+ # @param request [::Google::Cloud::Iot::V1::ListDeviceRegistriesRequest, ::Hash]
532
+ # A request object representing the call parameters. Required. To specify no
533
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
534
+ # @param options [::Gapic::CallOptions, ::Hash]
535
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
536
+ #
537
+ # @overload list_device_registries(parent: nil, page_size: nil, page_token: nil)
538
+ # Pass arguments to `list_device_registries` via keyword arguments. Note that at
539
+ # least one keyword argument is required. To specify no parameters, or to keep all
540
+ # the default parameter values, pass an empty Hash as a request object (see above).
541
+ #
542
+ # @param parent [::String]
543
+ # Required. The project and cloud region path. For example,
544
+ # `projects/example-project/locations/us-central1`.
545
+ # @param page_size [::Integer]
546
+ # The maximum number of registries to return in the response. If this value
547
+ # is zero, the service will select a default size. A call may return fewer
548
+ # objects than requested. A non-empty `next_page_token` in the response
549
+ # indicates that more data is available.
550
+ # @param page_token [::String]
551
+ # The value returned by the last `ListDeviceRegistriesResponse`; indicates
552
+ # that this is a continuation of a prior `ListDeviceRegistries` call and
553
+ # the system should return the next page of data.
554
+ #
555
+ # @yield [response, operation] Access the result along with the RPC operation
556
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::DeviceRegistry>]
557
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
558
+ #
559
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::DeviceRegistry>]
560
+ #
561
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
562
+ #
563
+ def list_device_registries request, options = nil
564
+ raise ::ArgumentError, "request must be provided" if request.nil?
565
+
566
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDeviceRegistriesRequest
567
+
568
+ # Converts hash and nil to an options object
569
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
570
+
571
+ # Customize the options with defaults
572
+ metadata = @config.rpcs.list_device_registries.metadata.to_h
573
+
574
+ # Set x-goog-api-client and x-goog-user-project headers
575
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
576
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
577
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
578
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
579
+
580
+ header_params = {
581
+ "parent" => request.parent
582
+ }
583
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
584
+ metadata[:"x-goog-request-params"] ||= request_params_header
585
+
586
+ options.apply_defaults timeout: @config.rpcs.list_device_registries.timeout,
587
+ metadata: metadata,
588
+ retry_policy: @config.rpcs.list_device_registries.retry_policy
589
+ options.apply_defaults metadata: @config.metadata,
590
+ retry_policy: @config.retry_policy
591
+
592
+ @device_manager_stub.call_rpc :list_device_registries, request, options: options do |response, operation|
593
+ response = ::Gapic::PagedEnumerable.new @device_manager_stub, :list_device_registries, request, response, operation, options
594
+ yield response, operation if block_given?
595
+ return response
596
+ end
597
+ rescue ::GRPC::BadStatus => e
598
+ raise ::Google::Cloud::Error.from_error(e)
599
+ end
600
+
601
+ ##
602
+ # Creates a device in a device registry.
603
+ #
604
+ # @overload create_device(request, options = nil)
605
+ # Pass arguments to `create_device` via a request object, either of type
606
+ # {::Google::Cloud::Iot::V1::CreateDeviceRequest} or an equivalent Hash.
607
+ #
608
+ # @param request [::Google::Cloud::Iot::V1::CreateDeviceRequest, ::Hash]
609
+ # A request object representing the call parameters. Required. To specify no
610
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
611
+ # @param options [::Gapic::CallOptions, ::Hash]
612
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
613
+ #
614
+ # @overload create_device(parent: nil, device: nil)
615
+ # Pass arguments to `create_device` via keyword arguments. Note that at
616
+ # least one keyword argument is required. To specify no parameters, or to keep all
617
+ # the default parameter values, pass an empty Hash as a request object (see above).
618
+ #
619
+ # @param parent [::String]
620
+ # Required. The name of the device registry where this device should be created.
621
+ # For example,
622
+ # `projects/example-project/locations/us-central1/registries/my-registry`.
623
+ # @param device [::Google::Cloud::Iot::V1::Device, ::Hash]
624
+ # Required. The device registration details. The field `name` must be empty. The server
625
+ # generates `name` from the device registry `id` and the
626
+ # `parent` field.
627
+ #
628
+ # @yield [response, operation] Access the result along with the RPC operation
629
+ # @yieldparam response [::Google::Cloud::Iot::V1::Device]
630
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
631
+ #
632
+ # @return [::Google::Cloud::Iot::V1::Device]
633
+ #
634
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
635
+ #
636
+ def create_device request, options = nil
637
+ raise ::ArgumentError, "request must be provided" if request.nil?
638
+
639
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::CreateDeviceRequest
640
+
641
+ # Converts hash and nil to an options object
642
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
643
+
644
+ # Customize the options with defaults
645
+ metadata = @config.rpcs.create_device.metadata.to_h
646
+
647
+ # Set x-goog-api-client and x-goog-user-project headers
648
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
649
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
650
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
651
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
652
+
653
+ header_params = {
654
+ "parent" => request.parent
655
+ }
656
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
657
+ metadata[:"x-goog-request-params"] ||= request_params_header
658
+
659
+ options.apply_defaults timeout: @config.rpcs.create_device.timeout,
660
+ metadata: metadata,
661
+ retry_policy: @config.rpcs.create_device.retry_policy
662
+ options.apply_defaults metadata: @config.metadata,
663
+ retry_policy: @config.retry_policy
664
+
665
+ @device_manager_stub.call_rpc :create_device, request, options: options do |response, operation|
666
+ yield response, operation if block_given?
667
+ return response
668
+ end
669
+ rescue ::GRPC::BadStatus => e
670
+ raise ::Google::Cloud::Error.from_error(e)
671
+ end
672
+
673
+ ##
674
+ # Gets details about a device.
675
+ #
676
+ # @overload get_device(request, options = nil)
677
+ # Pass arguments to `get_device` via a request object, either of type
678
+ # {::Google::Cloud::Iot::V1::GetDeviceRequest} or an equivalent Hash.
679
+ #
680
+ # @param request [::Google::Cloud::Iot::V1::GetDeviceRequest, ::Hash]
681
+ # A request object representing the call parameters. Required. To specify no
682
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
683
+ # @param options [::Gapic::CallOptions, ::Hash]
684
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
685
+ #
686
+ # @overload get_device(name: nil, field_mask: nil)
687
+ # Pass arguments to `get_device` via keyword arguments. Note that at
688
+ # least one keyword argument is required. To specify no parameters, or to keep all
689
+ # the default parameter values, pass an empty Hash as a request object (see above).
690
+ #
691
+ # @param name [::String]
692
+ # Required. The name of the device. For example,
693
+ # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
694
+ # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
695
+ # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
696
+ # The fields of the `Device` resource to be returned in the response. If the
697
+ # field mask is unset or empty, all fields are returned.
698
+ #
699
+ # @yield [response, operation] Access the result along with the RPC operation
700
+ # @yieldparam response [::Google::Cloud::Iot::V1::Device]
701
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
702
+ #
703
+ # @return [::Google::Cloud::Iot::V1::Device]
704
+ #
705
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
706
+ #
707
+ def get_device request, options = nil
708
+ raise ::ArgumentError, "request must be provided" if request.nil?
709
+
710
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::GetDeviceRequest
711
+
712
+ # Converts hash and nil to an options object
713
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
714
+
715
+ # Customize the options with defaults
716
+ metadata = @config.rpcs.get_device.metadata.to_h
717
+
718
+ # Set x-goog-api-client and x-goog-user-project headers
719
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
720
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
721
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
722
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
723
+
724
+ header_params = {
725
+ "name" => request.name
726
+ }
727
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
728
+ metadata[:"x-goog-request-params"] ||= request_params_header
729
+
730
+ options.apply_defaults timeout: @config.rpcs.get_device.timeout,
731
+ metadata: metadata,
732
+ retry_policy: @config.rpcs.get_device.retry_policy
733
+ options.apply_defaults metadata: @config.metadata,
734
+ retry_policy: @config.retry_policy
735
+
736
+ @device_manager_stub.call_rpc :get_device, request, options: options do |response, operation|
737
+ yield response, operation if block_given?
738
+ return response
739
+ end
740
+ rescue ::GRPC::BadStatus => e
741
+ raise ::Google::Cloud::Error.from_error(e)
742
+ end
743
+
744
+ ##
745
+ # Updates a device.
746
+ #
747
+ # @overload update_device(request, options = nil)
748
+ # Pass arguments to `update_device` via a request object, either of type
749
+ # {::Google::Cloud::Iot::V1::UpdateDeviceRequest} or an equivalent Hash.
750
+ #
751
+ # @param request [::Google::Cloud::Iot::V1::UpdateDeviceRequest, ::Hash]
752
+ # A request object representing the call parameters. Required. To specify no
753
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
754
+ # @param options [::Gapic::CallOptions, ::Hash]
755
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
756
+ #
757
+ # @overload update_device(device: nil, update_mask: nil)
758
+ # Pass arguments to `update_device` via keyword arguments. Note that at
759
+ # least one keyword argument is required. To specify no parameters, or to keep all
760
+ # the default parameter values, pass an empty Hash as a request object (see above).
761
+ #
762
+ # @param device [::Google::Cloud::Iot::V1::Device, ::Hash]
763
+ # Required. The new values for the device. The `id` and `num_id` fields must
764
+ # be empty, and the field `name` must specify the name path. For example,
765
+ # `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
766
+ # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
767
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
768
+ # Required. Only updates the `device` fields indicated by this mask.
769
+ # The field mask must not be empty, and it must not contain fields that
770
+ # are immutable or only set by the server.
771
+ # Mutable top-level fields: `credentials`, `blocked`, and `metadata`
772
+ #
773
+ # @yield [response, operation] Access the result along with the RPC operation
774
+ # @yieldparam response [::Google::Cloud::Iot::V1::Device]
775
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
776
+ #
777
+ # @return [::Google::Cloud::Iot::V1::Device]
778
+ #
779
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
780
+ #
781
+ def update_device request, options = nil
782
+ raise ::ArgumentError, "request must be provided" if request.nil?
783
+
784
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::UpdateDeviceRequest
785
+
786
+ # Converts hash and nil to an options object
787
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
788
+
789
+ # Customize the options with defaults
790
+ metadata = @config.rpcs.update_device.metadata.to_h
791
+
792
+ # Set x-goog-api-client and x-goog-user-project headers
793
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
794
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
795
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
796
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
797
+
798
+ header_params = {
799
+ "device.name" => request.device.name
800
+ }
801
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
802
+ metadata[:"x-goog-request-params"] ||= request_params_header
803
+
804
+ options.apply_defaults timeout: @config.rpcs.update_device.timeout,
805
+ metadata: metadata,
806
+ retry_policy: @config.rpcs.update_device.retry_policy
807
+ options.apply_defaults metadata: @config.metadata,
808
+ retry_policy: @config.retry_policy
809
+
810
+ @device_manager_stub.call_rpc :update_device, request, options: options do |response, operation|
811
+ yield response, operation if block_given?
812
+ return response
813
+ end
814
+ rescue ::GRPC::BadStatus => e
815
+ raise ::Google::Cloud::Error.from_error(e)
816
+ end
817
+
818
+ ##
819
+ # Deletes a device.
820
+ #
821
+ # @overload delete_device(request, options = nil)
822
+ # Pass arguments to `delete_device` via a request object, either of type
823
+ # {::Google::Cloud::Iot::V1::DeleteDeviceRequest} or an equivalent Hash.
824
+ #
825
+ # @param request [::Google::Cloud::Iot::V1::DeleteDeviceRequest, ::Hash]
826
+ # A request object representing the call parameters. Required. To specify no
827
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
828
+ # @param options [::Gapic::CallOptions, ::Hash]
829
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
830
+ #
831
+ # @overload delete_device(name: nil)
832
+ # Pass arguments to `delete_device` via keyword arguments. Note that at
833
+ # least one keyword argument is required. To specify no parameters, or to keep all
834
+ # the default parameter values, pass an empty Hash as a request object (see above).
835
+ #
836
+ # @param name [::String]
837
+ # Required. The name of the device. For example,
838
+ # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
839
+ # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
840
+ #
841
+ # @yield [response, operation] Access the result along with the RPC operation
842
+ # @yieldparam response [::Google::Protobuf::Empty]
843
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
844
+ #
845
+ # @return [::Google::Protobuf::Empty]
846
+ #
847
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
848
+ #
849
+ def delete_device request, options = nil
850
+ raise ::ArgumentError, "request must be provided" if request.nil?
851
+
852
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::DeleteDeviceRequest
853
+
854
+ # Converts hash and nil to an options object
855
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
856
+
857
+ # Customize the options with defaults
858
+ metadata = @config.rpcs.delete_device.metadata.to_h
859
+
860
+ # Set x-goog-api-client and x-goog-user-project headers
861
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
862
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
863
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
864
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
865
+
866
+ header_params = {
867
+ "name" => request.name
868
+ }
869
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
870
+ metadata[:"x-goog-request-params"] ||= request_params_header
871
+
872
+ options.apply_defaults timeout: @config.rpcs.delete_device.timeout,
873
+ metadata: metadata,
874
+ retry_policy: @config.rpcs.delete_device.retry_policy
875
+ options.apply_defaults metadata: @config.metadata,
876
+ retry_policy: @config.retry_policy
877
+
878
+ @device_manager_stub.call_rpc :delete_device, request, options: options do |response, operation|
879
+ yield response, operation if block_given?
880
+ return response
881
+ end
882
+ rescue ::GRPC::BadStatus => e
883
+ raise ::Google::Cloud::Error.from_error(e)
884
+ end
885
+
886
+ ##
887
+ # List devices in a device registry.
888
+ #
889
+ # @overload list_devices(request, options = nil)
890
+ # Pass arguments to `list_devices` via a request object, either of type
891
+ # {::Google::Cloud::Iot::V1::ListDevicesRequest} or an equivalent Hash.
892
+ #
893
+ # @param request [::Google::Cloud::Iot::V1::ListDevicesRequest, ::Hash]
894
+ # A request object representing the call parameters. Required. To specify no
895
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
896
+ # @param options [::Gapic::CallOptions, ::Hash]
897
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
898
+ #
899
+ # @overload list_devices(parent: nil, device_num_ids: nil, device_ids: nil, field_mask: nil, gateway_list_options: nil, page_size: nil, page_token: nil)
900
+ # Pass arguments to `list_devices` via keyword arguments. Note that at
901
+ # least one keyword argument is required. To specify no parameters, or to keep all
902
+ # the default parameter values, pass an empty Hash as a request object (see above).
903
+ #
904
+ # @param parent [::String]
905
+ # Required. The device registry path. Required. For example,
906
+ # `projects/my-project/locations/us-central1/registries/my-registry`.
907
+ # @param device_num_ids [::Array<::Integer>]
908
+ # A list of device numeric IDs. If empty, this field is ignored. Maximum
909
+ # IDs: 10,000.
910
+ # @param device_ids [::Array<::String>]
911
+ # A list of device string IDs. For example, `['device0', 'device12']`.
912
+ # If empty, this field is ignored. Maximum IDs: 10,000
913
+ # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
914
+ # The fields of the `Device` resource to be returned in the response. The
915
+ # fields `id` and `num_id` are always returned, along with any
916
+ # other fields specified.
917
+ # @param gateway_list_options [::Google::Cloud::Iot::V1::GatewayListOptions, ::Hash]
918
+ # Options related to gateways.
919
+ # @param page_size [::Integer]
920
+ # The maximum number of devices to return in the response. If this value
921
+ # is zero, the service will select a default size. A call may return fewer
922
+ # objects than requested. A non-empty `next_page_token` in the response
923
+ # indicates that more data is available.
924
+ # @param page_token [::String]
925
+ # The value returned by the last `ListDevicesResponse`; indicates
926
+ # that this is a continuation of a prior `ListDevices` call and
927
+ # the system should return the next page of data.
928
+ #
929
+ # @yield [response, operation] Access the result along with the RPC operation
930
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::Device>]
931
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
932
+ #
933
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::Device>]
934
+ #
935
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
936
+ #
937
+ def list_devices request, options = nil
938
+ raise ::ArgumentError, "request must be provided" if request.nil?
939
+
940
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDevicesRequest
941
+
942
+ # Converts hash and nil to an options object
943
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
944
+
945
+ # Customize the options with defaults
946
+ metadata = @config.rpcs.list_devices.metadata.to_h
947
+
948
+ # Set x-goog-api-client and x-goog-user-project headers
949
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
950
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
951
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
952
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
953
+
954
+ header_params = {
955
+ "parent" => request.parent
956
+ }
957
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
958
+ metadata[:"x-goog-request-params"] ||= request_params_header
959
+
960
+ options.apply_defaults timeout: @config.rpcs.list_devices.timeout,
961
+ metadata: metadata,
962
+ retry_policy: @config.rpcs.list_devices.retry_policy
963
+ options.apply_defaults metadata: @config.metadata,
964
+ retry_policy: @config.retry_policy
965
+
966
+ @device_manager_stub.call_rpc :list_devices, request, options: options do |response, operation|
967
+ response = ::Gapic::PagedEnumerable.new @device_manager_stub, :list_devices, request, response, operation, options
968
+ yield response, operation if block_given?
969
+ return response
970
+ end
971
+ rescue ::GRPC::BadStatus => e
972
+ raise ::Google::Cloud::Error.from_error(e)
973
+ end
974
+
975
+ ##
976
+ # Modifies the configuration for the device, which is eventually sent from
977
+ # the Cloud IoT Core servers. Returns the modified configuration version and
978
+ # its metadata.
979
+ #
980
+ # @overload modify_cloud_to_device_config(request, options = nil)
981
+ # Pass arguments to `modify_cloud_to_device_config` via a request object, either of type
982
+ # {::Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest} or an equivalent Hash.
983
+ #
984
+ # @param request [::Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest, ::Hash]
985
+ # A request object representing the call parameters. Required. To specify no
986
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
987
+ # @param options [::Gapic::CallOptions, ::Hash]
988
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
989
+ #
990
+ # @overload modify_cloud_to_device_config(name: nil, version_to_update: nil, binary_data: nil)
991
+ # Pass arguments to `modify_cloud_to_device_config` via keyword arguments. Note that at
992
+ # least one keyword argument is required. To specify no parameters, or to keep all
993
+ # the default parameter values, pass an empty Hash as a request object (see above).
994
+ #
995
+ # @param name [::String]
996
+ # Required. The name of the device. For example,
997
+ # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
998
+ # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
999
+ # @param version_to_update [::Integer]
1000
+ # The version number to update. If this value is zero, it will not check the
1001
+ # version number of the server and will always update the current version;
1002
+ # otherwise, this update will fail if the version number found on the server
1003
+ # does not match this version number. This is used to support multiple
1004
+ # simultaneous updates without losing data.
1005
+ # @param binary_data [::String]
1006
+ # Required. The configuration data for the device.
1007
+ #
1008
+ # @yield [response, operation] Access the result along with the RPC operation
1009
+ # @yieldparam response [::Google::Cloud::Iot::V1::DeviceConfig]
1010
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1011
+ #
1012
+ # @return [::Google::Cloud::Iot::V1::DeviceConfig]
1013
+ #
1014
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1015
+ #
1016
+ def modify_cloud_to_device_config request, options = nil
1017
+ raise ::ArgumentError, "request must be provided" if request.nil?
1018
+
1019
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest
1020
+
1021
+ # Converts hash and nil to an options object
1022
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1023
+
1024
+ # Customize the options with defaults
1025
+ metadata = @config.rpcs.modify_cloud_to_device_config.metadata.to_h
1026
+
1027
+ # Set x-goog-api-client and x-goog-user-project headers
1028
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1029
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1030
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1031
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1032
+
1033
+ header_params = {
1034
+ "name" => request.name
1035
+ }
1036
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1037
+ metadata[:"x-goog-request-params"] ||= request_params_header
1038
+
1039
+ options.apply_defaults timeout: @config.rpcs.modify_cloud_to_device_config.timeout,
1040
+ metadata: metadata,
1041
+ retry_policy: @config.rpcs.modify_cloud_to_device_config.retry_policy
1042
+ options.apply_defaults metadata: @config.metadata,
1043
+ retry_policy: @config.retry_policy
1044
+
1045
+ @device_manager_stub.call_rpc :modify_cloud_to_device_config, request, options: options do |response, operation|
1046
+ yield response, operation if block_given?
1047
+ return response
1048
+ end
1049
+ rescue ::GRPC::BadStatus => e
1050
+ raise ::Google::Cloud::Error.from_error(e)
1051
+ end
1052
+
1053
+ ##
1054
+ # Lists the last few versions of the device configuration in descending
1055
+ # order (i.e.: newest first).
1056
+ #
1057
+ # @overload list_device_config_versions(request, options = nil)
1058
+ # Pass arguments to `list_device_config_versions` via a request object, either of type
1059
+ # {::Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest} or an equivalent Hash.
1060
+ #
1061
+ # @param request [::Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest, ::Hash]
1062
+ # A request object representing the call parameters. Required. To specify no
1063
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1064
+ # @param options [::Gapic::CallOptions, ::Hash]
1065
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1066
+ #
1067
+ # @overload list_device_config_versions(name: nil, num_versions: nil)
1068
+ # Pass arguments to `list_device_config_versions` via keyword arguments. Note that at
1069
+ # least one keyword argument is required. To specify no parameters, or to keep all
1070
+ # the default parameter values, pass an empty Hash as a request object (see above).
1071
+ #
1072
+ # @param name [::String]
1073
+ # Required. The name of the device. For example,
1074
+ # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
1075
+ # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
1076
+ # @param num_versions [::Integer]
1077
+ # The number of versions to list. Versions are listed in decreasing order of
1078
+ # the version number. The maximum number of versions retained is 10. If this
1079
+ # value is zero, it will return all the versions available.
1080
+ #
1081
+ # @yield [response, operation] Access the result along with the RPC operation
1082
+ # @yieldparam response [::Google::Cloud::Iot::V1::ListDeviceConfigVersionsResponse]
1083
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1084
+ #
1085
+ # @return [::Google::Cloud::Iot::V1::ListDeviceConfigVersionsResponse]
1086
+ #
1087
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1088
+ #
1089
+ def list_device_config_versions request, options = nil
1090
+ raise ::ArgumentError, "request must be provided" if request.nil?
1091
+
1092
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest
1093
+
1094
+ # Converts hash and nil to an options object
1095
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1096
+
1097
+ # Customize the options with defaults
1098
+ metadata = @config.rpcs.list_device_config_versions.metadata.to_h
1099
+
1100
+ # Set x-goog-api-client and x-goog-user-project headers
1101
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1102
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1103
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1104
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1105
+
1106
+ header_params = {
1107
+ "name" => request.name
1108
+ }
1109
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1110
+ metadata[:"x-goog-request-params"] ||= request_params_header
1111
+
1112
+ options.apply_defaults timeout: @config.rpcs.list_device_config_versions.timeout,
1113
+ metadata: metadata,
1114
+ retry_policy: @config.rpcs.list_device_config_versions.retry_policy
1115
+ options.apply_defaults metadata: @config.metadata,
1116
+ retry_policy: @config.retry_policy
1117
+
1118
+ @device_manager_stub.call_rpc :list_device_config_versions, request, options: options do |response, operation|
1119
+ yield response, operation if block_given?
1120
+ return response
1121
+ end
1122
+ rescue ::GRPC::BadStatus => e
1123
+ raise ::Google::Cloud::Error.from_error(e)
1124
+ end
1125
+
1126
+ ##
1127
+ # Lists the last few versions of the device state in descending order (i.e.:
1128
+ # newest first).
1129
+ #
1130
+ # @overload list_device_states(request, options = nil)
1131
+ # Pass arguments to `list_device_states` via a request object, either of type
1132
+ # {::Google::Cloud::Iot::V1::ListDeviceStatesRequest} or an equivalent Hash.
1133
+ #
1134
+ # @param request [::Google::Cloud::Iot::V1::ListDeviceStatesRequest, ::Hash]
1135
+ # A request object representing the call parameters. Required. To specify no
1136
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1137
+ # @param options [::Gapic::CallOptions, ::Hash]
1138
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1139
+ #
1140
+ # @overload list_device_states(name: nil, num_states: nil)
1141
+ # Pass arguments to `list_device_states` via keyword arguments. Note that at
1142
+ # least one keyword argument is required. To specify no parameters, or to keep all
1143
+ # the default parameter values, pass an empty Hash as a request object (see above).
1144
+ #
1145
+ # @param name [::String]
1146
+ # Required. The name of the device. For example,
1147
+ # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
1148
+ # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
1149
+ # @param num_states [::Integer]
1150
+ # The number of states to list. States are listed in descending order of
1151
+ # update time. The maximum number of states retained is 10. If this
1152
+ # value is zero, it will return all the states available.
1153
+ #
1154
+ # @yield [response, operation] Access the result along with the RPC operation
1155
+ # @yieldparam response [::Google::Cloud::Iot::V1::ListDeviceStatesResponse]
1156
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1157
+ #
1158
+ # @return [::Google::Cloud::Iot::V1::ListDeviceStatesResponse]
1159
+ #
1160
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1161
+ #
1162
+ def list_device_states request, options = nil
1163
+ raise ::ArgumentError, "request must be provided" if request.nil?
1164
+
1165
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDeviceStatesRequest
1166
+
1167
+ # Converts hash and nil to an options object
1168
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1169
+
1170
+ # Customize the options with defaults
1171
+ metadata = @config.rpcs.list_device_states.metadata.to_h
1172
+
1173
+ # Set x-goog-api-client and x-goog-user-project headers
1174
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1175
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1176
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1177
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1178
+
1179
+ header_params = {
1180
+ "name" => request.name
1181
+ }
1182
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1183
+ metadata[:"x-goog-request-params"] ||= request_params_header
1184
+
1185
+ options.apply_defaults timeout: @config.rpcs.list_device_states.timeout,
1186
+ metadata: metadata,
1187
+ retry_policy: @config.rpcs.list_device_states.retry_policy
1188
+ options.apply_defaults metadata: @config.metadata,
1189
+ retry_policy: @config.retry_policy
1190
+
1191
+ @device_manager_stub.call_rpc :list_device_states, request, options: options do |response, operation|
1192
+ yield response, operation if block_given?
1193
+ return response
1194
+ end
1195
+ rescue ::GRPC::BadStatus => e
1196
+ raise ::Google::Cloud::Error.from_error(e)
1197
+ end
1198
+
1199
+ ##
1200
+ # Sets the access control policy on the specified resource. Replaces any
1201
+ # existing policy.
1202
+ #
1203
+ # @overload set_iam_policy(request, options = nil)
1204
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1205
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1206
+ #
1207
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1208
+ # A request object representing the call parameters. Required. To specify no
1209
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1210
+ # @param options [::Gapic::CallOptions, ::Hash]
1211
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1212
+ #
1213
+ # @overload set_iam_policy(resource: nil, policy: nil)
1214
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1215
+ # least one keyword argument is required. To specify no parameters, or to keep all
1216
+ # the default parameter values, pass an empty Hash as a request object (see above).
1217
+ #
1218
+ # @param resource [::String]
1219
+ # REQUIRED: The resource for which the policy is being specified.
1220
+ # See the operation documentation for the appropriate value for this field.
1221
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1222
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1223
+ # the policy is limited to a few 10s of KB. An empty policy is a
1224
+ # valid policy but certain Cloud Platform services (such as Projects)
1225
+ # might reject them.
1226
+ #
1227
+ # @yield [response, operation] Access the result along with the RPC operation
1228
+ # @yieldparam response [::Google::Iam::V1::Policy]
1229
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1230
+ #
1231
+ # @return [::Google::Iam::V1::Policy]
1232
+ #
1233
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1234
+ #
1235
+ def set_iam_policy request, options = nil
1236
+ raise ::ArgumentError, "request must be provided" if request.nil?
1237
+
1238
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1239
+
1240
+ # Converts hash and nil to an options object
1241
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1242
+
1243
+ # Customize the options with defaults
1244
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
1245
+
1246
+ # Set x-goog-api-client and x-goog-user-project headers
1247
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1248
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1249
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1250
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1251
+
1252
+ header_params = {
1253
+ "resource" => request.resource
1254
+ }
1255
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1256
+ metadata[:"x-goog-request-params"] ||= request_params_header
1257
+
1258
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1259
+ metadata: metadata,
1260
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1261
+ options.apply_defaults metadata: @config.metadata,
1262
+ retry_policy: @config.retry_policy
1263
+
1264
+ @device_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1265
+ yield response, operation if block_given?
1266
+ return response
1267
+ end
1268
+ rescue ::GRPC::BadStatus => e
1269
+ raise ::Google::Cloud::Error.from_error(e)
1270
+ end
1271
+
1272
+ ##
1273
+ # Gets the access control policy for a resource.
1274
+ # Returns an empty policy if the resource exists and does not have a policy
1275
+ # set.
1276
+ #
1277
+ # @overload get_iam_policy(request, options = nil)
1278
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1279
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1280
+ #
1281
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1282
+ # A request object representing the call parameters. Required. To specify no
1283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1284
+ # @param options [::Gapic::CallOptions, ::Hash]
1285
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1286
+ #
1287
+ # @overload get_iam_policy(resource: nil, options: nil)
1288
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1289
+ # least one keyword argument is required. To specify no parameters, or to keep all
1290
+ # the default parameter values, pass an empty Hash as a request object (see above).
1291
+ #
1292
+ # @param resource [::String]
1293
+ # REQUIRED: The resource for which the policy is being requested.
1294
+ # See the operation documentation for the appropriate value for this field.
1295
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1296
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1297
+ # `GetIamPolicy`. This field is only used by Cloud IAM.
1298
+ #
1299
+ # @yield [response, operation] Access the result along with the RPC operation
1300
+ # @yieldparam response [::Google::Iam::V1::Policy]
1301
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1302
+ #
1303
+ # @return [::Google::Iam::V1::Policy]
1304
+ #
1305
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1306
+ #
1307
+ def get_iam_policy request, options = nil
1308
+ raise ::ArgumentError, "request must be provided" if request.nil?
1309
+
1310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1311
+
1312
+ # Converts hash and nil to an options object
1313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1314
+
1315
+ # Customize the options with defaults
1316
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
1317
+
1318
+ # Set x-goog-api-client and x-goog-user-project headers
1319
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1321
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1322
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1323
+
1324
+ header_params = {
1325
+ "resource" => request.resource
1326
+ }
1327
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1328
+ metadata[:"x-goog-request-params"] ||= request_params_header
1329
+
1330
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1331
+ metadata: metadata,
1332
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1333
+ options.apply_defaults metadata: @config.metadata,
1334
+ retry_policy: @config.retry_policy
1335
+
1336
+ @device_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1337
+ yield response, operation if block_given?
1338
+ return response
1339
+ end
1340
+ rescue ::GRPC::BadStatus => e
1341
+ raise ::Google::Cloud::Error.from_error(e)
1342
+ end
1343
+
1344
+ ##
1345
+ # Returns permissions that a caller has on the specified resource.
1346
+ # If the resource does not exist, this will return an empty set of
1347
+ # permissions, not a NOT_FOUND error.
1348
+ #
1349
+ # @overload test_iam_permissions(request, options = nil)
1350
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1351
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
1352
+ #
1353
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
1354
+ # A request object representing the call parameters. Required. To specify no
1355
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1356
+ # @param options [::Gapic::CallOptions, ::Hash]
1357
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1358
+ #
1359
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
1360
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1361
+ # least one keyword argument is required. To specify no parameters, or to keep all
1362
+ # the default parameter values, pass an empty Hash as a request object (see above).
1363
+ #
1364
+ # @param resource [::String]
1365
+ # REQUIRED: The resource for which the policy detail is being requested.
1366
+ # See the operation documentation for the appropriate value for this field.
1367
+ # @param permissions [::Array<::String>]
1368
+ # The set of permissions to check for the `resource`. Permissions with
1369
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1370
+ # information see
1371
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1372
+ #
1373
+ # @yield [response, operation] Access the result along with the RPC operation
1374
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
1375
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1376
+ #
1377
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1378
+ #
1379
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1380
+ #
1381
+ def test_iam_permissions request, options = nil
1382
+ raise ::ArgumentError, "request must be provided" if request.nil?
1383
+
1384
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1385
+
1386
+ # Converts hash and nil to an options object
1387
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1388
+
1389
+ # Customize the options with defaults
1390
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1391
+
1392
+ # Set x-goog-api-client and x-goog-user-project headers
1393
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1394
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1395
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1396
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1397
+
1398
+ header_params = {
1399
+ "resource" => request.resource
1400
+ }
1401
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1402
+ metadata[:"x-goog-request-params"] ||= request_params_header
1403
+
1404
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1405
+ metadata: metadata,
1406
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1407
+ options.apply_defaults metadata: @config.metadata,
1408
+ retry_policy: @config.retry_policy
1409
+
1410
+ @device_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
1411
+ yield response, operation if block_given?
1412
+ return response
1413
+ end
1414
+ rescue ::GRPC::BadStatus => e
1415
+ raise ::Google::Cloud::Error.from_error(e)
1416
+ end
1417
+
1418
+ ##
1419
+ # Sends a command to the specified device. In order for a device to be able
1420
+ # to receive commands, it must:
1421
+ # 1) be connected to Cloud IoT Core using the MQTT protocol, and
1422
+ # 2) be subscribed to the group of MQTT topics specified by
1423
+ # /devices/\\{device-id}/commands/#. This subscription will receive commands
1424
+ # at the top-level topic /devices/\\{device-id}/commands as well as commands
1425
+ # for subfolders, like /devices/\\{device-id}/commands/subfolder.
1426
+ # Note that subscribing to specific subfolders is not supported.
1427
+ # If the command could not be delivered to the device, this method will
1428
+ # return an error; in particular, if the device is not subscribed, this
1429
+ # method will return FAILED_PRECONDITION. Otherwise, this method will
1430
+ # return OK. If the subscription is QoS 1, at least once delivery will be
1431
+ # guaranteed; for QoS 0, no acknowledgment will be expected from the device.
1432
+ #
1433
+ # @overload send_command_to_device(request, options = nil)
1434
+ # Pass arguments to `send_command_to_device` via a request object, either of type
1435
+ # {::Google::Cloud::Iot::V1::SendCommandToDeviceRequest} or an equivalent Hash.
1436
+ #
1437
+ # @param request [::Google::Cloud::Iot::V1::SendCommandToDeviceRequest, ::Hash]
1438
+ # A request object representing the call parameters. Required. To specify no
1439
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1440
+ # @param options [::Gapic::CallOptions, ::Hash]
1441
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1442
+ #
1443
+ # @overload send_command_to_device(name: nil, binary_data: nil, subfolder: nil)
1444
+ # Pass arguments to `send_command_to_device` via keyword arguments. Note that at
1445
+ # least one keyword argument is required. To specify no parameters, or to keep all
1446
+ # the default parameter values, pass an empty Hash as a request object (see above).
1447
+ #
1448
+ # @param name [::String]
1449
+ # Required. The name of the device. For example,
1450
+ # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
1451
+ # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
1452
+ # @param binary_data [::String]
1453
+ # Required. The command data to send to the device.
1454
+ # @param subfolder [::String]
1455
+ # Optional subfolder for the command. If empty, the command will be delivered
1456
+ # to the /devices/\\{device-id}/commands topic, otherwise it will be delivered
1457
+ # to the /devices/\\{device-id}/commands/\\{subfolder} topic. Multi-level
1458
+ # subfolders are allowed. This field must not have more than 256 characters,
1459
+ # and must not contain any MQTT wildcards ("+" or "#") or null characters.
1460
+ #
1461
+ # @yield [response, operation] Access the result along with the RPC operation
1462
+ # @yieldparam response [::Google::Cloud::Iot::V1::SendCommandToDeviceResponse]
1463
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1464
+ #
1465
+ # @return [::Google::Cloud::Iot::V1::SendCommandToDeviceResponse]
1466
+ #
1467
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1468
+ #
1469
+ def send_command_to_device request, options = nil
1470
+ raise ::ArgumentError, "request must be provided" if request.nil?
1471
+
1472
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::SendCommandToDeviceRequest
1473
+
1474
+ # Converts hash and nil to an options object
1475
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1476
+
1477
+ # Customize the options with defaults
1478
+ metadata = @config.rpcs.send_command_to_device.metadata.to_h
1479
+
1480
+ # Set x-goog-api-client and x-goog-user-project headers
1481
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1482
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1483
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1484
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1485
+
1486
+ header_params = {
1487
+ "name" => request.name
1488
+ }
1489
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1490
+ metadata[:"x-goog-request-params"] ||= request_params_header
1491
+
1492
+ options.apply_defaults timeout: @config.rpcs.send_command_to_device.timeout,
1493
+ metadata: metadata,
1494
+ retry_policy: @config.rpcs.send_command_to_device.retry_policy
1495
+ options.apply_defaults metadata: @config.metadata,
1496
+ retry_policy: @config.retry_policy
1497
+
1498
+ @device_manager_stub.call_rpc :send_command_to_device, request, options: options do |response, operation|
1499
+ yield response, operation if block_given?
1500
+ return response
1501
+ end
1502
+ rescue ::GRPC::BadStatus => e
1503
+ raise ::Google::Cloud::Error.from_error(e)
1504
+ end
1505
+
1506
+ ##
1507
+ # Associates the device with the gateway.
1508
+ #
1509
+ # @overload bind_device_to_gateway(request, options = nil)
1510
+ # Pass arguments to `bind_device_to_gateway` via a request object, either of type
1511
+ # {::Google::Cloud::Iot::V1::BindDeviceToGatewayRequest} or an equivalent Hash.
1512
+ #
1513
+ # @param request [::Google::Cloud::Iot::V1::BindDeviceToGatewayRequest, ::Hash]
1514
+ # A request object representing the call parameters. Required. To specify no
1515
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1516
+ # @param options [::Gapic::CallOptions, ::Hash]
1517
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1518
+ #
1519
+ # @overload bind_device_to_gateway(parent: nil, gateway_id: nil, device_id: nil)
1520
+ # Pass arguments to `bind_device_to_gateway` via keyword arguments. Note that at
1521
+ # least one keyword argument is required. To specify no parameters, or to keep all
1522
+ # the default parameter values, pass an empty Hash as a request object (see above).
1523
+ #
1524
+ # @param parent [::String]
1525
+ # Required. The name of the registry. For example,
1526
+ # `projects/example-project/locations/us-central1/registries/my-registry`.
1527
+ # @param gateway_id [::String]
1528
+ # Required. The value of `gateway_id` can be either the device numeric ID or the
1529
+ # user-defined device identifier.
1530
+ # @param device_id [::String]
1531
+ # Required. The device to associate with the specified gateway. The value of
1532
+ # `device_id` can be either the device numeric ID or the user-defined device
1533
+ # identifier.
1534
+ #
1535
+ # @yield [response, operation] Access the result along with the RPC operation
1536
+ # @yieldparam response [::Google::Cloud::Iot::V1::BindDeviceToGatewayResponse]
1537
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1538
+ #
1539
+ # @return [::Google::Cloud::Iot::V1::BindDeviceToGatewayResponse]
1540
+ #
1541
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1542
+ #
1543
+ def bind_device_to_gateway request, options = nil
1544
+ raise ::ArgumentError, "request must be provided" if request.nil?
1545
+
1546
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::BindDeviceToGatewayRequest
1547
+
1548
+ # Converts hash and nil to an options object
1549
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1550
+
1551
+ # Customize the options with defaults
1552
+ metadata = @config.rpcs.bind_device_to_gateway.metadata.to_h
1553
+
1554
+ # Set x-goog-api-client and x-goog-user-project headers
1555
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1556
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1557
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1558
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1559
+
1560
+ header_params = {
1561
+ "parent" => request.parent
1562
+ }
1563
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1564
+ metadata[:"x-goog-request-params"] ||= request_params_header
1565
+
1566
+ options.apply_defaults timeout: @config.rpcs.bind_device_to_gateway.timeout,
1567
+ metadata: metadata,
1568
+ retry_policy: @config.rpcs.bind_device_to_gateway.retry_policy
1569
+ options.apply_defaults metadata: @config.metadata,
1570
+ retry_policy: @config.retry_policy
1571
+
1572
+ @device_manager_stub.call_rpc :bind_device_to_gateway, request, options: options do |response, operation|
1573
+ yield response, operation if block_given?
1574
+ return response
1575
+ end
1576
+ rescue ::GRPC::BadStatus => e
1577
+ raise ::Google::Cloud::Error.from_error(e)
1578
+ end
1579
+
1580
+ ##
1581
+ # Deletes the association between the device and the gateway.
1582
+ #
1583
+ # @overload unbind_device_from_gateway(request, options = nil)
1584
+ # Pass arguments to `unbind_device_from_gateway` via a request object, either of type
1585
+ # {::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest} or an equivalent Hash.
1586
+ #
1587
+ # @param request [::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest, ::Hash]
1588
+ # A request object representing the call parameters. Required. To specify no
1589
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1590
+ # @param options [::Gapic::CallOptions, ::Hash]
1591
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1592
+ #
1593
+ # @overload unbind_device_from_gateway(parent: nil, gateway_id: nil, device_id: nil)
1594
+ # Pass arguments to `unbind_device_from_gateway` via keyword arguments. Note that at
1595
+ # least one keyword argument is required. To specify no parameters, or to keep all
1596
+ # the default parameter values, pass an empty Hash as a request object (see above).
1597
+ #
1598
+ # @param parent [::String]
1599
+ # Required. The name of the registry. For example,
1600
+ # `projects/example-project/locations/us-central1/registries/my-registry`.
1601
+ # @param gateway_id [::String]
1602
+ # Required. The value of `gateway_id` can be either the device numeric ID or the
1603
+ # user-defined device identifier.
1604
+ # @param device_id [::String]
1605
+ # Required. The device to disassociate from the specified gateway. The value of
1606
+ # `device_id` can be either the device numeric ID or the user-defined device
1607
+ # identifier.
1608
+ #
1609
+ # @yield [response, operation] Access the result along with the RPC operation
1610
+ # @yieldparam response [::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse]
1611
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1612
+ #
1613
+ # @return [::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse]
1614
+ #
1615
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1616
+ #
1617
+ def unbind_device_from_gateway request, options = nil
1618
+ raise ::ArgumentError, "request must be provided" if request.nil?
1619
+
1620
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest
1621
+
1622
+ # Converts hash and nil to an options object
1623
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1624
+
1625
+ # Customize the options with defaults
1626
+ metadata = @config.rpcs.unbind_device_from_gateway.metadata.to_h
1627
+
1628
+ # Set x-goog-api-client and x-goog-user-project headers
1629
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1630
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1631
+ gapic_version: ::Google::Cloud::Iot::V1::VERSION
1632
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1633
+
1634
+ header_params = {
1635
+ "parent" => request.parent
1636
+ }
1637
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1638
+ metadata[:"x-goog-request-params"] ||= request_params_header
1639
+
1640
+ options.apply_defaults timeout: @config.rpcs.unbind_device_from_gateway.timeout,
1641
+ metadata: metadata,
1642
+ retry_policy: @config.rpcs.unbind_device_from_gateway.retry_policy
1643
+ options.apply_defaults metadata: @config.metadata,
1644
+ retry_policy: @config.retry_policy
1645
+
1646
+ @device_manager_stub.call_rpc :unbind_device_from_gateway, request, options: options do |response, operation|
1647
+ yield response, operation if block_given?
1648
+ return response
1649
+ end
1650
+ rescue ::GRPC::BadStatus => e
1651
+ raise ::Google::Cloud::Error.from_error(e)
1652
+ end
1653
+
1654
+ ##
1655
+ # Configuration class for the DeviceManager API.
1656
+ #
1657
+ # This class represents the configuration for DeviceManager,
1658
+ # providing control over timeouts, retry behavior, logging, transport
1659
+ # parameters, and other low-level controls. Certain parameters can also be
1660
+ # applied individually to specific RPCs. See
1661
+ # {::Google::Cloud::Iot::V1::DeviceManager::Client::Configuration::Rpcs}
1662
+ # for a list of RPCs that can be configured independently.
1663
+ #
1664
+ # Configuration can be applied globally to all clients, or to a single client
1665
+ # on construction.
1666
+ #
1667
+ # # Examples
1668
+ #
1669
+ # To modify the global config, setting the timeout for create_device_registry
1670
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
1671
+ #
1672
+ # ::Google::Cloud::Iot::V1::DeviceManager::Client.configure do |config|
1673
+ # config.timeout = 10.0
1674
+ # config.rpcs.create_device_registry.timeout = 20.0
1675
+ # end
1676
+ #
1677
+ # To apply the above configuration only to a new client:
1678
+ #
1679
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config|
1680
+ # config.timeout = 10.0
1681
+ # config.rpcs.create_device_registry.timeout = 20.0
1682
+ # end
1683
+ #
1684
+ # @!attribute [rw] endpoint
1685
+ # The hostname or hostname:port of the service endpoint.
1686
+ # Defaults to `"cloudiot.googleapis.com"`.
1687
+ # @return [::String]
1688
+ # @!attribute [rw] credentials
1689
+ # Credentials to send with calls. You may provide any of the following types:
1690
+ # * (`String`) The path to a service account key file in JSON format
1691
+ # * (`Hash`) A service account key as a Hash
1692
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1693
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1694
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1695
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1696
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1697
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1698
+ # * (`nil`) indicating no credentials
1699
+ # @return [::Object]
1700
+ # @!attribute [rw] scope
1701
+ # The OAuth scopes
1702
+ # @return [::Array<::String>]
1703
+ # @!attribute [rw] lib_name
1704
+ # The library name as recorded in instrumentation and logging
1705
+ # @return [::String]
1706
+ # @!attribute [rw] lib_version
1707
+ # The library version as recorded in instrumentation and logging
1708
+ # @return [::String]
1709
+ # @!attribute [rw] channel_args
1710
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1711
+ # `GRPC::Core::Channel` object is provided as the credential.
1712
+ # @return [::Hash]
1713
+ # @!attribute [rw] interceptors
1714
+ # An array of interceptors that are run before calls are executed.
1715
+ # @return [::Array<::GRPC::ClientInterceptor>]
1716
+ # @!attribute [rw] timeout
1717
+ # The call timeout in seconds.
1718
+ # @return [::Numeric]
1719
+ # @!attribute [rw] metadata
1720
+ # Additional gRPC headers to be sent with the call.
1721
+ # @return [::Hash{::Symbol=>::String}]
1722
+ # @!attribute [rw] retry_policy
1723
+ # The retry policy. The value is a hash with the following keys:
1724
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1725
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1726
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1727
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1728
+ # trigger a retry.
1729
+ # @return [::Hash]
1730
+ # @!attribute [rw] quota_project
1731
+ # A separate project against which to charge quota.
1732
+ # @return [::String]
1733
+ #
1734
+ class Configuration
1735
+ extend ::Gapic::Config
1736
+
1737
+ config_attr :endpoint, "cloudiot.googleapis.com", ::String
1738
+ config_attr :credentials, nil do |value|
1739
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1740
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1741
+ allowed.any? { |klass| klass === value }
1742
+ end
1743
+ config_attr :scope, nil, ::String, ::Array, nil
1744
+ config_attr :lib_name, nil, ::String, nil
1745
+ config_attr :lib_version, nil, ::String, nil
1746
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1747
+ config_attr :interceptors, nil, ::Array, nil
1748
+ config_attr :timeout, nil, ::Numeric, nil
1749
+ config_attr :metadata, nil, ::Hash, nil
1750
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1751
+ config_attr :quota_project, nil, ::String, nil
1752
+
1753
+ # @private
1754
+ def initialize parent_config = nil
1755
+ @parent_config = parent_config unless parent_config.nil?
1756
+
1757
+ yield self if block_given?
1758
+ end
1759
+
1760
+ ##
1761
+ # Configurations for individual RPCs
1762
+ # @return [Rpcs]
1763
+ #
1764
+ def rpcs
1765
+ @rpcs ||= begin
1766
+ parent_rpcs = nil
1767
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1768
+ Rpcs.new parent_rpcs
1769
+ end
1770
+ end
1771
+
1772
+ ##
1773
+ # Configuration RPC class for the DeviceManager API.
1774
+ #
1775
+ # Includes fields providing the configuration for each RPC in this service.
1776
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1777
+ # the following configuration fields:
1778
+ #
1779
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1780
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1781
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1782
+ # include the following keys:
1783
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1784
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1785
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1786
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1787
+ # trigger a retry.
1788
+ #
1789
+ class Rpcs
1790
+ ##
1791
+ # RPC-specific configuration for `create_device_registry`
1792
+ # @return [::Gapic::Config::Method]
1793
+ #
1794
+ attr_reader :create_device_registry
1795
+ ##
1796
+ # RPC-specific configuration for `get_device_registry`
1797
+ # @return [::Gapic::Config::Method]
1798
+ #
1799
+ attr_reader :get_device_registry
1800
+ ##
1801
+ # RPC-specific configuration for `update_device_registry`
1802
+ # @return [::Gapic::Config::Method]
1803
+ #
1804
+ attr_reader :update_device_registry
1805
+ ##
1806
+ # RPC-specific configuration for `delete_device_registry`
1807
+ # @return [::Gapic::Config::Method]
1808
+ #
1809
+ attr_reader :delete_device_registry
1810
+ ##
1811
+ # RPC-specific configuration for `list_device_registries`
1812
+ # @return [::Gapic::Config::Method]
1813
+ #
1814
+ attr_reader :list_device_registries
1815
+ ##
1816
+ # RPC-specific configuration for `create_device`
1817
+ # @return [::Gapic::Config::Method]
1818
+ #
1819
+ attr_reader :create_device
1820
+ ##
1821
+ # RPC-specific configuration for `get_device`
1822
+ # @return [::Gapic::Config::Method]
1823
+ #
1824
+ attr_reader :get_device
1825
+ ##
1826
+ # RPC-specific configuration for `update_device`
1827
+ # @return [::Gapic::Config::Method]
1828
+ #
1829
+ attr_reader :update_device
1830
+ ##
1831
+ # RPC-specific configuration for `delete_device`
1832
+ # @return [::Gapic::Config::Method]
1833
+ #
1834
+ attr_reader :delete_device
1835
+ ##
1836
+ # RPC-specific configuration for `list_devices`
1837
+ # @return [::Gapic::Config::Method]
1838
+ #
1839
+ attr_reader :list_devices
1840
+ ##
1841
+ # RPC-specific configuration for `modify_cloud_to_device_config`
1842
+ # @return [::Gapic::Config::Method]
1843
+ #
1844
+ attr_reader :modify_cloud_to_device_config
1845
+ ##
1846
+ # RPC-specific configuration for `list_device_config_versions`
1847
+ # @return [::Gapic::Config::Method]
1848
+ #
1849
+ attr_reader :list_device_config_versions
1850
+ ##
1851
+ # RPC-specific configuration for `list_device_states`
1852
+ # @return [::Gapic::Config::Method]
1853
+ #
1854
+ attr_reader :list_device_states
1855
+ ##
1856
+ # RPC-specific configuration for `set_iam_policy`
1857
+ # @return [::Gapic::Config::Method]
1858
+ #
1859
+ attr_reader :set_iam_policy
1860
+ ##
1861
+ # RPC-specific configuration for `get_iam_policy`
1862
+ # @return [::Gapic::Config::Method]
1863
+ #
1864
+ attr_reader :get_iam_policy
1865
+ ##
1866
+ # RPC-specific configuration for `test_iam_permissions`
1867
+ # @return [::Gapic::Config::Method]
1868
+ #
1869
+ attr_reader :test_iam_permissions
1870
+ ##
1871
+ # RPC-specific configuration for `send_command_to_device`
1872
+ # @return [::Gapic::Config::Method]
1873
+ #
1874
+ attr_reader :send_command_to_device
1875
+ ##
1876
+ # RPC-specific configuration for `bind_device_to_gateway`
1877
+ # @return [::Gapic::Config::Method]
1878
+ #
1879
+ attr_reader :bind_device_to_gateway
1880
+ ##
1881
+ # RPC-specific configuration for `unbind_device_from_gateway`
1882
+ # @return [::Gapic::Config::Method]
1883
+ #
1884
+ attr_reader :unbind_device_from_gateway
1885
+
1886
+ # @private
1887
+ def initialize parent_rpcs = nil
1888
+ create_device_registry_config = parent_rpcs&.create_device_registry if parent_rpcs&.respond_to? :create_device_registry
1889
+ @create_device_registry = ::Gapic::Config::Method.new create_device_registry_config
1890
+ get_device_registry_config = parent_rpcs&.get_device_registry if parent_rpcs&.respond_to? :get_device_registry
1891
+ @get_device_registry = ::Gapic::Config::Method.new get_device_registry_config
1892
+ update_device_registry_config = parent_rpcs&.update_device_registry if parent_rpcs&.respond_to? :update_device_registry
1893
+ @update_device_registry = ::Gapic::Config::Method.new update_device_registry_config
1894
+ delete_device_registry_config = parent_rpcs&.delete_device_registry if parent_rpcs&.respond_to? :delete_device_registry
1895
+ @delete_device_registry = ::Gapic::Config::Method.new delete_device_registry_config
1896
+ list_device_registries_config = parent_rpcs&.list_device_registries if parent_rpcs&.respond_to? :list_device_registries
1897
+ @list_device_registries = ::Gapic::Config::Method.new list_device_registries_config
1898
+ create_device_config = parent_rpcs&.create_device if parent_rpcs&.respond_to? :create_device
1899
+ @create_device = ::Gapic::Config::Method.new create_device_config
1900
+ get_device_config = parent_rpcs&.get_device if parent_rpcs&.respond_to? :get_device
1901
+ @get_device = ::Gapic::Config::Method.new get_device_config
1902
+ update_device_config = parent_rpcs&.update_device if parent_rpcs&.respond_to? :update_device
1903
+ @update_device = ::Gapic::Config::Method.new update_device_config
1904
+ delete_device_config = parent_rpcs&.delete_device if parent_rpcs&.respond_to? :delete_device
1905
+ @delete_device = ::Gapic::Config::Method.new delete_device_config
1906
+ list_devices_config = parent_rpcs&.list_devices if parent_rpcs&.respond_to? :list_devices
1907
+ @list_devices = ::Gapic::Config::Method.new list_devices_config
1908
+ modify_cloud_to_device_config_config = parent_rpcs&.modify_cloud_to_device_config if parent_rpcs&.respond_to? :modify_cloud_to_device_config
1909
+ @modify_cloud_to_device_config = ::Gapic::Config::Method.new modify_cloud_to_device_config_config
1910
+ list_device_config_versions_config = parent_rpcs&.list_device_config_versions if parent_rpcs&.respond_to? :list_device_config_versions
1911
+ @list_device_config_versions = ::Gapic::Config::Method.new list_device_config_versions_config
1912
+ list_device_states_config = parent_rpcs&.list_device_states if parent_rpcs&.respond_to? :list_device_states
1913
+ @list_device_states = ::Gapic::Config::Method.new list_device_states_config
1914
+ set_iam_policy_config = parent_rpcs&.set_iam_policy if parent_rpcs&.respond_to? :set_iam_policy
1915
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1916
+ get_iam_policy_config = parent_rpcs&.get_iam_policy if parent_rpcs&.respond_to? :get_iam_policy
1917
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1918
+ test_iam_permissions_config = parent_rpcs&.test_iam_permissions if parent_rpcs&.respond_to? :test_iam_permissions
1919
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1920
+ send_command_to_device_config = parent_rpcs&.send_command_to_device if parent_rpcs&.respond_to? :send_command_to_device
1921
+ @send_command_to_device = ::Gapic::Config::Method.new send_command_to_device_config
1922
+ bind_device_to_gateway_config = parent_rpcs&.bind_device_to_gateway if parent_rpcs&.respond_to? :bind_device_to_gateway
1923
+ @bind_device_to_gateway = ::Gapic::Config::Method.new bind_device_to_gateway_config
1924
+ unbind_device_from_gateway_config = parent_rpcs&.unbind_device_from_gateway if parent_rpcs&.respond_to? :unbind_device_from_gateway
1925
+ @unbind_device_from_gateway = ::Gapic::Config::Method.new unbind_device_from_gateway_config
1926
+
1927
+ yield self if block_given?
1928
+ end
1929
+ end
1930
+ end
1931
+ end
1932
+ end
1933
+ end
1934
+ end
1935
+ end
1936
+ end