google-cloud-monitoring-v3 0.4.3 → 0.7.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/monitoring/v3/alert_policy_service/client.rb +113 -20
  3. data/lib/google/cloud/monitoring/v3/group_service/client.rb +142 -26
  4. data/lib/google/cloud/monitoring/v3/metric_service/client.rb +309 -38
  5. data/lib/google/cloud/monitoring/v3/notification_channel_service/client.rb +227 -41
  6. data/lib/google/cloud/monitoring/v3/query_service/client.rb +28 -4
  7. data/lib/google/cloud/monitoring/v3/service_monitoring_service/client.rb +222 -38
  8. data/lib/google/cloud/monitoring/v3/uptime_check_service/client.rb +135 -21
  9. data/lib/google/cloud/monitoring/v3/version.rb +1 -1
  10. data/lib/google/monitoring/v3/alert_pb.rb +18 -2
  11. data/lib/google/monitoring/v3/alert_service_pb.rb +2 -2
  12. data/lib/google/monitoring/v3/alert_service_services_pb.rb +1 -1
  13. data/lib/google/monitoring/v3/common_pb.rb +2 -2
  14. data/lib/google/monitoring/v3/group_pb.rb +1 -1
  15. data/lib/google/monitoring/v3/group_service_pb.rb +2 -2
  16. data/lib/google/monitoring/v3/group_service_services_pb.rb +1 -1
  17. data/lib/google/monitoring/v3/metric_pb.rb +2 -2
  18. data/lib/google/monitoring/v3/metric_service_pb.rb +2 -2
  19. data/lib/google/monitoring/v3/metric_service_services_pb.rb +13 -1
  20. data/lib/google/monitoring/v3/mutation_record_pb.rb +1 -1
  21. data/lib/google/monitoring/v3/notification_pb.rb +2 -2
  22. data/lib/google/monitoring/v3/notification_service_pb.rb +2 -2
  23. data/lib/google/monitoring/v3/notification_service_services_pb.rb +1 -1
  24. data/lib/google/monitoring/v3/query_service_pb.rb +2 -2
  25. data/lib/google/monitoring/v3/query_service_services_pb.rb +1 -1
  26. data/lib/google/monitoring/v3/service_pb.rb +5 -2
  27. data/lib/google/monitoring/v3/service_service_pb.rb +2 -2
  28. data/lib/google/monitoring/v3/service_service_services_pb.rb +1 -1
  29. data/lib/google/monitoring/v3/uptime_pb.rb +2 -2
  30. data/lib/google/monitoring/v3/uptime_service_pb.rb +3 -2
  31. data/lib/google/monitoring/v3/uptime_service_services_pb.rb +1 -1
  32. data/proto_docs/google/longrunning/operations.rb +164 -0
  33. data/proto_docs/google/monitoring/v3/alert.rb +72 -3
  34. data/proto_docs/google/monitoring/v3/alert_service.rb +4 -2
  35. data/proto_docs/google/monitoring/v3/common.rb +18 -6
  36. data/proto_docs/google/monitoring/v3/group_service.rb +4 -2
  37. data/proto_docs/google/monitoring/v3/metric.rb +3 -1
  38. data/proto_docs/google/monitoring/v3/metric_service.rb +13 -8
  39. data/proto_docs/google/monitoring/v3/notification_service.rb +8 -4
  40. data/proto_docs/google/monitoring/v3/service.rb +38 -6
  41. data/proto_docs/google/monitoring/v3/service_service.rb +4 -2
  42. data/proto_docs/google/monitoring/v3/span_context.rb +2 -2
  43. data/proto_docs/google/monitoring/v3/uptime.rb +5 -2
  44. data/proto_docs/google/monitoring/v3/uptime_service.rb +4 -2
  45. metadata +3 -2
@@ -67,22 +67,22 @@ module Google
67
67
 
68
68
  default_config.rpcs.list_notification_channel_descriptors.timeout = 30.0
69
69
  default_config.rpcs.list_notification_channel_descriptors.retry_policy = {
70
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
70
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
71
71
  }
72
72
 
73
73
  default_config.rpcs.get_notification_channel_descriptor.timeout = 30.0
74
74
  default_config.rpcs.get_notification_channel_descriptor.retry_policy = {
75
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
75
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
76
76
  }
77
77
 
