google-cloud-iot-v1 0.3.1 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Iot::V1::DeviceManager::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
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
46
+ # # Modify the configuration for all DeviceManager clients
47
+ # ::Google::Cloud::Iot::V1::DeviceManager::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -69,80 +68,53 @@ module Google
69
68
 
70
69
  default_config.rpcs.get_device_registry.timeout = 120.0
71
70
  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: [14, 4]
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
76
72
  }
77
73
 
78
74
  default_config.rpcs.update_device_registry.timeout = 120.0
79
75
 
80
76
  default_config.rpcs.delete_device_registry.timeout = 120.0
81
77
  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: [14, 4]
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
86
79
  }
87
80
 
88
81
  default_config.rpcs.list_device_registries.timeout = 120.0
89
82
  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: [14, 4]
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
94
84
  }
95
85
 
96
86
  default_config.rpcs.create_device.timeout = 120.0
97
87
 
98
88
  default_config.rpcs.get_device.timeout = 120.0
99
89
  default_config.rpcs.get_device.retry_policy = {
100
- initial_delay: 0.1,
101
- max_delay: 60.0,
102
- multiplier: 1.3,
103
- retry_codes: [14, 4]
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
104
91
  }
105
92
 
106
93
  default_config.rpcs.update_device.timeout = 120.0
107
94
 
108
95
  default_config.rpcs.delete_device.timeout = 120.0
109
96
  default_config.rpcs.delete_device.retry_policy = {
110
- initial_delay: 0.1,
111
- max_delay: 60.0,
112
- multiplier: 1.3,
113
- retry_codes: [14, 4]
97
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
114
98
  }
115
99
 
116
100
  default_config.rpcs.list_devices.timeout = 120.0
117
101
  default_config.rpcs.list_devices.retry_policy = {
118
- initial_delay: 0.1,
119
- max_delay: 60.0,
120
- multiplier: 1.3,
121
- retry_codes: [14, 4]
102
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
122
103
  }
123
104
 
124
105
  default_config.rpcs.modify_cloud_to_device_config.timeout = 120.0
125
106
  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: [14, 4, 8]
107
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4, 8]
130
108
  }
131
109
 
132
110
  default_config.rpcs.list_device_config_versions.timeout = 120.0
133
111
  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: [14, 4]
112
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
138
113
  }
139
114
 
140
115
  default_config.rpcs.list_device_states.timeout = 120.0
141
116
  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: [14, 4]
117
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
146
118
  }
147
119
 
148
120
  default_config.rpcs.set_iam_policy.timeout = 120.0
@@ -153,10 +125,7 @@ module Google
153
125
 
154
126
  default_config.rpcs.send_command_to_device.timeout = 120.0
155
127
  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: [14, 4, 8]
128
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4, 8]
160
129
  }
161
130
 
162
131
  default_config.rpcs.bind_device_to_gateway.timeout = 120.0
@@ -192,19 +161,15 @@ module Google
192
161
  ##
193
162
  # Create a new DeviceManager client object.
194
163
  #
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
164
+ # @example
201
165
  #
202
- # To create a new DeviceManager client with a custom
203
- # configuration:
166
+ # # Create a client using the default configuration
167
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new
204
168
  #
205
- # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config|
206
- # config.timeout = 10.0
207
- # end
169
+ # # Create a client using a custom configuration
170
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config|
171
+ # config.timeout = 10.0
172
+ # end
208
173
  #
209
174
  # @yield [config] Configure the DeviceManager client.
210
175
  # @yieldparam config [Client::Configuration]
@@ -224,14 +189,13 @@ module Google
224
189
 
225
190
  # Create credentials
226
191
  credentials = @config.credentials
227
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
192
+ # Use self-signed JWT if the endpoint is unchanged from default,
228
193
  # but only if the default endpoint does not have a region prefix.
229
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
230
- @config.endpoint == Client.configure.endpoint &&
194
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
231
195
  !@config.endpoint.split(".").first.include?("-")
232
196
  credentials ||= Credentials.default scope: @config.scope,
233
197
  enable_self_signed_jwt: enable_self_signed_jwt
234
- if credentials.is_a?(String) || credentials.is_a?(Hash)
198
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
235
199
  credentials = Credentials.new credentials, scope: @config.scope
236
200
  end
237
201
  @quota_project_id = @config.quota_project
@@ -282,6 +246,21 @@ module Google
282
246
  #
283
247
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
284
248
  #
249
+ # @example Basic example
250
+ # require "google/cloud/iot/v1"
251
+ #
252
+ # # Create a client object. The client can be reused for multiple calls.
253
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
254
+ #
255
+ # # Create a request. To set request fields, pass in keyword arguments.
256
+ # request = Google::Cloud::Iot::V1::CreateDeviceRegistryRequest.new
257
+ #
258
+ # # Call the create_device_registry method.
259
+ # result = client.create_device_registry request
260
+ #
261
+ # # The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry.
262
+ # p result
263
+ #
285
264
  def create_device_registry request, options = nil
