google-cloud-monitoring-v3 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -234,6 +234,27 @@ module Google
234
234
  #
235
235
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
236
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
+ #
237
258
  def list_notification_channel_descriptors request, options = nil
238
259
  raise ::ArgumentError, "request must be provided" if request.nil?
239
260
 
@@ -251,9 +272,11 @@ module Google
251
272
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
252
273
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
253
274
 
254
- header_params = {
255
- "name" => request.name
256
- }
275
+ header_params = {}
276
+ if request.name
277
+ header_params["name"] = request.name
278
+ end
279
+
257
280
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
258
281
  metadata[:"x-goog-request-params"] ||= request_params_header
259
282
 
@@ -306,6 +329,21 @@ module Google
306
329
  #
307
330
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
308
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
+ #
309
347
  def get_notification_channel_descriptor request, options = nil
310
348
  raise ::ArgumentError, "request must be provided" if request.nil?
311
349
 
@@ -323,9 +361,11 @@ module Google
323
361
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
324
362
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
325
363
 
326
- header_params = {
327
- "name" => request.name
328
- }
364
+ header_params = {}
365
+ if request.name
366
+ header_params["name"] = request.name
367
+ end
368
+
329
369
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
330
370
  metadata[:"x-goog-request-params"] ||= request_params_header
331
371
 
@@ -405,6 +445,27 @@ module Google
405
445
  #
406
446
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
407
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
+ #
408
469
  def list_notification_channels request, options = nil
409
470
  raise ::ArgumentError, "request must be provided" if request.nil?
410
471
 
@@ -422,9 +483,11 @@ module Google
422
483
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
423
484
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
424
485
 
425
- header_params = {
426
- "name" => request.name
427
- }
486
+ header_params = {}
487
+ if request.name
488
+ header_params["name"] = request.name
489
+ end
490
+
428
491
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
429
492
  metadata[:"x-goog-request-params"] ||= request_params_header
430
493
 
@@ -480,6 +543,21 @@ module Google
480
543
  #
481
544
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
482
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
+ #
483
561
  def get_notification_channel request, options = nil
484
562
  raise ::ArgumentError, "request must be provided" if request.nil?
485
563
 
@@ -497,9 +575,11 @@ module Google
497
575
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
498
576
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
499
577
 
500
- header_params = {
501
- "name" => request.name
502
- }
578
+ header_params = {}
579
+ if request.name
580
+ header_params["name"] = request.name
581
+ end
582
+
503
583
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
504
584
  metadata[:"x-goog-request-params"] ||= request_params_header
505
585
 
@@ -559,6 +639,21 @@ module Google
559
639
  #
560
640
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
561
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
+ #
562
657
  def create_notification_channel request, options = nil
563
658
  raise ::ArgumentError, "request must be provided" if request.nil?
564
659
 
@@ -576,9 +671,11 @@ module Google
576
671
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
577
672
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
578
673
 
579
- header_params = {
580
- "name" => request.name
581
- }
674
+ header_params = {}
675
+ if request.name
676
+ header_params["name"] = request.name
677
+ end
678
+
582
679
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
583
680
  metadata[:"x-goog-request-params"] ||= request_params_header
584
681
 
@@ -633,6 +730,21 @@ module Google
633
730
  #
634
731
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
635
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
+ #
636
748
  def update_notification_channel request, options = nil
637
749
  raise ::ArgumentError, "request must be provided" if request.nil?
638
750
 
@@ -650,9 +762,11 @@ module Google
650
762
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
651
763
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
652
764
 
653
- header_params = {
654
- "notification_channel.name" => request.notification_channel.name
655
- }
765
+ header_params = {}
766
+ if request.notification_channel&.name
767
+ header_params["notification_channel.name"] = request.notification_channel.name
768
+ end
769
+
656
770
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
657
771
  metadata[:"x-goog-request-params"] ||= request_params_header
658
772
 
@@ -708,6 +822,21 @@ module Google
708
822
  #
709
823
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
710
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
+ #
711
840
  def delete_notification_channel request, options = nil
712
841
  raise ::ArgumentError, "request must be provided" if request.nil?
713
842
 
@@ -725,9 +854,11 @@ module Google
725
854
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
726
855
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
727
856
 
728
- header_params = {
729
- "name" => request.name
730
- }
857
+ header_params = {}
858
+ if request.name
859
+ header_params["name"] = request.name
860
+ end
861
+
731
862
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
732
863
  metadata[:"x-goog-request-params"] ||= request_params_header
733
864
 
@@ -777,6 +908,21 @@ module Google
777
908
  #
778
909
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
779
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
+ #
780
926
  def send_notification_channel_verification_code request, options = nil
781
927
  raise ::ArgumentError, "request must be provided" if request.nil?
782
928
 
@@ -794,9 +940,11 @@ module Google
794
940
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
795
941
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
796
942
 
797
- header_params = {
798
- "name" => request.name
799
- }
943
+ header_params = {}
944
+ if request.name
945
+ header_params["name"] = request.name
946
+ end
947
+
800
948
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
801
949
  metadata[:"x-goog-request-params"] ||= request_params_header
802
950
 
@@ -877,6 +1025,21 @@ module Google
877
1025
  #
878
1026
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
879
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
+ #
880
1043
  def get_notification_channel_verification_code request, options = nil
881
1044
  raise ::ArgumentError, "request must be provided" if request.nil?
882
1045
 
@@ -894,9 +1057,11 @@ module Google
894
1057
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
895
1058
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
896
1059
 
897
- header_params = {
898
- "name" => request.name
899
- }
1060
+ header_params = {}
1061
+ if request.name
1062
+ header_params["name"] = request.name
1063
+ end
1064
+
900
1065
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
901
1066
  metadata[:"x-goog-request-params"] ||= request_params_header
902
1067
 
@@ -955,6 +1120,21 @@ module Google
955
1120
  #
956
1121
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
957
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
+ #
958
1138
  def verify_notification_channel request, options = nil
959
1139
  raise ::ArgumentError, "request must be provided" if request.nil?
960
1140
 
@@ -972,9 +1152,11 @@ module Google
972
1152
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
973
1153
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
974
1154
 
975
- header_params = {
976
- "name" => request.name
977
- }
1155
+ header_params = {}
1156
+ if request.name
1157
+ header_params["name"] = request.name
1158
+ end
1159
+
978
1160
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
979
1161
  metadata[:"x-goog-request-params"] ||= request_params_header
980
1162
 
@@ -186,6 +186,27 @@ module Google
186
186
  #
187
187
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
188
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
+ #
189
210
  def query_time_series request, options = nil
190
211
  raise ::ArgumentError, "request must be provided" if request.nil?
191
212
 
@@ -203,9 +224,11 @@ module Google
203
224
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
204
225
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
205
226
 
206
- header_params = {
207
- "name" => request.name
208
- }
227
+ header_params = {}
228
+ if request.name
229
+ header_params["name"] = request.name
230
+ end
231
+
209
232
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
210
233
  metadata[:"x-goog-request-params"] ||= request_params_header
211
234