78
78
  default_config.rpcs.list_notification_channels.timeout = 30.0
79
79
  default_config.rpcs.list_notification_channels.retry_policy = {
80
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
80
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
81
81
  }
82
82
 
83
83
  default_config.rpcs.get_notification_channel.timeout = 30.0
84
84
  default_config.rpcs.get_notification_channel.retry_policy = {
85
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
85
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
86
86
  }
87
87
 
88
88
  default_config.rpcs.create_notification_channel.timeout = 30.0
@@ -91,19 +91,19 @@ module Google
91
91
 
92
92
  default_config.rpcs.delete_notification_channel.timeout = 30.0
93
93
  default_config.rpcs.delete_notification_channel.retry_policy = {
94
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
94
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
95
95
  }
96
96
 
97
97
  default_config.rpcs.send_notification_channel_verification_code.timeout = 30.0
98
98
 
99
99
  default_config.rpcs.get_notification_channel_verification_code.timeout = 30.0
100
100
  default_config.rpcs.get_notification_channel_verification_code.retry_policy = {
101
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
101
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
102
102
  }
103
103
 
104
104
  default_config.rpcs.verify_notification_channel.timeout = 30.0
105
105
  default_config.rpcs.verify_notification_channel.retry_policy = {
106
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
106
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
107
107
  }
108
108
 
109
109
  default_config
@@ -211,8 +211,10 @@ module Google
211
211
  #
212
212
  # projects/[PROJECT_ID_OR_NUMBER]
213
213
  #
214
- # Note that this names the parent container in which to look for the
215
- # descriptors; to retrieve a single descriptor by name, use the
214
+ # Note that this
215
+ # [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent
216
+ # container in which to look for the descriptors; to retrieve a single
217
+ # descriptor by name, use the
216
218
  # {::Google::Cloud::Monitoring::V3::NotificationChannelService::Client#get_notification_channel_descriptor GetNotificationChannelDescriptor}
217
219
  # operation, instead.
218
220
  # @param page_size [::Integer]
@@ -232,6 +234,27 @@ module Google
232
234
  #
233
235
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
234
236
  #
237
+ # @example Basic example
238
+ # require "google/cloud/monitoring/v3"
239
+ #
240
+ # # Create a client object. The client can be reused for multiple calls.
241
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
242
+ #
243
+ # # Create a request. To set request fields, pass in keyword arguments.
244
+ # request = Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest.new
245
+ #
246
+ # # Call the list_notification_channel_descriptors method.
247
+ # result = client.list_notification_channel_descriptors request
248
+ #
249
+ # # The returned object is of type Gapic::PagedEnumerable. You can
250
+ # # iterate over all elements by calling #each, and the enumerable
251
+ # # will lazily make API calls to fetch subsequent pages. Other
252
+ # # methods are also available for managing paging directly.
253
+ # result.each do |response|
254
+ # # Each element is of type ::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor.
255
+ # p response
256
+ # end
257
+ #
235
258
  def list_notification_channel_descriptors request, options = nil
236
259
  raise ::ArgumentError, "request must be provided" if request.nil?
237
260
 
@@ -249,9 +272,11 @@ module Google
249
272
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
250
273
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
251
274
 
252
- header_params = {
253
- "name" => request.name
254
- }
275
+ header_params = {}
276
+ if request.name
277
+ header_params["name"] = request.name
278
+ end
279
+
255
280
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
256
281
  metadata[:"x-goog-request-params"] ||= request_params_header
257
282
 
@@ -304,6 +329,21 @@ module Google
304
329
  #
305
330
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
306
331
  #
332
+ # @example Basic example
333
+ # require "google/cloud/monitoring/v3"
334
+ #
335
+ # # Create a client object. The client can be reused for multiple calls.
336
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
337
+ #
338
+ # # Create a request. To set request fields, pass in keyword arguments.
339
+ # request = Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest.new
340
+ #
341
+ # # Call the get_notification_channel_descriptor method.
342
+ # result = client.get_notification_channel_descriptor request
343
+ #
344
+ # # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannelDescriptor.
345
+ # p result
346
+ #
307
347
  def get_notification_channel_descriptor request, options = nil
308
348
  raise ::ArgumentError, "request must be provided" if request.nil?
309
349
 