286
265
  raise ::ArgumentError, "request must be provided" if request.nil?
287
266
 
@@ -299,16 +278,20 @@ module Google
299
278
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
300
279
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
301
280
 
302
- header_params = {
303
- "parent" => request.parent
304
- }
281
+ header_params = {}
282
+ if request.parent
283
+ header_params["parent"] = request.parent
284
+ end
285
+
305
286
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
306
287
  metadata[:"x-goog-request-params"] ||= request_params_header
307
288
 
308
289
  options.apply_defaults timeout: @config.rpcs.create_device_registry.timeout,
309
290
  metadata: metadata,
310
291
  retry_policy: @config.rpcs.create_device_registry.retry_policy
311
- options.apply_defaults metadata: @config.metadata,
292
+
293
+ options.apply_defaults timeout: @config.timeout,
294
+ metadata: @config.metadata,
312
295
  retry_policy: @config.retry_policy
313
296
 
314
297
  @device_manager_stub.call_rpc :create_device_registry, request, options: options do |response, operation|
@@ -349,6 +332,21 @@ module Google
349
332
  #
350
333
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
351
334
  #
335
+ # @example Basic example
336
+ # require "google/cloud/iot/v1"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Cloud::Iot::V1::GetDeviceRegistryRequest.new
343
+ #
344
+ # # Call the get_device_registry method.
345
+ # result = client.get_device_registry request
346
+ #
347
+ # # The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry.
348
+ # p result
349
+ #
352
350
  def get_device_registry request, options = nil
353
351
  raise ::ArgumentError, "request must be provided" if request.nil?
354
352
 
@@ -366,16 +364,20 @@ module Google
366
364
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
367
365
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
368
366
 
369
- header_params = {
370
- "name" => request.name
371
- }
367
+ header_params = {}
368
+ if request.name
369
+ header_params["name"] = request.name
370
+ end
371
+
372
372
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
373
373
  metadata[:"x-goog-request-params"] ||= request_params_header
374
374
 
375
375
  options.apply_defaults timeout: @config.rpcs.get_device_registry.timeout,
376
376
  metadata: metadata,
377
377
  retry_policy: @config.rpcs.get_device_registry.retry_policy
378
- options.apply_defaults metadata: @config.metadata,
378
+
379
+ options.apply_defaults timeout: @config.timeout,
380
+ metadata: @config.metadata,
379
381
  retry_policy: @config.retry_policy
380
382
 
381
383
  @device_manager_stub.call_rpc :get_device_registry, request, options: options do |response, operation|
@@ -423,6 +425,21 @@ module Google
423
425
  #
424
426
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
425
427
  #
428
+ # @example Basic example
429
+ # require "google/cloud/iot/v1"
430
+ #
431
+ # # Create a client object. The client can be reused for multiple calls.
432
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
433
+ #
434
+ # # Create a request. To set request fields, pass in keyword arguments.
435
+ # request = Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest.new
436
+ #
437
+ # # Call the update_device_registry method.
438
+ # result = client.update_device_registry request
439
+ #
440
+ # # The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry.
441
+ # p result
442
+ #
426
443
  def update_device_registry request, options = nil
427
444
  raise ::ArgumentError, "request must be provided" if request.nil?
428
445
 
@@ -440,16 +457,20 @@ module Google
440
457
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
441
458
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
442
459
 
443
- header_params = {
444
- "device_registry.name" => request.device_registry.name
445
- }
460
+ header_params = {}
461
+ if request.device_registry&.name
462
+ header_params["device_registry.name"] = request.device_registry.name
463
+ end
464
+
446
465
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
447
466
  metadata[:"x-goog-request-params"] ||= request_params_header
448
467
 
449
468
  options.apply_defaults timeout: @config.rpcs.update_device_registry.timeout,
450
469
  metadata: metadata,
451
470
  retry_policy: @config.rpcs.update_device_registry.retry_policy
452
- options.apply_defaults metadata: @config.metadata,
471
+
472
+ options.apply_defaults timeout: @config.timeout,
473
+ metadata: @config.metadata,
453
474
  retry_policy: @config.retry_policy
454
475
 
455
476
  @device_manager_stub.call_rpc :update_device_registry, request, options: options do |response, operation|
@@ -490,6 +511,21 @@ module Google
490
511
  #
491
512
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
492
513
  #
514
+ # @example Basic example
515
+ # require "google/cloud/iot/v1"
516
+ #
517
+ # # Create a client object. The client can be reused for multiple calls.
518
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
519
+ #
520
+ # # Create a request. To set request fields, pass in keyword arguments.
521
+ # request = Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest.new
522
+ #
523
+ # # Call the delete_device_registry method.
524
+ # result = client.delete_device_registry request
525
+ #
526
+ # # The returned object is of type Google::Protobuf::Empty.
527
+ # p result
528
+ #
493
529
  def delete_device_registry request, options = nil
494
530
  raise ::ArgumentError, "request must be provided" if request.nil?
495
531
 
