google-cloud-iot-v1 0.3.3 → 0.4.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.
@@ -246,6 +246,21 @@ module Google
246
246
  #
247
247
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
248
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
+ #
249
264
  def create_device_registry request, options = nil
250
265
  raise ::ArgumentError, "request must be provided" if request.nil?
251
266
 
@@ -263,9 +278,11 @@ module Google
263
278
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
264
279
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
265
280
 
266
- header_params = {
267
- "parent" => request.parent
268
- }
281
+ header_params = {}
282
+ if request.parent
283
+ header_params["parent"] = request.parent
284
+ end
285
+
269
286
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
270
287
  metadata[:"x-goog-request-params"] ||= request_params_header
271
288
 
@@ -315,6 +332,21 @@ module Google
315
332
  #
316
333
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
317
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
+ #
318
350
  def get_device_registry request, options = nil
319
351
  raise ::ArgumentError, "request must be provided" if request.nil?
320
352
 
@@ -332,9 +364,11 @@ module Google
332
364
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
333
365
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
334
366
 
335
- header_params = {
336
- "name" => request.name
337
- }
367
+ header_params = {}
368
+ if request.name
369
+ header_params["name"] = request.name
370
+ end
371
+
338
372
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
339
373
  metadata[:"x-goog-request-params"] ||= request_params_header
340
374
 
@@ -391,6 +425,21 @@ module Google
391
425
  #
392
426
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
393
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
+ #
394
443
  def update_device_registry request, options = nil
395
444
  raise ::ArgumentError, "request must be provided" if request.nil?
396
445
 
@@ -408,9 +457,11 @@ module Google
408
457
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
409
458
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
410
459
 
411
- header_params = {
412
- "device_registry.name" => request.device_registry.name
413
- }
460
+ header_params = {}
461
+ if request.device_registry&.name
462
+ header_params["device_registry.name"] = request.device_registry.name
463
+ end
464
+
414
465
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
415
466
  metadata[:"x-goog-request-params"] ||= request_params_header
416
467
 
@@ -460,6 +511,21 @@ module Google
460
511
  #
461
512
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
462
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
+ #
463
529
  def delete_device_registry request, options = nil
464
530
  raise ::ArgumentError, "request must be provided" if request.nil?
465
531
 
@@ -477,9 +543,11 @@ module Google
477
543
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
478
544
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
479
545
 
480
- header_params = {
481
- "name" => request.name
482
- }
546
+ header_params = {}
547
+ if request.name
548
+ header_params["name"] = request.name
549
+ end
550
+
483
551
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
484
552
  metadata[:"x-goog-request-params"] ||= request_params_header
485
553
 
@@ -538,6 +606,27 @@ module Google
538
606
  #
539
607
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
540
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
+ #
541
630
  def list_device_registries request, options = nil
542
631
  raise ::ArgumentError, "request must be provided" if request.nil?
543
632
 
@@ -555,9 +644,11 @@ module Google
555
644
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
556
645
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
557
646
 
558
- header_params = {
559
- "parent" => request.parent
560
- }
647
+ header_params = {}
648
+ if request.parent
649
+ header_params["parent"] = request.parent
650
+ end
651
+
561
652
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
562
653
  metadata[:"x-goog-request-params"] ||= request_params_header
563
654
 
@@ -613,6 +704,21 @@ module Google
613
704
  #
614
705
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
615
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
+ #
616
722
  def create_device request, options = nil
617
723
  raise ::ArgumentError, "request must be provided" if request.nil?
618
724
 
@@ -630,9 +736,11 @@ module Google
630
736
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
631
737
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
632
738
 
633
- header_params = {
634
- "parent" => request.parent
635
- }
739
+ header_params = {}
740
+ if request.parent
741
+ header_params["parent"] = request.parent
742
+ end
743
+
636
744
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
637
745
  metadata[:"x-goog-request-params"] ||= request_params_header
638
746
 
@@ -687,6 +795,21 @@ module Google
687
795
  #
688
796
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
689
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
+ #
690
813
  def get_device request, options = nil
691
814
  raise ::ArgumentError, "request must be provided" if request.nil?
692
815
 
@@ -704,9 +827,11 @@ module Google
704
827
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
705
828
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
706
829
 
707
- header_params = {
708
- "name" => request.name
709
- }
830
+ header_params = {}
831
+ if request.name
832
+ header_params["name"] = request.name
833
+ end
834
+
710
835
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
711
836
  metadata[:"x-goog-request-params"] ||= request_params_header