@@ -321,9 +361,11 @@ module Google
321
361
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
322
362
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
323
363
 
324
- header_params = {
325
- "name" => request.name
326
- }
364
+ header_params = {}
365
+ if request.name
366
+ header_params["name"] = request.name
367
+ end
368
+
327
369
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
328
370
  metadata[:"x-goog-request-params"] ||= request_params_header
329
371
 
@@ -362,7 +404,8 @@ module Google
362
404
  # the default parameter values, pass an empty Hash as a request object (see above).
363
405
  #
364
406
  # @param name [::String]
365
- # Required. The project on which to execute the request. The format is:
407
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
408
+ # which to execute the request. The format is:
366
409
  #
367
410
  # projects/[PROJECT_ID_OR_NUMBER]
368
411
  #
@@ -402,6 +445,27 @@ module Google
402
445
  #
403
446
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
404
447
  #
448
+ # @example Basic example
449
+ # require "google/cloud/monitoring/v3"
450
+ #
451
+ # # Create a client object. The client can be reused for multiple calls.
452
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
453
+ #
454
+ # # Create a request. To set request fields, pass in keyword arguments.
455
+ # request = Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest.new
456
+ #
457
+ # # Call the list_notification_channels method.
458
+ # result = client.list_notification_channels request
459
+ #
460
+ # # The returned object is of type Gapic::PagedEnumerable. You can
461
+ # # iterate over all elements by calling #each, and the enumerable
462
+ # # will lazily make API calls to fetch subsequent pages. Other
463
+ # # methods are also available for managing paging directly.
464
+ # result.each do |response|
465
+ # # Each element is of type ::Google::Cloud::Monitoring::V3::NotificationChannel.
466
+ # p response
467
+ # end
468
+ #
405
469
  def list_notification_channels request, options = nil
406
470
  raise ::ArgumentError, "request must be provided" if request.nil?
407
471
 
@@ -419,9 +483,11 @@ module Google
419
483
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
420
484
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
421
485
 
422
- header_params = {
423
- "name" => request.name
424
- }
486
+ header_params = {}
487
+ if request.name
488
+ header_params["name"] = request.name
489
+ end
490
+
425
491
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
426
492
  metadata[:"x-goog-request-params"] ||= request_params_header
427
493
 
@@ -477,6 +543,21 @@ module Google
477
543
  #
478
544
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
479
545
  #
546
+ # @example Basic example
547
+ # require "google/cloud/monitoring/v3"
548
+ #
549
+ # # Create a client object. The client can be reused for multiple calls.
550
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
551
+ #
552
+ # # Create a request. To set request fields, pass in keyword arguments.
553
+ # request = Google::Cloud::Monitoring::V3::GetNotificationChannelRequest.new
554
+ #
555
+ # # Call the get_notification_channel method.
556
+ # result = client.get_notification_channel request
557
+ #
558
+ # # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel.
559
+ # p result
560
+ #
480
561
  def get_notification_channel request, options = nil
481
562
  raise ::ArgumentError, "request must be provided" if request.nil?
482
563
 
@@ -494,9 +575,11 @@ module Google
494
575
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
495
576
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
496
577
 
497
- header_params = {
498
- "name" => request.name
499
- }
578
+ header_params = {}
579
+ if request.name
580
+ header_params["name"] = request.name
581
+ end
582
+
500
583
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
501
584
  metadata[:"x-goog-request-params"] ||= request_params_header
502
585
 
@@ -536,7 +619,8 @@ module Google
536
619
  # the default parameter values, pass an empty Hash as a request object (see above).
537
620
  #
538
621
  # @param name [::String]
539
- # Required. The project on which to execute the request. The format is:
622
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
623
+ # which to execute the request. The format is:
540
624
  #
541
625
  # projects/[PROJECT_ID_OR_NUMBER]
542
626
  #
@@ -555,6 +639,21 @@ module Google
555
639
  #
556
640
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
557
641
  #
642
+ # @example Basic example
643
+ # require "google/cloud/monitoring/v3"
644
+ #
645
+ # # Create a client object. The client can be reused for multiple calls.
646
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
647
+ #
648
+ # # Create a request. To set request fields, pass in keyword arguments.
649
+ # request = Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest.new
650
+ #
651
+ # # Call the create_notification_channel method.
652
+ # result = client.create_notification_channel request
653
+ #
654
+ # # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel.
655
+ # p result
656
+ #
558
657
  def create_notification_channel request, options = nil