@@ -507,16 +543,20 @@ module Google
507
543
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
508
544
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
509
545
 
510
- header_params = {
511
- "name" => request.name
512
- }
546
+ header_params = {}
547
+ if request.name
548
+ header_params["name"] = request.name
549
+ end
550
+
513
551
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
514
552
  metadata[:"x-goog-request-params"] ||= request_params_header
515
553
 
516
554
  options.apply_defaults timeout: @config.rpcs.delete_device_registry.timeout,
517
555
  metadata: metadata,
518
556
  retry_policy: @config.rpcs.delete_device_registry.retry_policy
519
- options.apply_defaults metadata: @config.metadata,
557
+
558
+ options.apply_defaults timeout: @config.timeout,
559
+ metadata: @config.metadata,
520
560
  retry_policy: @config.retry_policy
521
561
 
522
562
  @device_manager_stub.call_rpc :delete_device_registry, request, options: options do |response, operation|
@@ -566,6 +606,27 @@ module Google
566
606
  #
567
607
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
568
608
  #
609
+ # @example Basic example
610
+ # require "google/cloud/iot/v1"
611
+ #
612
+ # # Create a client object. The client can be reused for multiple calls.
613
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
614
+ #
615
+ # # Create a request. To set request fields, pass in keyword arguments.
616
+ # request = Google::Cloud::Iot::V1::ListDeviceRegistriesRequest.new
617
+ #
618
+ # # Call the list_device_registries method.
619
+ # result = client.list_device_registries request
620
+ #
621
+ # # The returned object is of type Gapic::PagedEnumerable. You can
622
+ # # iterate over all elements by calling #each, and the enumerable
623
+ # # will lazily make API calls to fetch subsequent pages. Other
624
+ # # methods are also available for managing paging directly.
625
+ # result.each do |response|
626
+ # # Each element is of type ::Google::Cloud::Iot::V1::DeviceRegistry.
627
+ # p response
628
+ # end
629
+ #
569
630
  def list_device_registries request, options = nil
570
631
  raise ::ArgumentError, "request must be provided" if request.nil?
571
632
 
@@ -583,16 +644,20 @@ module Google
583
644
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
584
645
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
585
646
 
586
- header_params = {
587
- "parent" => request.parent
588
- }
647
+ header_params = {}
648
+ if request.parent
649
+ header_params["parent"] = request.parent
650
+ end
651
+
589
652
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
590
653
  metadata[:"x-goog-request-params"] ||= request_params_header
591
654
 
592
655
  options.apply_defaults timeout: @config.rpcs.list_device_registries.timeout,
593
656
  metadata: metadata,
594
657
  retry_policy: @config.rpcs.list_device_registries.retry_policy
595
- options.apply_defaults metadata: @config.metadata,
658
+
659
+ options.apply_defaults timeout: @config.timeout,
660
+ metadata: @config.metadata,
596
661
  retry_policy: @config.retry_policy
597
662
 
598
663
  @device_manager_stub.call_rpc :list_device_registries, request, options: options do |response, operation|
@@ -639,6 +704,21 @@ module Google
639
704
  #
640
705
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
641
706
  #
707
+ # @example Basic example
708
+ # require "google/cloud/iot/v1"
709
+ #
710
+ # # Create a client object. The client can be reused for multiple calls.
711
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
712
+ #
713
+ # # Create a request. To set request fields, pass in keyword arguments.
714
+ # request = Google::Cloud::Iot::V1::CreateDeviceRequest.new
715
+ #
716
+ # # Call the create_device method.
717
+ # result = client.create_device request
718
+ #
719
+ # # The returned object is of type Google::Cloud::Iot::V1::Device.
720
+ # p result
721
+ #
642
722
  def create_device request, options = nil
643
723
  raise ::ArgumentError, "request must be provided" if request.nil?
644
724
 
@@ -656,16 +736,20 @@ module Google
656
736
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
657
737
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
658
738
 
659
- header_params = {
660
- "parent" => request.parent
661
- }
739
+ header_params = {}
740
+ if request.parent
741
+ header_params["parent"] = request.parent
742
+ end
743
+
662
744
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
663
745
  metadata[:"x-goog-request-params"] ||= request_params_header
664
746
 
665
747
  options.apply_defaults timeout: @config.rpcs.create_device.timeout,
666
748
  metadata: metadata,
667
749
  retry_policy: @config.rpcs.create_device.retry_policy
668
- options.apply_defaults metadata: @config.metadata,
750
+
751
+ options.apply_defaults timeout: @config.timeout,
752
+ metadata: @config.metadata,
669
753
  retry_policy: @config.retry_policy
670
754
 
671
755
  @device_manager_stub.call_rpc :create_device, request, options: options do |response, operation|
@@ -711,6 +795,21 @@ module Google
711
795
  #
712
796
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
713
797
  #