712
837
 
@@ -763,6 +888,21 @@ module Google
763
888
  #
764
889
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
765
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
+ #
766
906
  def update_device request, options = nil
767
907
  raise ::ArgumentError, "request must be provided" if request.nil?
768
908
 
@@ -780,9 +920,11 @@ module Google
780
920
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
781
921
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
782
922
 
783
- header_params = {
784
- "device.name" => request.device.name
785
- }
923
+ header_params = {}
924
+ if request.device&.name
925
+ header_params["device.name"] = request.device.name
926
+ end
927
+
786
928
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
787
929
  metadata[:"x-goog-request-params"] ||= request_params_header
788
930
 
@@ -833,6 +975,21 @@ module Google
833
975
  #
834
976
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
835
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
+ #
836
993
  def delete_device request, options = nil
837
994
  raise ::ArgumentError, "request must be provided" if request.nil?
838
995
 
@@ -850,9 +1007,11 @@ module Google
850
1007
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
851
1008
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
852
1009
 
853
- header_params = {
854
- "name" => request.name
855
- }
1010
+ header_params = {}
1011
+ if request.name
1012
+ header_params["name"] = request.name
1013
+ end
1014
+
856
1015
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
857
1016
  metadata[:"x-goog-request-params"] ||= request_params_header
858
1017
 
@@ -924,6 +1083,27 @@ module Google
924
1083
  #
925
1084
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
926
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
+ #
927
1107
  def list_devices request, options = nil
928
1108
  raise ::ArgumentError, "request must be provided" if request.nil?
929
1109
 
@@ -941,9 +1121,11 @@ module Google
941
1121
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
942
1122
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
943
1123
 
944
- header_params = {
945
- "parent" => request.parent
946
- }
1124
+ header_params = {}
1125
+ if request.parent
1126
+ header_params["parent"] = request.parent
1127
+ end
1128
+
947
1129
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
948
1130
  metadata[:"x-goog-request-params"] ||= request_params_header
949
1131
 
@@ -1005,6 +1187,21 @@ module Google
1005
1187
  #
1006
1188
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1007
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
+ #
1008
1205
  def modify_cloud_to_device_config request, options = nil
1009
1206
  raise ::ArgumentError, "request must be provided" if request.nil?
1010
1207
 
@@ -1022,9 +1219,11 @@ module Google
1022
1219
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1023
1220
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1024
1221
 
1025
- header_params = {
1026
- "name" => request.name
1027
- }
1222
+ header_params = {}
1223
+ if request.name
1224
+ header_params["name"] = request.name
1225
+ end
1226
+
1028
1227
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1029
1228
  metadata[:"x-goog-request-params"] ||= request_params_header
1030
1229
 
@@ -1080,6 +1279,21 @@ module Google
1080
1279
  #
1081
1280
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1082
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
+ #
1083
1297
  def list_device_config_versions request, options = nil
1084
1298
  raise ::ArgumentError, "request must be provided" if request.nil?
1085
1299
 
@@ -1097,9 +1311,11 @@ module Google
1097
1311
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1098
1312
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1099
1313
 
1100
- header_params = {
1101
- "name" => request.name
1102
- }
1314
+ header_params = {}
1315
+ if request.name
1316
+ header_params["name"] = request.name
1317
+ end
1318
+
1103
1319
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1104
1320
  metadata[:"x-goog-request-params"] ||= request_params_header
1105
1321
 
@@ -1155,6 +1371,21 @@ module Google
1155
1371
  #
1156
1372
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1157
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
+ #
1158
1389
  def list_device_states request, options = nil
1159
1390
  raise ::ArgumentError, "request must be provided" if request.nil?
1160
1391
 
@@ -1172,9 +1403,11 @@ module Google
1172
1403
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1173
1404
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1174
1405
 
1175
- header_params = {
1176
- "name" => request.name
1177
- }
1406
+ header_params = {}
1407
+ if request.name
1408
+ header_params["name"] = request.name
1409
+ end
1410
+
1178
1411
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1179
1412
  metadata[:"x-goog-request-params"] ||= request_params_header
1180
1413
 
@@ -1208,7 +1441,7 @@ module Google
1208
1441
  # @param options [::Gapic::CallOptions, ::Hash]
1209
1442
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1210
1443
  #
1211
- # @overload set_iam_policy(resource: nil, policy: nil)
1444
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1212
1445
  # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1213
1446
  # least one keyword argument is required. To specify no parameters, or to keep all