559
658
  raise ::ArgumentError, "request must be provided" if request.nil?
560
659
 
@@ -572,9 +671,11 @@ module Google
572
671
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
573
672
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
574
673
 
575
- header_params = {
576
- "name" => request.name
577
- }
674
+ header_params = {}
675
+ if request.name
676
+ header_params["name"] = request.name
677
+ end
678
+
578
679
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
579
680
  metadata[:"x-goog-request-params"] ||= request_params_header
580
681
 
@@ -629,6 +730,21 @@ module Google
629
730
  #
630
731
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
631
732
  #
733
+ # @example Basic example
734
+ # require "google/cloud/monitoring/v3"
735
+ #
736
+ # # Create a client object. The client can be reused for multiple calls.
737
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
738
+ #
739
+ # # Create a request. To set request fields, pass in keyword arguments.
740
+ # request = Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest.new
741
+ #
742
+ # # Call the update_notification_channel method.
743
+ # result = client.update_notification_channel request
744
+ #
745
+ # # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel.
746
+ # p result
747
+ #
632
748
  def update_notification_channel request, options = nil
633
749
  raise ::ArgumentError, "request must be provided" if request.nil?
634
750
 
@@ -646,9 +762,11 @@ module Google
646
762
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
647
763
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
648
764
 
649
- header_params = {
650
- "notification_channel.name" => request.notification_channel.name
651
- }
765
+ header_params = {}
766
+ if request.notification_channel&.name
767
+ header_params["notification_channel.name"] = request.notification_channel.name
768
+ end
769
+
652
770
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
653
771
  metadata[:"x-goog-request-params"] ||= request_params_header
654
772
 
@@ -704,6 +822,21 @@ module Google
704
822
  #
705
823
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
706
824
  #
825
+ # @example Basic example
826
+ # require "google/cloud/monitoring/v3"
827
+ #
828
+ # # Create a client object. The client can be reused for multiple calls.
829
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
830
+ #
831
+ # # Create a request. To set request fields, pass in keyword arguments.
832
+ # request = Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest.new
833
+ #
834
+ # # Call the delete_notification_channel method.
835
+ # result = client.delete_notification_channel request
836
+ #
837
+ # # The returned object is of type Google::Protobuf::Empty.
838
+ # p result
839
+ #
707
840
  def delete_notification_channel request, options = nil
708
841
  raise ::ArgumentError, "request must be provided" if request.nil?
709
842
 
@@ -721,9 +854,11 @@ module Google
721
854
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
722
855
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
723
856
 
724
- header_params = {
725
- "name" => request.name
726
- }
857
+ header_params = {}
858
+ if request.name
859
+ header_params["name"] = request.name
860
+ end
861
+
727
862
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
728
863
  metadata[:"x-goog-request-params"] ||= request_params_header
729
864
 
@@ -773,6 +908,21 @@ module Google
773
908
  #
774
909
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
775
910
  #
911
+ # @example Basic example
912
+ # require "google/cloud/monitoring/v3"
913
+ #
914
+ # # Create a client object. The client can be reused for multiple calls.
915
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
916
+ #
917
+ # # Create a request. To set request fields, pass in keyword arguments.
918
+ # request = Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest.new
919
+ #
920
+ # # Call the send_notification_channel_verification_code method.
921
+ # result = client.send_notification_channel_verification_code request
922
+ #
923
+ # # The returned object is of type Google::Protobuf::Empty.
924
+ # p result
925
+ #
776
926
  def send_notification_channel_verification_code request, options = nil
777
927
  raise ::ArgumentError, "request must be provided" if request.nil?
778
928
 
@@ -790,9 +940,11 @@ module Google
790
940
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
791
941
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
792
942
 
793
- header_params = {
794
- "name" => request.name
795
- }
943
+ header_params = {}
944
+ if request.name
945
+ header_params["name"] = request.name
946
+ end
947
+
796
948
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
797
949
  metadata[:"x-goog-request-params"] ||= request_params_header
798
950
 
@@ -873,6 +1025,21 @@ module Google
873
1025
  #
874
1026
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
875
1027
  #