798
+ # @example Basic example
799
+ # require "google/cloud/iot/v1"
800
+ #
801
+ # # Create a client object. The client can be reused for multiple calls.
802
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
803
+ #
804
+ # # Create a request. To set request fields, pass in keyword arguments.
805
+ # request = Google::Cloud::Iot::V1::GetDeviceRequest.new
806
+ #
807
+ # # Call the get_device method.
808
+ # result = client.get_device request
809
+ #
810
+ # # The returned object is of type Google::Cloud::Iot::V1::Device.
811
+ # p result
812
+ #
714
813
  def get_device request, options = nil
715
814
  raise ::ArgumentError, "request must be provided" if request.nil?
716
815
 
@@ -728,16 +827,20 @@ module Google
728
827
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
729
828
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
730
829
 
731
- header_params = {
732
- "name" => request.name
733
- }
830
+ header_params = {}
831
+ if request.name
832
+ header_params["name"] = request.name
833
+ end
834
+
734
835
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
735
836
  metadata[:"x-goog-request-params"] ||= request_params_header
736
837
 
737
838
  options.apply_defaults timeout: @config.rpcs.get_device.timeout,
738
839
  metadata: metadata,
739
840
  retry_policy: @config.rpcs.get_device.retry_policy
740
- options.apply_defaults metadata: @config.metadata,
841
+
842
+ options.apply_defaults timeout: @config.timeout,
843
+ metadata: @config.metadata,
741
844
  retry_policy: @config.retry_policy
742
845
 
743
846
  @device_manager_stub.call_rpc :get_device, request, options: options do |response, operation|
@@ -785,6 +888,21 @@ module Google
785
888
  #
786
889
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
787
890
  #
891
+ # @example Basic example
892
+ # require "google/cloud/iot/v1"
893
+ #
894
+ # # Create a client object. The client can be reused for multiple calls.
895
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
896
+ #
897
+ # # Create a request. To set request fields, pass in keyword arguments.
898
+ # request = Google::Cloud::Iot::V1::UpdateDeviceRequest.new
899
+ #
900
+ # # Call the update_device method.
901
+ # result = client.update_device request
902
+ #
903
+ # # The returned object is of type Google::Cloud::Iot::V1::Device.
904
+ # p result
905
+ #
788
906
  def update_device request, options = nil
789
907
  raise ::ArgumentError, "request must be provided" if request.nil?
790
908
 
@@ -802,16 +920,20 @@ module Google
802
920
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
803
921
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
804
922
 
805
- header_params = {
806
- "device.name" => request.device.name
807
- }
923
+ header_params = {}
924
+ if request.device&.name
925
+ header_params["device.name"] = request.device.name
926
+ end
927
+
808
928
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
809
929
  metadata[:"x-goog-request-params"] ||= request_params_header
810
930
 
811
931
  options.apply_defaults timeout: @config.rpcs.update_device.timeout,
812
932
  metadata: metadata,
813
933
  retry_policy: @config.rpcs.update_device.retry_policy
814
- options.apply_defaults metadata: @config.metadata,
934
+
935
+ options.apply_defaults timeout: @config.timeout,
936
+ metadata: @config.metadata,
815
937
  retry_policy: @config.retry_policy
816
938
 
817
939
  @device_manager_stub.call_rpc :update_device, request, options: options do |response, operation|
@@ -853,6 +975,21 @@ module Google
853
975
  #
854
976
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
855
977
  #
978
+ # @example Basic example
979
+ # require "google/cloud/iot/v1"
980
+ #
981
+ # # Create a client object. The client can be reused for multiple calls.
982
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
983
+ #
984
+ # # Create a request. To set request fields, pass in keyword arguments.
985
+ # request = Google::Cloud::Iot::V1::DeleteDeviceRequest.new
986
+ #
987
+ # # Call the delete_device method.
988
+ # result = client.delete_device request
989
+ #
990
+ # # The returned object is of type Google::Protobuf::Empty.
991
+ # p result
992
+ #
856
993
  def delete_device request, options = nil
857
994
  raise ::ArgumentError, "request must be provided" if request.nil?
858
995
 
@@ -870,16 +1007,20 @@ module Google
870
1007
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
871
1008
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
872
1009
 
873
- header_params = {
874
- "name" => request.name
875
- }
1010
+ header_params = {}
1011
+ if request.name
1012
+ header_params["name"] = request.name
1013
+ end
1014
+
876
1015
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
877
1016
  metadata[:"x-goog-request-params"] ||= request_params_header
878
1017
 
879
1018
  options.apply_defaults timeout: @config.rpcs.delete_device.timeout,
880
1019
  metadata: metadata,
881
1020
  retry_policy: @config.rpcs.delete_device.retry_policy
882
- options.apply_defaults metadata: @config.metadata,
1021
+
1022
+ options.apply_defaults timeout: @config.timeout,
1023
+ metadata: @config.metadata,
883
1024
  retry_policy: @config.retry_policy
884
1025
 
885
1026
  @device_manager_stub.call_rpc :delete_device, request, options: options do |response, operation|
@@ -942,6 +1083,27 @@ module Google
942
1083
  #
943
1084
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
944
1085
  #