1214
1447
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1221,6 +1454,12 @@ module Google
1221
1454
  # the policy is limited to a few 10s of KB. An empty policy is a
1222
1455
  # valid policy but certain Cloud Platform services (such as Projects)
1223
1456
  # might reject them.
1457
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1458
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1459
+ # the fields in the mask will be modified. If no mask is provided, the
1460
+ # following default mask is used:
1461
+ #
1462
+ # `paths: "bindings, etag"`
1224
1463
  #
1225
1464
  # @yield [response, operation] Access the result along with the RPC operation
1226
1465
  # @yieldparam response [::Google::Iam::V1::Policy]
@@ -1230,6 +1469,21 @@ module Google
1230
1469
  #
1231
1470
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1232
1471
  #
1472
+ # @example Basic example
1473
+ # require "google/cloud/iot/v1"
1474
+ #
1475
+ # # Create a client object. The client can be reused for multiple calls.
1476
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1477
+ #
1478
+ # # Create a request. To set request fields, pass in keyword arguments.
1479
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1480
+ #
1481
+ # # Call the set_iam_policy method.
1482
+ # result = client.set_iam_policy request
1483
+ #
1484
+ # # The returned object is of type Google::Iam::V1::Policy.
1485
+ # p result
1486
+ #
1233
1487
  def set_iam_policy request, options = nil
1234
1488
  raise ::ArgumentError, "request must be provided" if request.nil?
1235
1489
 
@@ -1247,9 +1501,11 @@ module Google
1247
1501
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1248
1502
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1249
1503
 
1250
- header_params = {
1251
- "resource" => request.resource
1252
- }
1504
+ header_params = {}
1505
+ if request.resource
1506
+ header_params["resource"] = request.resource
1507
+ end
1508
+
1253
1509
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1254
1510
  metadata[:"x-goog-request-params"] ||= request_params_header
1255
1511
 
@@ -1294,7 +1550,7 @@ module Google
1294
1550
  # See the operation documentation for the appropriate value for this field.
1295
1551
  # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1296
1552
  # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1297
- # `GetIamPolicy`. This field is only used by Cloud IAM.
1553
+ # `GetIamPolicy`.
1298
1554
  #
1299
1555
  # @yield [response, operation] Access the result along with the RPC operation
1300
1556
  # @yieldparam response [::Google::Iam::V1::Policy]
@@ -1304,6 +1560,21 @@ module Google
1304
1560
  #
1305
1561
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1306
1562
  #
1563
+ # @example Basic example
1564
+ # require "google/cloud/iot/v1"
1565
+ #
1566
+ # # Create a client object. The client can be reused for multiple calls.
1567
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1568
+ #
1569
+ # # Create a request. To set request fields, pass in keyword arguments.
1570
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1571
+ #
1572
+ # # Call the get_iam_policy method.
1573
+ # result = client.get_iam_policy request
1574
+ #
1575
+ # # The returned object is of type Google::Iam::V1::Policy.
1576
+ # p result
1577
+ #
1307
1578
  def get_iam_policy request, options = nil
1308
1579
  raise ::ArgumentError, "request must be provided" if request.nil?
1309
1580
 
@@ -1321,9 +1592,11 @@ module Google
1321
1592
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1322
1593
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1323
1594
 
1324
- header_params = {
1325
- "resource" => request.resource
1326
- }
1595
+ header_params = {}
1596
+ if request.resource
1597
+ header_params["resource"] = request.resource
1598
+ end
1599
+
1327
1600
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1328
1601
  metadata[:"x-goog-request-params"] ||= request_params_header
1329
1602
 
@@ -1380,6 +1653,21 @@ module Google
1380
1653
  #
1381
1654
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1382
1655
  #
1656
+ # @example Basic example
1657
+ # require "google/cloud/iot/v1"
1658
+ #
1659
+ # # Create a client object. The client can be reused for multiple calls.
1660
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1661
+ #
1662
+ # # Create a request. To set request fields, pass in keyword arguments.
1663
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1664
+ #
1665
+ # # Call the test_iam_permissions method.
1666
+ # result = client.test_iam_permissions request
1667
+ #
1668
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1669
+ # p result
1670
+ #
1383
1671
  def test_iam_permissions request, options = nil
1384
1672
  raise ::ArgumentError, "request must be provided" if request.nil?
1385
1673
 
@@ -1397,9 +1685,11 @@ module Google
1397
1685
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1398
1686
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1399
1687
 