1028
+ # @example Basic example
1029
+ # require "google/cloud/monitoring/v3"
1030
+ #
1031
+ # # Create a client object. The client can be reused for multiple calls.
1032
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
1033
+ #
1034
+ # # Create a request. To set request fields, pass in keyword arguments.
1035
+ # request = Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest.new
1036
+ #
1037
+ # # Call the get_notification_channel_verification_code method.
1038
+ # result = client.get_notification_channel_verification_code request
1039
+ #
1040
+ # # The returned object is of type Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeResponse.
1041
+ # p result
1042
+ #
876
1043
  def get_notification_channel_verification_code request, options = nil
877
1044
  raise ::ArgumentError, "request must be provided" if request.nil?
878
1045
 
@@ -890,9 +1057,11 @@ module Google
890
1057
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
891
1058
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
892
1059
 
893
- header_params = {
894
- "name" => request.name
895
- }
1060
+ header_params = {}
1061
+ if request.name
1062
+ header_params["name"] = request.name
1063
+ end
1064
+
896
1065
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
897
1066
  metadata[:"x-goog-request-params"] ||= request_params_header
898
1067
 
@@ -951,6 +1120,21 @@ module Google
951
1120
  #
952
1121
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
953
1122
  #
1123
+ # @example Basic example
1124
+ # require "google/cloud/monitoring/v3"
1125
+ #
1126
+ # # Create a client object. The client can be reused for multiple calls.
1127
+ # client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
1128
+ #
1129
+ # # Create a request. To set request fields, pass in keyword arguments.
1130
+ # request = Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest.new
1131
+ #
1132
+ # # Call the verify_notification_channel method.
1133
+ # result = client.verify_notification_channel request
1134
+ #
1135
+ # # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel.
1136
+ # p result
1137
+ #
954
1138
  def verify_notification_channel request, options = nil
955
1139
  raise ::ArgumentError, "request must be provided" if request.nil?
956
1140
 
@@ -968,9 +1152,11 @@ module Google
968
1152
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
969
1153
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
970
1154
 
971
- header_params = {
972
- "name" => request.name
973
- }
1155
+ header_params = {}
1156
+ if request.name
1157
+ header_params["name"] = request.name
1158
+ end
1159
+
974
1160
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
975
1161
  metadata[:"x-goog-request-params"] ||= request_params_header
976
1162
 
@@ -163,7 +163,8 @@ module Google
163
163
  # the default parameter values, pass an empty Hash as a request object (see above).
164
164
  #
165
165
  # @param name [::String]
166
- # Required. The project on which to execute the request. The format is:
166
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
167
+ # which to execute the request. The format is:
167
168
  #
168
169
  # projects/[PROJECT_ID_OR_NUMBER]
169
170
  # @param query [::String]
@@ -185,6 +186,27 @@ module Google
185
186
  #
186
187
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
187
188
  #
189
+ # @example Basic example
190
+ # require "google/cloud/monitoring/v3"
191
+ #
192
+ # # Create a client object. The client can be reused for multiple calls.
193
+ # client = Google::Cloud::Monitoring::V3::QueryService::Client.new
194
+ #
195
+ # # Create a request. To set request fields, pass in keyword arguments.
196
+ # request = Google::Cloud::Monitoring::V3::QueryTimeSeriesRequest.new
197
+ #
198
+ # # Call the query_time_series method.
199
+ # result = client.query_time_series request
200
+ #
201
+ # # The returned object is of type Gapic::PagedEnumerable. You can
202
+ # # iterate over all elements by calling #each, and the enumerable
203
+ # # will lazily make API calls to fetch subsequent pages. Other
204
+ # # methods are also available for managing paging directly.
205
+ # result.each do |response|
206
+ # # Each element is of type ::Google::Cloud::Monitoring::V3::TimeSeriesData.
207
+ # p response
208
+ # end
209
+ #
188
210
  def query_time_series request, options = nil
189
211
  raise ::ArgumentError, "request must be provided" if request.nil?
190
212
 
@@ -202,9 +224,11 @@ module Google
202
224
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
203
225
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
204
226
 
205
- header_params = {
206
- "name" => request.name
207
- }
227
+ header_params = {}
228
+ if request.name
229
+ header_params["name"] = request.name
230
+ end
231
+
208
232
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
209
233
  metadata[:"x-goog-request-params"] ||= request_params_header
210
234