1086
+ # @example Basic example
1087
+ # require "google/cloud/iot/v1"
1088
+ #
1089
+ # # Create a client object. The client can be reused for multiple calls.
1090
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1091
+ #
1092
+ # # Create a request. To set request fields, pass in keyword arguments.
1093
+ # request = Google::Cloud::Iot::V1::ListDevicesRequest.new
1094
+ #
1095
+ # # Call the list_devices method.
1096
+ # result = client.list_devices request
1097
+ #
1098
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1099
+ # # iterate over all elements by calling #each, and the enumerable
1100
+ # # will lazily make API calls to fetch subsequent pages. Other
1101
+ # # methods are also available for managing paging directly.
1102
+ # result.each do |response|
1103
+ # # Each element is of type ::Google::Cloud::Iot::V1::Device.
1104
+ # p response
1105
+ # end
1106
+ #
945
1107
  def list_devices request, options = nil
946
1108
  raise ::ArgumentError, "request must be provided" if request.nil?
947
1109
 
@@ -959,16 +1121,20 @@ module Google
959
1121
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
960
1122
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
961
1123
 
962
- header_params = {
963
- "parent" => request.parent
964
- }
1124
+ header_params = {}
1125
+ if request.parent
1126
+ header_params["parent"] = request.parent
1127
+ end
1128
+
965
1129
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
966
1130
  metadata[:"x-goog-request-params"] ||= request_params_header
967
1131
 
968
1132
  options.apply_defaults timeout: @config.rpcs.list_devices.timeout,
969
1133
  metadata: metadata,
970
1134
  retry_policy: @config.rpcs.list_devices.retry_policy
971
- options.apply_defaults metadata: @config.metadata,
1135
+
1136
+ options.apply_defaults timeout: @config.timeout,
1137
+ metadata: @config.metadata,
972
1138
  retry_policy: @config.retry_policy
973
1139
 
974
1140
  @device_manager_stub.call_rpc :list_devices, request, options: options do |response, operation|
@@ -1021,6 +1187,21 @@ module Google
1021
1187
  #
1022
1188
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1023
1189
  #
1190
+ # @example Basic example
1191
+ # require "google/cloud/iot/v1"
1192
+ #
1193
+ # # Create a client object. The client can be reused for multiple calls.
1194
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1195
+ #
1196
+ # # Create a request. To set request fields, pass in keyword arguments.
1197
+ # request = Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest.new
1198
+ #
1199
+ # # Call the modify_cloud_to_device_config method.
1200
+ # result = client.modify_cloud_to_device_config request
1201
+ #
1202
+ # # The returned object is of type Google::Cloud::Iot::V1::DeviceConfig.
1203
+ # p result
1204
+ #
1024
1205
  def modify_cloud_to_device_config request, options = nil
1025
1206
  raise ::ArgumentError, "request must be provided" if request.nil?
1026
1207
 
@@ -1038,16 +1219,20 @@ module Google
1038
1219
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1039
1220
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1040
1221
 
1041
- header_params = {
1042
- "name" => request.name
1043
- }
1222
+ header_params = {}
1223
+ if request.name
1224
+ header_params["name"] = request.name
1225
+ end
1226
+
1044
1227
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1045
1228
  metadata[:"x-goog-request-params"] ||= request_params_header
1046
1229
 
1047
1230
  options.apply_defaults timeout: @config.rpcs.modify_cloud_to_device_config.timeout,
1048
1231
  metadata: metadata,
1049
1232
  retry_policy: @config.rpcs.modify_cloud_to_device_config.retry_policy
1050
- options.apply_defaults metadata: @config.metadata,
1233
+
1234
+ options.apply_defaults timeout: @config.timeout,
1235
+ metadata: @config.metadata,
1051
1236
  retry_policy: @config.retry_policy
1052
1237
 
1053
1238
  @device_manager_stub.call_rpc :modify_cloud_to_device_config, request, options: options do |response, operation|
@@ -1094,6 +1279,21 @@ module Google
1094
1279
  #
1095
1280
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1096
1281
  #
1282
+ # @example Basic example
1283
+ # require "google/cloud/iot/v1"
1284
+ #
1285
+ # # Create a client object. The client can be reused for multiple calls.
1286
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1287
+ #
1288
+ # # Create a request. To set request fields, pass in keyword arguments.
1289
+ # request = Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest.new
1290
+ #
1291
+ # # Call the list_device_config_versions method.
1292
+ # result = client.list_device_config_versions request
1293
+ #
1294
+ # # The returned object is of type Google::Cloud::Iot::V1::ListDeviceConfigVersionsResponse.
1295
+ # p result
1296
+ #
1097
1297
  def list_device_config_versions request, options = nil
1098
1298
  raise ::ArgumentError, "request must be provided" if request.nil?
1099
1299
 
@@ -1111,16 +1311,20 @@ module Google
1111
1311
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1112
1312
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1113
1313
 