1400
- header_params = {
1401
- "resource" => request.resource
1402
- }
1688
+ header_params = {}
1689
+ if request.resource
1690
+ header_params["resource"] = request.resource
1691
+ end
1692
+
1403
1693
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1404
1694
  metadata[:"x-goog-request-params"] ||= request_params_header
1405
1695
 
@@ -1470,6 +1760,21 @@ module Google
1470
1760
  #
1471
1761
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1472
1762
  #
1763
+ # @example Basic example
1764
+ # require "google/cloud/iot/v1"
1765
+ #
1766
+ # # Create a client object. The client can be reused for multiple calls.
1767
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1768
+ #
1769
+ # # Create a request. To set request fields, pass in keyword arguments.
1770
+ # request = Google::Cloud::Iot::V1::SendCommandToDeviceRequest.new
1771
+ #
1772
+ # # Call the send_command_to_device method.
1773
+ # result = client.send_command_to_device request
1774
+ #
1775
+ # # The returned object is of type Google::Cloud::Iot::V1::SendCommandToDeviceResponse.
1776
+ # p result
1777
+ #
1473
1778
  def send_command_to_device request, options = nil
1474
1779
  raise ::ArgumentError, "request must be provided" if request.nil?
1475
1780
 
@@ -1487,9 +1792,11 @@ module Google
1487
1792
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1488
1793
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1489
1794
 
1490
- header_params = {
1491
- "name" => request.name
1492
- }
1795
+ header_params = {}
1796
+ if request.name
1797
+ header_params["name"] = request.name
1798
+ end
1799
+
1493
1800
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1494
1801
  metadata[:"x-goog-request-params"] ||= request_params_header
1495
1802
 
@@ -1546,6 +1853,21 @@ module Google
1546
1853
  #
1547
1854
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1548
1855
  #
1856
+ # @example Basic example
1857
+ # require "google/cloud/iot/v1"
1858
+ #
1859
+ # # Create a client object. The client can be reused for multiple calls.
1860
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1861
+ #
1862
+ # # Create a request. To set request fields, pass in keyword arguments.
1863
+ # request = Google::Cloud::Iot::V1::BindDeviceToGatewayRequest.new
1864
+ #
1865
+ # # Call the bind_device_to_gateway method.
1866
+ # result = client.bind_device_to_gateway request
1867
+ #
1868
+ # # The returned object is of type Google::Cloud::Iot::V1::BindDeviceToGatewayResponse.
1869
+ # p result
1870
+ #
1549
1871
  def bind_device_to_gateway request, options = nil
1550
1872
  raise ::ArgumentError, "request must be provided" if request.nil?
1551
1873
 
@@ -1563,9 +1885,11 @@ module Google
1563
1885
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1564
1886
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1565
1887
 
1566
- header_params = {
1567
- "parent" => request.parent
1568
- }
1888
+ header_params = {}
1889
+ if request.parent
1890
+ header_params["parent"] = request.parent
1891
+ end
1892
+
1569
1893
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1570
1894
  metadata[:"x-goog-request-params"] ||= request_params_header
1571
1895
 
@@ -1622,6 +1946,21 @@ module Google
1622
1946
  #
1623
1947
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1624
1948
  #
1949
+ # @example Basic example
1950
+ # require "google/cloud/iot/v1"
1951
+ #
1952
+ # # Create a client object. The client can be reused for multiple calls.
1953
+ # client = Google::Cloud::Iot::V1::DeviceManager::Client.new
1954
+ #
1955
+ # # Create a request. To set request fields, pass in keyword arguments.
1956
+ # request = Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest.new
1957
+ #
1958
+ # # Call the unbind_device_from_gateway method.
1959
+ # result = client.unbind_device_from_gateway request
1960
+ #
1961
+ # # The returned object is of type Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse.
1962
+ # p result
1963
+ #
1625
1964
  def unbind_device_from_gateway request, options = nil
1626
1965
  raise ::ArgumentError, "request must be provided" if request.nil?
1627
1966
 
@@ -1639,9 +1978,11 @@ module Google
1639
1978
  gapic_version: ::Google::Cloud::Iot::V1::VERSION
1640
1979
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1641
1980
 
1642
- header_params = {
1643
- "parent" => request.parent
1644
- }
1981
+ header_params = {}
1982
+ if request.parent
1983
+ header_params["parent"] = request.parent
1984
+ end
1985
+
1645
1986
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1646
1987
  metadata[:"x-goog-request-params"] ||= request_params_header
1647
1988