1114
- header_params = {
1115
- "name" => request.name
1116
- }
1314
+ header_params = {}
1315
+ if request.name
1316
+ header_params["name"] = request.name
1317
+ end
1318
+
1117
1319
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1118
1320
  metadata[:"x-goog-request-params"] ||= request_params_header
1119
1321
 
1120
1322
  options.apply_defaults timeout: @config.rpcs.list_device_config_versions.timeout,
1121
1323
  metadata: metadata,
1122
1324
  retry_policy: @config.rpcs.list_device_config_versions.retry_policy
1123
- options.apply_defaults metadata: @config.metadata,
1325
+
1326
+ options.apply_defaults timeout: @config.timeout,
1327
+ metadata: @config.metadata,
1124
1328
  retry_policy: @config.retry_policy
1125
1329
 
1126
1330
  @device_manager_stub.call_rpc :list_device_config_versions, request, options: options do |response, operation|
@@ -1167,6 +1371,21 @@ module Google
1167
1371
  #
1168
1372
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1169
1373
  #
1374
+ # @example Basic example
1375
+ # require "google/cloud/iot/v1"
1376
+ #
1377
+ # # Create a client object. The client can be reused for multiple calls.
1378
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1379
+ #
1380
+ # # Create a request. To set request fields, pass in keyword arguments.
1381
+ # request = Google::Cloud::Iot::V1::ListDeviceStatesRequest.new
1382
+ #
1383
+ # # Call the list_device_states method.
1384
+ # result = client.list_device_states request
1385
+ #
1386
+ # # The returned object is of type Google::Cloud::Iot::V1::ListDeviceStatesResponse.
1387
+ # p result
1388
+ #
1170
1389
  def list_device_states request, options = nil
1171
1390
  raise ::ArgumentError, "request must be provided" if request.nil?
1172
1391
 
@@ -1184,16 +1403,20 @@ module Google
1184
1403
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1185
1404
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1186
1405
 
1187
- header_params = {
1188
- "name" => request.name
1189
- }
1406
+ header_params = {}
1407
+ if request.name
1408
+ header_params["name"] = request.name
1409
+ end
1410
+
1190
1411
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1191
1412
  metadata[:"x-goog-request-params"] ||= request_params_header
1192
1413
 
1193
1414
  options.apply_defaults timeout: @config.rpcs.list_device_states.timeout,
1194
1415
  metadata: metadata,
1195
1416
  retry_policy: @config.rpcs.list_device_states.retry_policy
1196
- options.apply_defaults metadata: @config.metadata,
1417
+
1418
+ options.apply_defaults timeout: @config.timeout,
1419
+ metadata: @config.metadata,
1197
1420
  retry_policy: @config.retry_policy
1198
1421
 
1199
1422
  @device_manager_stub.call_rpc :list_device_states, request, options: options do |response, operation|
@@ -1240,6 +1463,21 @@ module Google
1240
1463
  #
1241
1464
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1242
1465
  #
1466
+ # @example Basic example
1467
+ # require "google/cloud/iot/v1"
1468
+ #
1469
+ # # Create a client object. The client can be reused for multiple calls.
1470
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1471
+ #
1472
+ # # Create a request. To set request fields, pass in keyword arguments.
1473
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1474
+ #
1475
+ # # Call the set_iam_policy method.
1476
+ # result = client.set_iam_policy request
1477
+ #
1478
+ # # The returned object is of type Google::Iam::V1::Policy.
1479
+ # p result
1480
+ #
1243
1481
  def set_iam_policy request, options = nil
1244
1482
  raise ::ArgumentError, "request must be provided" if request.nil?
1245
1483
 
@@ -1257,16 +1495,20 @@ module Google
1257
1495
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1258
1496
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1259
1497
 
1260
- header_params = {
1261
- "resource" => request.resource
1262
- }
1498
+ header_params = {}
1499
+ if request.resource
1500
+ header_params["resource"] = request.resource
1501
+ end
1502
+
1263
1503
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1264
1504
  metadata[:"x-goog-request-params"] ||= request_params_header
1265
1505
 
1266
1506
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1267
1507
  metadata: metadata,
1268
1508
  retry_policy: @config.rpcs.set_iam_policy.retry_policy
1269
- options.apply_defaults metadata: @config.metadata,
1509
+
1510
+ options.apply_defaults timeout: @config.timeout,
1511
+ metadata: @config.metadata,
1270
1512
  retry_policy: @config.retry_policy
1271
1513
 
1272
1514
  @device_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
@@ -1312,6 +1554,21 @@ module Google
1312
1554
  #
1313
1555
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1314
1556
  #
1557
+ # @example Basic example
1558
+ # require "google/cloud/iot/v1"
1559
+ #
1560
+ # # Create a client object. The client can be reused for multiple calls.
1561
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1562
+ #
1563
+ # # Create a request. To set request fields, pass in keyword arguments.
1564
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1565
+ #
1566
+ # # Call the get_iam_policy method.
1567
+ # result = client.get_iam_policy request
1568
+ #
1569
+ # # The returned object is of type Google::Iam::V1::Policy.
1570
+ # p result
1571
+ #
1315
1572
  def get_iam_policy request, options = nil
1316
1573
  raise ::ArgumentError, "request must be provided" if request.nil?
1317
1574
 
@@ -1329,16 +1586,20 @@ module Google
1329
1586
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1330
1587
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1331
1588
 
1332
- header_params = {
1333
- "resource" => request.resource
1334
- }
1589
+ header_params = {}
1590
+ if request.resource
1591
+ header_params["resource"] = request.resource
1592
+ end
1593
+
1335
1594
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1336
1595
  metadata[:"x-goog-request-params"] ||= request_params_header
1337
1596
 
1338
1597
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1339
1598
  metadata: metadata,
1340
1599
  retry_policy: @config.rpcs.get_iam_policy.retry_policy
1341
- options.apply_defaults metadata: @config.metadata,
1600
+
1601
+ options.apply_defaults timeout: @config.timeout,
1602
+ metadata: @config.metadata,
1342
1603
  retry_policy: @config.retry_policy
1343
1604
 
1344
1605
  @device_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
@@ -1386,6 +1647,21 @@ module Google
1386
1647
  #
1387
1648
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1388
1649
  #
1650
+ # @example Basic example
1651
+ # require "google/cloud/iot/v1"
1652
+ #
1653
+ # # Create a client object. The client can be reused for multiple calls.
1654
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1655
+ #
1656
+ # # Create a request. To set request fields, pass in keyword arguments.
1657
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1658
+ #
1659
+ # # Call the test_iam_permissions method.
1660
+ # result = client.test_iam_permissions request
1661
+ #
1662
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1663
+ # p result
1664
+ #
1389
1665
  def test_iam_permissions request, options = nil
1390
1666
  raise ::ArgumentError, "request must be provided" if request.nil?
1391
1667
 
@@ -1403,16 +1679,20 @@ module Google
1403
1679
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1404
1680
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1405
1681
 
1406
- header_params = {
1407
- "resource" => request.resource
1408
- }
1682
+ header_params = {}
1683
+ if request.resource
1684
+ header_params["resource"] = request.resource
1685
+ end
1686
+
1409
1687
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1410
1688
  metadata[:"x-goog-request-params"] ||= request_params_header
1411
1689
 
1412
1690
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1413
1691
  metadata: metadata,
1414
1692
  retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1415
- options.apply_defaults metadata: @config.metadata,
1693
+
1694
+ options.apply_defaults timeout: @config.timeout,
1695
+ metadata: @config.metadata,
1416
1696
  retry_policy: @config.retry_policy
1417
1697
 
1418
1698
  @device_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
@@ -1474,6 +1754,21 @@ module Google
1474
1754
  #
1475
1755
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1476
1756
  #
1757
+ # @example Basic example
1758
+ # require "google/cloud/iot/v1"
1759
+ #
1760
+ # # Create a client object. The client can be reused for multiple calls.
1761
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1762
+ #
1763
+ # # Create a request. To set request fields, pass in keyword arguments.
1764
+ # request = Google::Cloud::Iot::V1::SendCommandToDeviceRequest.new
1765
+ #
1766
+ # # Call the send_command_to_device method.
1767
+ # result = client.send_command_to_device request
1768
+ #
1769
+ # # The returned object is of type Google::Cloud::Iot::V1::SendCommandToDeviceResponse.
1770
+ # p result
1771
+ #
1477
1772
  def send_command_to_device request, options = nil
1478
1773
  raise ::ArgumentError, "request must be provided" if request.nil?
1479
1774
 
@@ -1491,16 +1786,20 @@ module Google
1491
1786
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1492
1787
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1493
1788
 
1494
- header_params = {
1495
- "name" => request.name
1496
- }
1789
+ header_params = {}
1790
+ if request.name
1791
+ header_params["name"] = request.name
1792
+ end
1793
+
1497
1794
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1498
1795
  metadata[:"x-goog-request-params"] ||= request_params_header
1499
1796
 
1500
1797
  options.apply_defaults timeout: @config.rpcs.send_command_to_device.timeout,
1501
1798
  metadata: metadata,
1502
1799
  retry_policy: @config.rpcs.send_command_to_device.retry_policy
1503
- options.apply_defaults metadata: @config.metadata,
1800
+
1801
+ options.apply_defaults timeout: @config.timeout,
1802
+ metadata: @config.metadata,
1504
1803
  retry_policy: @config.retry_policy
1505
1804
 
1506
1805
  @device_manager_stub.call_rpc :send_command_to_device, request, options: options do |response, operation|
@@ -1548,6 +1847,21 @@ module Google
1548
1847
  #
1549
1848
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1550
1849
  #
1850
+ # @example Basic example
1851
+ # require "google/cloud/iot/v1"
1852
+ #
1853
+ # # Create a client object. The client can be reused for multiple calls.
1854
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1855
+ #
1856
+ # # Create a request. To set request fields, pass in keyword arguments.
1857
+ # request = Google::Cloud::Iot::V1::BindDeviceToGatewayRequest.new
1858
+ #
1859
+ # # Call the bind_device_to_gateway method.
1860
+ # result = client.bind_device_to_gateway request
1861
+ #
1862
+ # # The returned object is of type Google::Cloud::Iot::V1::BindDeviceToGatewayResponse.
1863
+ # p result
1864
+ #
1551
1865
  def bind_device_to_gateway request, options = nil
1552
1866
  raise ::ArgumentError, "request must be provided" if request.nil?
1553
1867
 
@@ -1565,16 +1879,20 @@ module Google
1565
1879
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1566
1880
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1567
1881
 
1568
- header_params = {
1569
- "parent" => request.parent
1570
- }
1882
+ header_params = {}
1883
+ if request.parent
1884
+ header_params["parent"] = request.parent
1885
+ end
1886
+
1571
1887
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1572
1888
  metadata[:"x-goog-request-params"] ||= request_params_header
1573
1889
 
1574
1890
  options.apply_defaults timeout: @config.rpcs.bind_device_to_gateway.timeout,
1575
1891
  metadata: metadata,
1576
1892
  retry_policy: @config.rpcs.bind_device_to_gateway.retry_policy
1577
- options.apply_defaults metadata: @config.metadata,
1893
+
1894
+ options.apply_defaults timeout: @config.timeout,
1895
+ metadata: @config.metadata,
1578
1896
  retry_policy: @config.retry_policy
1579
1897
 
1580
1898
  @device_manager_stub.call_rpc :bind_device_to_gateway, request, options: options do |response, operation|
@@ -1622,6 +1940,21 @@ module Google
1622
1940
  #
1623
1941
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1624
1942
  #
1943
+ # @example Basic example
1944
+ # require "google/cloud/iot/v1"
1945
+ #
1946
+ # # Create a client object. The client can be reused for multiple calls.
1947
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1948
+ #
1949
+ # # Create a request. To set request fields, pass in keyword arguments.
1950
+ # request = Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest.new
1951
+ #
1952
+ # # Call the unbind_device_from_gateway method.
1953
+ # result = client.unbind_device_from_gateway request
1954
+ #
1955
+ # # The returned object is of type Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse.
1956
+ # p result
1957
+ #
1625
1958
  def unbind_device_from_gateway request, options = nil
1626
1959
  raise ::ArgumentError, "request must be provided" if request.nil?
1627
1960
 
@@ -1639,16 +1972,20 @@ module Google
1639
1972
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1640
1973
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1641
1974
 
1642
- header_params = {
1643
- "parent" => request.parent
1644
- }
1975
+ header_params = {}
1976
+ if request.parent
1977
+ header_params["parent"] = request.parent
1978
+ end
1979
+
1645
1980
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1646
1981
  metadata[:"x-goog-request-params"] ||= request_params_header
1647
1982
 
1648
1983
  options.apply_defaults timeout: @config.rpcs.unbind_device_from_gateway.timeout,
1649
1984
  metadata: metadata,
1650
1985
  retry_policy: @config.rpcs.unbind_device_from_gateway.retry_policy
1651
- options.apply_defaults metadata: @config.metadata,
1986
+
1987
+ options.apply_defaults timeout: @config.timeout,
1988
+ metadata: @config.metadata,
1652
1989
  retry_policy: @config.retry_policy
1653
1990
 
1654
1991
  @device_manager_stub.call_rpc :unbind_device_from_gateway, request, options: options do |response, operation|
@@ -1672,22 +2009,21 @@ module Google
1672
2009
  # Configuration can be applied globally to all clients, or to a single client
1673
2010
  # on construction.
1674
2011
  #
1675
- # # Examples
1676
- #
1677
- # To modify the global config, setting the timeout for create_device_registry
1678
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1679
- #
1680
- # ::Google::Cloud::Iot::V1::DeviceManager::Client.configure do |config|
1681
- # config.timeout = 10.0
1682
- # config.rpcs.create_device_registry.timeout = 20.0
1683
- # end
1684
- #
1685
- # To apply the above configuration only to a new client:
1686
- #
1687
- # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config|
1688
- # config.timeout = 10.0
1689
- # config.rpcs.create_device_registry.timeout = 20.0
1690
- # end
2012
+ # @example
2013
+ #
2014
+ # # Modify the global config, setting the timeout for
2015
+ # # create_device_registry to 20 seconds,
2016
+ # # and all remaining timeouts to 10 seconds.
2017
+ # ::Google::Cloud::Iot::V1::DeviceManager::Client.configure do |config|
2018
+ # config.timeout = 10.0
2019
+ # config.rpcs.create_device_registry.timeout = 20.0
2020
+ # end
2021
+ #
2022
+ # # Apply the above configuration only to a new client.
2023
+ # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config|
2024
+ # config.timeout = 10.0
2025
+ # config.rpcs.create_device_registry.timeout = 20.0
2026
+ # end
1691
2027
  #
1692
2028
  # @!attribute [rw] endpoint
1693
2029
  # The hostname or hostname:port of the service endpoint.