google-cloud-logging-v2 0.5.2 → 0.5.6

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.
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Logging::V2::ConfigService::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 ConfigService clients:
47
- #
48
- # ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all ConfigService clients
47
+ # ::Google::Cloud::Logging::V2::ConfigService::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]
@@ -135,19 +134,15 @@ module Google
135
134
  ##
136
135
  # Create a new ConfigService client object.
137
136
  #
138
- # ## Examples
139
- #
140
- # To create a new ConfigService client with the default
141
- # configuration:
142
- #
143
- # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new
137
+ # @example
144
138
  #
145
- # To create a new ConfigService client with a custom
146
- # configuration:
139
+ # # Create a client using the default configuration
140
+ # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new
147
141
  #
148
- # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config|
149
- # config.timeout = 10.0
150
- # end
142
+ # # Create a client using a custom configuration
143
+ # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config|
144
+ # config.timeout = 10.0
145
+ # end
151
146
  #
152
147
  # @yield [config] Configure the ConfigService client.
153
148
  # @yieldparam config [Client::Configuration]
@@ -167,10 +162,9 @@ module Google
167
162
 
168
163
  # Create credentials
169
164
  credentials = @config.credentials
170
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
165
+ # Use self-signed JWT if the endpoint is unchanged from default,
171
166
  # but only if the default endpoint does not have a region prefix.
172
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
173
- @config.endpoint == Client.configure.endpoint &&
167
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
174
168
  !@config.endpoint.split(".").first.include?("-")
175
169
  credentials ||= Credentials.default scope: @config.scope,
176
170
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -238,6 +232,27 @@ module Google
238
232
  #
239
233
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
240
234
  #
235
+ # @example Basic example
236
+ # require "google/cloud/logging/v2"
237
+ #
238
+ # # Create a client object. The client can be reused for multiple calls.
239
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
240
+ #
241
+ # # Create a request. To set request fields, pass in keyword arguments.
242
+ # request = Google::Cloud::Logging::V2::ListBucketsRequest.new
243
+ #
244
+ # # Call the list_buckets method.
245
+ # result = client.list_buckets request
246
+ #
247
+ # # The returned object is of type Gapic::PagedEnumerable. You can
248
+ # # iterate over all elements by calling #each, and the enumerable
249
+ # # will lazily make API calls to fetch subsequent pages. Other
250
+ # # methods are also available for managing paging directly.
251
+ # result.each do |response|
252
+ # # Each element is of type ::Google::Cloud::Logging::V2::LogBucket.
253
+ # p response
254
+ # end
255
+ #
241
256
  def list_buckets request, options = nil
242
257
  raise ::ArgumentError, "request must be provided" if request.nil?
243
258
 
@@ -255,16 +270,20 @@ module Google
255
270
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
256
271
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
272
 
258
- header_params = {
259
- "parent" => request.parent
260
- }
273
+ header_params = {}
274
+ if request.parent
275
+ header_params["parent"] = request.parent
276
+ end
277
+
261
278
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
262
279
  metadata[:"x-goog-request-params"] ||= request_params_header
263
280
 
264
281
  options.apply_defaults timeout: @config.rpcs.list_buckets.timeout,
265
282
  metadata: metadata,
266
283
  retry_policy: @config.rpcs.list_buckets.retry_policy
267
- options.apply_defaults metadata: @config.metadata,
284
+
285
+ options.apply_defaults timeout: @config.timeout,
286
+ metadata: @config.metadata,
268
287
  retry_policy: @config.retry_policy
269
288
 
270
289
  @config_service_stub.call_rpc :list_buckets, request, options: options do |response, operation|
@@ -313,6 +332,21 @@ module Google
313
332
  #
314
333
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
315
334
  #
335
+ # @example Basic example
336
+ # require "google/cloud/logging/v2"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Cloud::Logging::V2::GetBucketRequest.new
343
+ #
344
+ # # Call the get_bucket method.
345
+ # result = client.get_bucket request
346
+ #
347
+ # # The returned object is of type Google::Cloud::Logging::V2::LogBucket.
348
+ # p result
349
+ #
316
350
  def get_bucket request, options = nil
317
351
  raise ::ArgumentError, "request must be provided" if request.nil?
318
352
 
@@ -330,16 +364,20 @@ module Google
330
364
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
331
365
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
332
366
 
333
- header_params = {
334
- "name" => request.name
335
- }
367
+ header_params = {}
368
+ if request.name
369
+ header_params["name"] = request.name
370
+ end
371
+
336
372
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
337
373
  metadata[:"x-goog-request-params"] ||= request_params_header
338
374
 
339
375
  options.apply_defaults timeout: @config.rpcs.get_bucket.timeout,
340
376
  metadata: metadata,
341
377
  retry_policy: @config.rpcs.get_bucket.retry_policy
342
- options.apply_defaults metadata: @config.metadata,
378
+
379
+ options.apply_defaults timeout: @config.timeout,
380
+ metadata: @config.metadata,
343
381
  retry_policy: @config.retry_policy
344
382
 
345
383
  @config_service_stub.call_rpc :get_bucket, request, options: options do |response, operation|
@@ -392,6 +430,21 @@ module Google
392
430
  #
393
431
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
394
432
  #
433
+ # @example Basic example
434
+ # require "google/cloud/logging/v2"
435
+ #
436
+ # # Create a client object. The client can be reused for multiple calls.
437
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
438
+ #
439
+ # # Create a request. To set request fields, pass in keyword arguments.
440
+ # request = Google::Cloud::Logging::V2::CreateBucketRequest.new
441
+ #
442
+ # # Call the create_bucket method.
443
+ # result = client.create_bucket request
444
+ #
445
+ # # The returned object is of type Google::Cloud::Logging::V2::LogBucket.
446
+ # p result
447
+ #
395
448
  def create_bucket request, options = nil
396
449
  raise ::ArgumentError, "request must be provided" if request.nil?
397
450
 
@@ -409,16 +462,20 @@ module Google
409
462
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
410
463
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
411
464
 
412
- header_params = {
413
- "parent" => request.parent
414
- }
465
+ header_params = {}
466
+ if request.parent
467
+ header_params["parent"] = request.parent
468
+ end
469
+
415
470
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
416
471
  metadata[:"x-goog-request-params"] ||= request_params_header
417
472
 
418
473
  options.apply_defaults timeout: @config.rpcs.create_bucket.timeout,
419
474
  metadata: metadata,
420
475
  retry_policy: @config.rpcs.create_bucket.retry_policy
421
- options.apply_defaults metadata: @config.metadata,
476
+
477
+ options.apply_defaults timeout: @config.timeout,
478
+ metadata: @config.metadata,
422
479
  retry_policy: @config.retry_policy
423
480
 
424
481
  @config_service_stub.call_rpc :create_bucket, request, options: options do |response, operation|
@@ -488,6 +545,21 @@ module Google
488
545
  #
489
546
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
490
547
  #
548
+ # @example Basic example
549
+ # require "google/cloud/logging/v2"
550
+ #
551
+ # # Create a client object. The client can be reused for multiple calls.
552
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
553
+ #
554
+ # # Create a request. To set request fields, pass in keyword arguments.
555
+ # request = Google::Cloud::Logging::V2::UpdateBucketRequest.new
556
+ #
557
+ # # Call the update_bucket method.
558
+ # result = client.update_bucket request
559
+ #
560
+ # # The returned object is of type Google::Cloud::Logging::V2::LogBucket.
561
+ # p result
562
+ #
491
563
  def update_bucket request, options = nil
492
564
  raise ::ArgumentError, "request must be provided" if request.nil?
493
565
 
@@ -505,16 +577,20 @@ module Google
505
577
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
506
578
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
507
579
 
508
- header_params = {
509
- "name" => request.name
510
- }
580
+ header_params = {}
581
+ if request.name
582
+ header_params["name"] = request.name
583
+ end
584
+
511
585
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
512
586
  metadata[:"x-goog-request-params"] ||= request_params_header
513
587
 
514
588
  options.apply_defaults timeout: @config.rpcs.update_bucket.timeout,
515
589
  metadata: metadata,
516
590
  retry_policy: @config.rpcs.update_bucket.retry_policy
517
- options.apply_defaults metadata: @config.metadata,
591
+
592
+ options.apply_defaults timeout: @config.timeout,
593
+ metadata: @config.metadata,
518
594
  retry_policy: @config.retry_policy
519
595
 
520
596
  @config_service_stub.call_rpc :update_bucket, request, options: options do |response, operation|
@@ -565,6 +641,21 @@ module Google
565
641
  #
566
642
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
567
643
  #
644
+ # @example Basic example
645
+ # require "google/cloud/logging/v2"
646
+ #
647
+ # # Create a client object. The client can be reused for multiple calls.
648
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
649
+ #
650
+ # # Create a request. To set request fields, pass in keyword arguments.
651
+ # request = Google::Cloud::Logging::V2::DeleteBucketRequest.new
652
+ #
653
+ # # Call the delete_bucket method.
654
+ # result = client.delete_bucket request
655
+ #
656
+ # # The returned object is of type Google::Protobuf::Empty.
657
+ # p result
658
+ #
568
659
  def delete_bucket request, options = nil
569
660
  raise ::ArgumentError, "request must be provided" if request.nil?
570
661
 
@@ -582,16 +673,20 @@ module Google
582
673
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
583
674
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
584
675
 
585
- header_params = {
586
- "name" => request.name
587
- }
676
+ header_params = {}
677
+ if request.name
678
+ header_params["name"] = request.name
679
+ end
680
+
588
681
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
589
682
  metadata[:"x-goog-request-params"] ||= request_params_header
590
683
 
591
684
  options.apply_defaults timeout: @config.rpcs.delete_bucket.timeout,
592
685
  metadata: metadata,
593
686
  retry_policy: @config.rpcs.delete_bucket.retry_policy
594
- options.apply_defaults metadata: @config.metadata,
687
+
688
+ options.apply_defaults timeout: @config.timeout,
689
+ metadata: @config.metadata,
595
690
  retry_policy: @config.retry_policy
596
691
 
597
692
  @config_service_stub.call_rpc :delete_bucket, request, options: options do |response, operation|
@@ -640,6 +735,21 @@ module Google
640
735
  #
641
736
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
642
737
  #
738
+ # @example Basic example
739
+ # require "google/cloud/logging/v2"
740
+ #
741
+ # # Create a client object. The client can be reused for multiple calls.
742
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
743
+ #
744
+ # # Create a request. To set request fields, pass in keyword arguments.
745
+ # request = Google::Cloud::Logging::V2::UndeleteBucketRequest.new
746
+ #
747
+ # # Call the undelete_bucket method.
748
+ # result = client.undelete_bucket request
749
+ #
750
+ # # The returned object is of type Google::Protobuf::Empty.
751
+ # p result
752
+ #
643
753
  def undelete_bucket request, options = nil
644
754
  raise ::ArgumentError, "request must be provided" if request.nil?
645
755
 
@@ -657,16 +767,20 @@ module Google
657
767
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
658
768
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
659
769
 
660
- header_params = {
661
- "name" => request.name
662
- }
770
+ header_params = {}
771
+ if request.name
772
+ header_params["name"] = request.name
773
+ end
774
+
663
775
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
664
776
  metadata[:"x-goog-request-params"] ||= request_params_header
665
777
 
666
778
  options.apply_defaults timeout: @config.rpcs.undelete_bucket.timeout,
667
779
  metadata: metadata,
668
780
  retry_policy: @config.rpcs.undelete_bucket.retry_policy
669
- options.apply_defaults metadata: @config.metadata,
781
+
782
+ options.apply_defaults timeout: @config.timeout,
783
+ metadata: @config.metadata,
670
784
  retry_policy: @config.retry_policy
671
785
 
672
786
  @config_service_stub.call_rpc :undelete_bucket, request, options: options do |response, operation|
@@ -717,6 +831,27 @@ module Google
717
831
  #
718
832
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
719
833
  #
834
+ # @example Basic example
835
+ # require "google/cloud/logging/v2"
836
+ #
837
+ # # Create a client object. The client can be reused for multiple calls.
838
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
839
+ #
840
+ # # Create a request. To set request fields, pass in keyword arguments.
841
+ # request = Google::Cloud::Logging::V2::ListViewsRequest.new
842
+ #
843
+ # # Call the list_views method.
844
+ # result = client.list_views request
845
+ #
846
+ # # The returned object is of type Gapic::PagedEnumerable. You can
847
+ # # iterate over all elements by calling #each, and the enumerable
848
+ # # will lazily make API calls to fetch subsequent pages. Other
849
+ # # methods are also available for managing paging directly.
850
+ # result.each do |response|
851
+ # # Each element is of type ::Google::Cloud::Logging::V2::LogView.
852
+ # p response
853
+ # end
854
+ #
720
855
  def list_views request, options = nil
721
856
  raise ::ArgumentError, "request must be provided" if request.nil?
722
857
 
@@ -734,16 +869,20 @@ module Google
734
869
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
735
870
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
736
871
 
737
- header_params = {
738
- "parent" => request.parent
739
- }
872
+ header_params = {}
873
+ if request.parent
874
+ header_params["parent"] = request.parent
875
+ end
876
+
740
877
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
741
878
  metadata[:"x-goog-request-params"] ||= request_params_header
742
879
 
743
880
  options.apply_defaults timeout: @config.rpcs.list_views.timeout,
744
881
  metadata: metadata,
745
882
  retry_policy: @config.rpcs.list_views.retry_policy
746
- options.apply_defaults metadata: @config.metadata,
883
+
884
+ options.apply_defaults timeout: @config.timeout,
885
+ metadata: @config.metadata,
747
886
  retry_policy: @config.retry_policy
748
887
 
749
888
  @config_service_stub.call_rpc :list_views, request, options: options do |response, operation|
@@ -789,6 +928,21 @@ module Google
789
928
  #
790
929
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
791
930
  #
931
+ # @example Basic example
932
+ # require "google/cloud/logging/v2"
933
+ #
934
+ # # Create a client object. The client can be reused for multiple calls.
935
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
936
+ #
937
+ # # Create a request. To set request fields, pass in keyword arguments.
938
+ # request = Google::Cloud::Logging::V2::GetViewRequest.new
939
+ #
940
+ # # Call the get_view method.
941
+ # result = client.get_view request
942
+ #
943
+ # # The returned object is of type Google::Cloud::Logging::V2::LogView.
944
+ # p result
945
+ #
792
946
  def get_view request, options = nil
793
947
  raise ::ArgumentError, "request must be provided" if request.nil?
794
948
 
@@ -806,16 +960,20 @@ module Google
806
960
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
807
961
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
808
962
 
809
- header_params = {
810
- "name" => request.name
811
- }
963
+ header_params = {}
964
+ if request.name
965
+ header_params["name"] = request.name
966
+ end
967
+
812
968
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
813
969
  metadata[:"x-goog-request-params"] ||= request_params_header
814
970
 
815
971
  options.apply_defaults timeout: @config.rpcs.get_view.timeout,
816
972
  metadata: metadata,
817
973
  retry_policy: @config.rpcs.get_view.retry_policy
818
- options.apply_defaults metadata: @config.metadata,
974
+
975
+ options.apply_defaults timeout: @config.timeout,
976
+ metadata: @config.metadata,
819
977
  retry_policy: @config.retry_policy
820
978
 
821
979
  @config_service_stub.call_rpc :get_view, request, options: options do |response, operation|
@@ -865,6 +1023,21 @@ module Google
865
1023
  #
866
1024
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
867
1025
  #
1026
+ # @example Basic example
1027
+ # require "google/cloud/logging/v2"
1028
+ #
1029
+ # # Create a client object. The client can be reused for multiple calls.
1030
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1031
+ #
1032
+ # # Create a request. To set request fields, pass in keyword arguments.
1033
+ # request = Google::Cloud::Logging::V2::CreateViewRequest.new
1034
+ #
1035
+ # # Call the create_view method.
1036
+ # result = client.create_view request
1037
+ #
1038
+ # # The returned object is of type Google::Cloud::Logging::V2::LogView.
1039
+ # p result
1040
+ #
868
1041
  def create_view request, options = nil
869
1042
  raise ::ArgumentError, "request must be provided" if request.nil?
870
1043
 
@@ -882,16 +1055,20 @@ module Google
882
1055
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
883
1056
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
884
1057
 
885
- header_params = {
886
- "parent" => request.parent
887
- }
1058
+ header_params = {}
1059
+ if request.parent
1060
+ header_params["parent"] = request.parent
1061
+ end
1062
+
888
1063
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
889
1064
  metadata[:"x-goog-request-params"] ||= request_params_header
890
1065
 
891
1066
  options.apply_defaults timeout: @config.rpcs.create_view.timeout,
892
1067
  metadata: metadata,
893
1068
  retry_policy: @config.rpcs.create_view.retry_policy
894
- options.apply_defaults metadata: @config.metadata,
1069
+
1070
+ options.apply_defaults timeout: @config.timeout,
1071
+ metadata: @config.metadata,
895
1072
  retry_policy: @config.retry_policy
896
1073
 
897
1074
  @config_service_stub.call_rpc :create_view, request, options: options do |response, operation|
@@ -948,6 +1125,21 @@ module Google
948
1125
  #
949
1126
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
950
1127
  #
1128
+ # @example Basic example
1129
+ # require "google/cloud/logging/v2"
1130
+ #
1131
+ # # Create a client object. The client can be reused for multiple calls.
1132
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1133
+ #
1134
+ # # Create a request. To set request fields, pass in keyword arguments.
1135
+ # request = Google::Cloud::Logging::V2::UpdateViewRequest.new
1136
+ #
1137
+ # # Call the update_view method.
1138
+ # result = client.update_view request
1139
+ #
1140
+ # # The returned object is of type Google::Cloud::Logging::V2::LogView.
1141
+ # p result
1142
+ #
951
1143
  def update_view request, options = nil
952
1144
  raise ::ArgumentError, "request must be provided" if request.nil?
953
1145
 
@@ -965,16 +1157,20 @@ module Google
965
1157
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
966
1158
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
967
1159
 
968
- header_params = {
969
- "name" => request.name
970
- }
1160
+ header_params = {}
1161
+ if request.name
1162
+ header_params["name"] = request.name
1163
+ end
1164
+
971
1165
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
972
1166
  metadata[:"x-goog-request-params"] ||= request_params_header
973
1167
 
974
1168
  options.apply_defaults timeout: @config.rpcs.update_view.timeout,
975
1169
  metadata: metadata,
976
1170
  retry_policy: @config.rpcs.update_view.retry_policy
977
- options.apply_defaults metadata: @config.metadata,
1171
+
1172
+ options.apply_defaults timeout: @config.timeout,
1173
+ metadata: @config.metadata,
978
1174
  retry_policy: @config.retry_policy
979
1175
 
980
1176
  @config_service_stub.call_rpc :update_view, request, options: options do |response, operation|
@@ -1019,6 +1215,21 @@ module Google
1019
1215
  #
1020
1216
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1021
1217
  #
1218
+ # @example Basic example
1219
+ # require "google/cloud/logging/v2"
1220
+ #
1221
+ # # Create a client object. The client can be reused for multiple calls.
1222
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1223
+ #
1224
+ # # Create a request. To set request fields, pass in keyword arguments.
1225
+ # request = Google::Cloud::Logging::V2::DeleteViewRequest.new
1226
+ #
1227
+ # # Call the delete_view method.
1228
+ # result = client.delete_view request
1229
+ #
1230
+ # # The returned object is of type Google::Protobuf::Empty.
1231
+ # p result
1232
+ #
1022
1233
  def delete_view request, options = nil
1023
1234
  raise ::ArgumentError, "request must be provided" if request.nil?
1024
1235
 
@@ -1036,16 +1247,20 @@ module Google
1036
1247
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1037
1248
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1038
1249
 
1039
- header_params = {
1040
- "name" => request.name
1041
- }
1250
+ header_params = {}
1251
+ if request.name
1252
+ header_params["name"] = request.name
1253
+ end
1254
+
1042
1255
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1043
1256
  metadata[:"x-goog-request-params"] ||= request_params_header
1044
1257
 
1045
1258
  options.apply_defaults timeout: @config.rpcs.delete_view.timeout,
1046
1259
  metadata: metadata,
1047
1260
  retry_policy: @config.rpcs.delete_view.retry_policy
1048
- options.apply_defaults metadata: @config.metadata,
1261
+
1262
+ options.apply_defaults timeout: @config.timeout,
1263
+ metadata: @config.metadata,
1049
1264
  retry_policy: @config.retry_policy
1050
1265
 
1051
1266
  @config_service_stub.call_rpc :delete_view, request, options: options do |response, operation|
@@ -1099,6 +1314,27 @@ module Google
1099
1314
  #
1100
1315
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1101
1316
  #
1317
+ # @example Basic example
1318
+ # require "google/cloud/logging/v2"
1319
+ #
1320
+ # # Create a client object. The client can be reused for multiple calls.
1321
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1322
+ #
1323
+ # # Create a request. To set request fields, pass in keyword arguments.
1324
+ # request = Google::Cloud::Logging::V2::ListSinksRequest.new
1325
+ #
1326
+ # # Call the list_sinks method.
1327
+ # result = client.list_sinks request
1328
+ #
1329
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1330
+ # # iterate over all elements by calling #each, and the enumerable
1331
+ # # will lazily make API calls to fetch subsequent pages. Other
1332
+ # # methods are also available for managing paging directly.
1333
+ # result.each do |response|
1334
+ # # Each element is of type ::Google::Cloud::Logging::V2::LogSink.
1335
+ # p response
1336
+ # end
1337
+ #
1102
1338
  def list_sinks request, options = nil
1103
1339
  raise ::ArgumentError, "request must be provided" if request.nil?
1104
1340
 
@@ -1116,16 +1352,20 @@ module Google
1116
1352
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1117
1353
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1118
1354
 
1119
- header_params = {
1120
- "parent" => request.parent
1121
- }
1355
+ header_params = {}
1356
+ if request.parent
1357
+ header_params["parent"] = request.parent
1358
+ end
1359
+
1122
1360
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1123
1361
  metadata[:"x-goog-request-params"] ||= request_params_header
1124
1362
 
1125
1363
  options.apply_defaults timeout: @config.rpcs.list_sinks.timeout,
1126
1364
  metadata: metadata,
1127
1365
  retry_policy: @config.rpcs.list_sinks.retry_policy
1128
- options.apply_defaults metadata: @config.metadata,
1366
+
1367
+ options.apply_defaults timeout: @config.timeout,
1368
+ metadata: @config.metadata,
1129
1369
  retry_policy: @config.retry_policy
1130
1370
 
1131
1371
  @config_service_stub.call_rpc :list_sinks, request, options: options do |response, operation|
@@ -1173,6 +1413,21 @@ module Google
1173
1413
  #
1174
1414
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1175
1415
  #
1416
+ # @example Basic example
1417
+ # require "google/cloud/logging/v2"
1418
+ #
1419
+ # # Create a client object. The client can be reused for multiple calls.
1420
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1421
+ #
1422
+ # # Create a request. To set request fields, pass in keyword arguments.
1423
+ # request = Google::Cloud::Logging::V2::GetSinkRequest.new
1424
+ #
1425
+ # # Call the get_sink method.
1426
+ # result = client.get_sink request
1427
+ #
1428
+ # # The returned object is of type Google::Cloud::Logging::V2::LogSink.
1429
+ # p result
1430
+ #
1176
1431
  def get_sink request, options = nil
1177
1432
  raise ::ArgumentError, "request must be provided" if request.nil?
1178
1433
 
@@ -1190,16 +1445,20 @@ module Google
1190
1445
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1191
1446
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1192
1447
 
1193
- header_params = {
1194
- "sink_name" => request.sink_name
1195
- }
1448
+ header_params = {}
1449
+ if request.sink_name
1450
+ header_params["sink_name"] = request.sink_name
1451
+ end
1452
+
1196
1453
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1197
1454
  metadata[:"x-goog-request-params"] ||= request_params_header
1198
1455
 
1199
1456
  options.apply_defaults timeout: @config.rpcs.get_sink.timeout,
1200
1457
  metadata: metadata,
1201
1458
  retry_policy: @config.rpcs.get_sink.retry_policy
1202
- options.apply_defaults metadata: @config.metadata,
1459
+
1460
+ options.apply_defaults timeout: @config.timeout,
1461
+ metadata: @config.metadata,
1203
1462
  retry_policy: @config.retry_policy
1204
1463
 
1205
1464
  @config_service_stub.call_rpc :get_sink, request, options: options do |response, operation|
@@ -1264,6 +1523,21 @@ module Google
1264
1523
  #
1265
1524
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1266
1525
  #
1526
+ # @example Basic example
1527
+ # require "google/cloud/logging/v2"
1528
+ #
1529
+ # # Create a client object. The client can be reused for multiple calls.
1530
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1531
+ #
1532
+ # # Create a request. To set request fields, pass in keyword arguments.
1533
+ # request = Google::Cloud::Logging::V2::CreateSinkRequest.new
1534
+ #
1535
+ # # Call the create_sink method.
1536
+ # result = client.create_sink request
1537
+ #
1538
+ # # The returned object is of type Google::Cloud::Logging::V2::LogSink.
1539
+ # p result
1540
+ #
1267
1541
  def create_sink request, options = nil
1268
1542
  raise ::ArgumentError, "request must be provided" if request.nil?
1269
1543
 
@@ -1281,16 +1555,20 @@ module Google
1281
1555
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1282
1556
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1283
1557
 
1284
- header_params = {
1285
- "parent" => request.parent
1286
- }
1558
+ header_params = {}
1559
+ if request.parent
1560
+ header_params["parent"] = request.parent
1561
+ end
1562
+
1287
1563
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1288
1564
  metadata[:"x-goog-request-params"] ||= request_params_header
1289
1565
 
1290
1566
  options.apply_defaults timeout: @config.rpcs.create_sink.timeout,
1291
1567
  metadata: metadata,
1292
1568
  retry_policy: @config.rpcs.create_sink.retry_policy
1293
- options.apply_defaults metadata: @config.metadata,
1569
+
1570
+ options.apply_defaults timeout: @config.timeout,
1571
+ metadata: @config.metadata,
1294
1572
  retry_policy: @config.retry_policy
1295
1573
 
1296
1574
  @config_service_stub.call_rpc :create_sink, request, options: options do |response, operation|
@@ -1372,6 +1650,21 @@ module Google
1372
1650
  #
1373
1651
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1374
1652
  #
1653
+ # @example Basic example
1654
+ # require "google/cloud/logging/v2"
1655
+ #
1656
+ # # Create a client object. The client can be reused for multiple calls.
1657
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1658
+ #
1659
+ # # Create a request. To set request fields, pass in keyword arguments.
1660
+ # request = Google::Cloud::Logging::V2::UpdateSinkRequest.new
1661
+ #
1662
+ # # Call the update_sink method.
1663
+ # result = client.update_sink request
1664
+ #
1665
+ # # The returned object is of type Google::Cloud::Logging::V2::LogSink.
1666
+ # p result
1667
+ #
1375
1668
  def update_sink request, options = nil
1376
1669
  raise ::ArgumentError, "request must be provided" if request.nil?
1377
1670
 
@@ -1389,16 +1682,20 @@ module Google
1389
1682
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1390
1683
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1391
1684
 
1392
- header_params = {
1393
- "sink_name" => request.sink_name
1394
- }
1685
+ header_params = {}
1686
+ if request.sink_name
1687
+ header_params["sink_name"] = request.sink_name
1688
+ end
1689
+
1395
1690
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1396
1691
  metadata[:"x-goog-request-params"] ||= request_params_header
1397
1692
 
1398
1693
  options.apply_defaults timeout: @config.rpcs.update_sink.timeout,
1399
1694
  metadata: metadata,
1400
1695
  retry_policy: @config.rpcs.update_sink.retry_policy
1401
- options.apply_defaults metadata: @config.metadata,
1696
+
1697
+ options.apply_defaults timeout: @config.timeout,
1698
+ metadata: @config.metadata,
1402
1699
  retry_policy: @config.retry_policy
1403
1700
 
1404
1701
  @config_service_stub.call_rpc :update_sink, request, options: options do |response, operation|
@@ -1447,6 +1744,21 @@ module Google
1447
1744
  #
1448
1745
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1449
1746
  #
1747
+ # @example Basic example
1748
+ # require "google/cloud/logging/v2"
1749
+ #
1750
+ # # Create a client object. The client can be reused for multiple calls.
1751
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1752
+ #
1753
+ # # Create a request. To set request fields, pass in keyword arguments.
1754
+ # request = Google::Cloud::Logging::V2::DeleteSinkRequest.new
1755
+ #
1756
+ # # Call the delete_sink method.
1757
+ # result = client.delete_sink request
1758
+ #
1759
+ # # The returned object is of type Google::Protobuf::Empty.
1760
+ # p result
1761
+ #
1450
1762
  def delete_sink request, options = nil
1451
1763
  raise ::ArgumentError, "request must be provided" if request.nil?
1452
1764
 
@@ -1464,16 +1776,20 @@ module Google
1464
1776
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1465
1777
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1466
1778
 
1467
- header_params = {
1468
- "sink_name" => request.sink_name
1469
- }
1779
+ header_params = {}
1780
+ if request.sink_name
1781
+ header_params["sink_name"] = request.sink_name
1782
+ end
1783
+
1470
1784
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1471
1785
  metadata[:"x-goog-request-params"] ||= request_params_header
1472
1786
 
1473
1787
  options.apply_defaults timeout: @config.rpcs.delete_sink.timeout,
1474
1788
  metadata: metadata,
1475
1789
  retry_policy: @config.rpcs.delete_sink.retry_policy
1476
- options.apply_defaults metadata: @config.metadata,
1790
+
1791
+ options.apply_defaults timeout: @config.timeout,
1792
+ metadata: @config.metadata,
1477
1793
  retry_policy: @config.retry_policy
1478
1794
 
1479
1795
  @config_service_stub.call_rpc :delete_sink, request, options: options do |response, operation|
@@ -1527,6 +1843,27 @@ module Google
1527
1843
  #
1528
1844
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1529
1845
  #
1846
+ # @example Basic example
1847
+ # require "google/cloud/logging/v2"
1848
+ #
1849
+ # # Create a client object. The client can be reused for multiple calls.
1850
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1851
+ #
1852
+ # # Create a request. To set request fields, pass in keyword arguments.
1853
+ # request = Google::Cloud::Logging::V2::ListExclusionsRequest.new
1854
+ #
1855
+ # # Call the list_exclusions method.
1856
+ # result = client.list_exclusions request
1857
+ #
1858
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1859
+ # # iterate over all elements by calling #each, and the enumerable
1860
+ # # will lazily make API calls to fetch subsequent pages. Other
1861
+ # # methods are also available for managing paging directly.
1862
+ # result.each do |response|
1863
+ # # Each element is of type ::Google::Cloud::Logging::V2::LogExclusion.
1864
+ # p response
1865
+ # end
1866
+ #
1530
1867
  def list_exclusions request, options = nil
1531
1868
  raise ::ArgumentError, "request must be provided" if request.nil?
1532
1869
 
@@ -1544,16 +1881,20 @@ module Google
1544
1881
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1545
1882
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1546
1883
 
1547
- header_params = {
1548
- "parent" => request.parent
1549
- }
1884
+ header_params = {}
1885
+ if request.parent
1886
+ header_params["parent"] = request.parent
1887
+ end
1888
+
1550
1889
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1551
1890
  metadata[:"x-goog-request-params"] ||= request_params_header
1552
1891
 
1553
1892
  options.apply_defaults timeout: @config.rpcs.list_exclusions.timeout,
1554
1893
  metadata: metadata,
1555
1894
  retry_policy: @config.rpcs.list_exclusions.retry_policy
1556
- options.apply_defaults metadata: @config.metadata,
1895
+
1896
+ options.apply_defaults timeout: @config.timeout,
1897
+ metadata: @config.metadata,
1557
1898
  retry_policy: @config.retry_policy
1558
1899
 
1559
1900
  @config_service_stub.call_rpc :list_exclusions, request, options: options do |response, operation|
@@ -1601,6 +1942,21 @@ module Google
1601
1942
  #
1602
1943
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1603
1944
  #
1945
+ # @example Basic example
1946
+ # require "google/cloud/logging/v2"
1947
+ #
1948
+ # # Create a client object. The client can be reused for multiple calls.
1949
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
1950
+ #
1951
+ # # Create a request. To set request fields, pass in keyword arguments.
1952
+ # request = Google::Cloud::Logging::V2::GetExclusionRequest.new
1953
+ #
1954
+ # # Call the get_exclusion method.
1955
+ # result = client.get_exclusion request
1956
+ #
1957
+ # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
1958
+ # p result
1959
+ #
1604
1960
  def get_exclusion request, options = nil
1605
1961
  raise ::ArgumentError, "request must be provided" if request.nil?
1606
1962
 
@@ -1618,16 +1974,20 @@ module Google
1618
1974
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1619
1975
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1620
1976
 
1621
- header_params = {
1622
- "name" => request.name
1623
- }
1977
+ header_params = {}
1978
+ if request.name
1979
+ header_params["name"] = request.name
1980
+ end
1981
+
1624
1982
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1625
1983
  metadata[:"x-goog-request-params"] ||= request_params_header
1626
1984
 
1627
1985
  options.apply_defaults timeout: @config.rpcs.get_exclusion.timeout,
1628
1986
  metadata: metadata,
1629
1987
  retry_policy: @config.rpcs.get_exclusion.retry_policy
1630
- options.apply_defaults metadata: @config.metadata,
1988
+
1989
+ options.apply_defaults timeout: @config.timeout,
1990
+ metadata: @config.metadata,
1631
1991
  retry_policy: @config.retry_policy
1632
1992
 
1633
1993
  @config_service_stub.call_rpc :get_exclusion, request, options: options do |response, operation|
@@ -1679,6 +2039,21 @@ module Google
1679
2039
  #
1680
2040
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1681
2041
  #
2042
+ # @example Basic example
2043
+ # require "google/cloud/logging/v2"
2044
+ #
2045
+ # # Create a client object. The client can be reused for multiple calls.
2046
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
2047
+ #
2048
+ # # Create a request. To set request fields, pass in keyword arguments.
2049
+ # request = Google::Cloud::Logging::V2::CreateExclusionRequest.new
2050
+ #
2051
+ # # Call the create_exclusion method.
2052
+ # result = client.create_exclusion request
2053
+ #
2054
+ # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
2055
+ # p result
2056
+ #
1682
2057
  def create_exclusion request, options = nil
1683
2058
  raise ::ArgumentError, "request must be provided" if request.nil?
1684
2059
 
@@ -1696,16 +2071,20 @@ module Google
1696
2071
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1697
2072
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1698
2073
 
1699
- header_params = {
1700
- "parent" => request.parent
1701
- }
2074
+ header_params = {}
2075
+ if request.parent
2076
+ header_params["parent"] = request.parent
2077
+ end
2078
+
1702
2079
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1703
2080
  metadata[:"x-goog-request-params"] ||= request_params_header
1704
2081
 
1705
2082
  options.apply_defaults timeout: @config.rpcs.create_exclusion.timeout,
1706
2083
  metadata: metadata,
1707
2084
  retry_policy: @config.rpcs.create_exclusion.retry_policy
1708
- options.apply_defaults metadata: @config.metadata,
2085
+
2086
+ options.apply_defaults timeout: @config.timeout,
2087
+ metadata: @config.metadata,
1709
2088
  retry_policy: @config.retry_policy
1710
2089
 
1711
2090
  @config_service_stub.call_rpc :create_exclusion, request, options: options do |response, operation|
@@ -1763,6 +2142,21 @@ module Google
1763
2142
  #
1764
2143
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1765
2144
  #
2145
+ # @example Basic example
2146
+ # require "google/cloud/logging/v2"
2147
+ #
2148
+ # # Create a client object. The client can be reused for multiple calls.
2149
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
2150
+ #
2151
+ # # Create a request. To set request fields, pass in keyword arguments.
2152
+ # request = Google::Cloud::Logging::V2::UpdateExclusionRequest.new
2153
+ #
2154
+ # # Call the update_exclusion method.
2155
+ # result = client.update_exclusion request
2156
+ #
2157
+ # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
2158
+ # p result
2159
+ #
1766
2160
  def update_exclusion request, options = nil
1767
2161
  raise ::ArgumentError, "request must be provided" if request.nil?
1768
2162
 
@@ -1780,16 +2174,20 @@ module Google
1780
2174
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1781
2175
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1782
2176
 
1783
- header_params = {
1784
- "name" => request.name
1785
- }
2177
+ header_params = {}
2178
+ if request.name
2179
+ header_params["name"] = request.name
2180
+ end
2181
+
1786
2182
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1787
2183
  metadata[:"x-goog-request-params"] ||= request_params_header
1788
2184
 
1789
2185
  options.apply_defaults timeout: @config.rpcs.update_exclusion.timeout,
1790
2186
  metadata: metadata,
1791
2187
  retry_policy: @config.rpcs.update_exclusion.retry_policy
1792
- options.apply_defaults metadata: @config.metadata,
2188
+
2189
+ options.apply_defaults timeout: @config.timeout,
2190
+ metadata: @config.metadata,
1793
2191
  retry_policy: @config.retry_policy
1794
2192
 
1795
2193
  @config_service_stub.call_rpc :update_exclusion, request, options: options do |response, operation|
@@ -1836,6 +2234,21 @@ module Google
1836
2234
  #
1837
2235
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1838
2236
  #
2237
+ # @example Basic example
2238
+ # require "google/cloud/logging/v2"
2239
+ #
2240
+ # # Create a client object. The client can be reused for multiple calls.
2241
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
2242
+ #
2243
+ # # Create a request. To set request fields, pass in keyword arguments.
2244
+ # request = Google::Cloud::Logging::V2::DeleteExclusionRequest.new
2245
+ #
2246
+ # # Call the delete_exclusion method.
2247
+ # result = client.delete_exclusion request
2248
+ #
2249
+ # # The returned object is of type Google::Protobuf::Empty.
2250
+ # p result
2251
+ #
1839
2252
  def delete_exclusion request, options = nil
1840
2253
  raise ::ArgumentError, "request must be provided" if request.nil?
1841
2254
 
@@ -1853,16 +2266,20 @@ module Google
1853
2266
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1854
2267
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1855
2268
 
1856
- header_params = {
1857
- "name" => request.name
1858
- }
2269
+ header_params = {}
2270
+ if request.name
2271
+ header_params["name"] = request.name
2272
+ end
2273
+
1859
2274
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1860
2275
  metadata[:"x-goog-request-params"] ||= request_params_header
1861
2276
 
1862
2277
  options.apply_defaults timeout: @config.rpcs.delete_exclusion.timeout,
1863
2278
  metadata: metadata,
1864
2279
  retry_policy: @config.rpcs.delete_exclusion.retry_policy
1865
- options.apply_defaults metadata: @config.metadata,
2280
+
2281
+ options.apply_defaults timeout: @config.timeout,
2282
+ metadata: @config.metadata,
1866
2283
  retry_policy: @config.retry_policy
1867
2284
 
1868
2285
  @config_service_stub.call_rpc :delete_exclusion, request, options: options do |response, operation|
@@ -1921,6 +2338,21 @@ module Google
1921
2338
  #
1922
2339
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1923
2340
  #
2341
+ # @example Basic example
2342
+ # require "google/cloud/logging/v2"
2343
+ #
2344
+ # # Create a client object. The client can be reused for multiple calls.
2345
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
2346
+ #
2347
+ # # Create a request. To set request fields, pass in keyword arguments.
2348
+ # request = Google::Cloud::Logging::V2::GetCmekSettingsRequest.new
2349
+ #
2350
+ # # Call the get_cmek_settings method.
2351
+ # result = client.get_cmek_settings request
2352
+ #
2353
+ # # The returned object is of type Google::Cloud::Logging::V2::CmekSettings.
2354
+ # p result
2355
+ #
1924
2356
  def get_cmek_settings request, options = nil
1925
2357
  raise ::ArgumentError, "request must be provided" if request.nil?
1926
2358
 
@@ -1938,16 +2370,20 @@ module Google
1938
2370
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
1939
2371
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1940
2372
 
1941
- header_params = {
1942
- "name" => request.name
1943
- }
2373
+ header_params = {}
2374
+ if request.name
2375
+ header_params["name"] = request.name
2376
+ end
2377
+
1944
2378
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1945
2379
  metadata[:"x-goog-request-params"] ||= request_params_header
1946
2380
 
1947
2381
  options.apply_defaults timeout: @config.rpcs.get_cmek_settings.timeout,
1948
2382
  metadata: metadata,
1949
2383
  retry_policy: @config.rpcs.get_cmek_settings.retry_policy
1950
- options.apply_defaults metadata: @config.metadata,
2384
+
2385
+ options.apply_defaults timeout: @config.timeout,
2386
+ metadata: @config.metadata,
1951
2387
  retry_policy: @config.retry_policy
1952
2388
 
1953
2389
  @config_service_stub.call_rpc :get_cmek_settings, request, options: options do |response, operation|
@@ -2026,6 +2462,21 @@ module Google
2026
2462
  #
2027
2463
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2028
2464
  #
2465
+ # @example Basic example
2466
+ # require "google/cloud/logging/v2"
2467
+ #
2468
+ # # Create a client object. The client can be reused for multiple calls.
2469
+ # client = Google::Cloud::Logging::V2::ConfigService::Client.new
2470
+ #
2471
+ # # Create a request. To set request fields, pass in keyword arguments.
2472
+ # request = Google::Cloud::Logging::V2::UpdateCmekSettingsRequest.new
2473
+ #
2474
+ # # Call the update_cmek_settings method.
2475
+ # result = client.update_cmek_settings request
2476
+ #
2477
+ # # The returned object is of type Google::Cloud::Logging::V2::CmekSettings.
2478
+ # p result
2479
+ #
2029
2480
  def update_cmek_settings request, options = nil
2030
2481
  raise ::ArgumentError, "request must be provided" if request.nil?
2031
2482
 
@@ -2043,16 +2494,20 @@ module Google
2043
2494
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
2044
2495
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2045
2496
 
2046
- header_params = {
2047
- "name" => request.name
2048
- }
2497
+ header_params = {}
2498
+ if request.name
2499
+ header_params["name"] = request.name
2500
+ end
2501
+
2049
2502
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2050
2503
  metadata[:"x-goog-request-params"] ||= request_params_header
2051
2504
 
2052
2505
  options.apply_defaults timeout: @config.rpcs.update_cmek_settings.timeout,
2053
2506
  metadata: metadata,
2054
2507
  retry_policy: @config.rpcs.update_cmek_settings.retry_policy
2055
- options.apply_defaults metadata: @config.metadata,
2508
+
2509
+ options.apply_defaults timeout: @config.timeout,
2510
+ metadata: @config.metadata,
2056
2511
  retry_policy: @config.retry_policy
2057
2512
 
2058
2513
  @config_service_stub.call_rpc :update_cmek_settings, request, options: options do |response, operation|
@@ -2076,22 +2531,21 @@ module Google
2076
2531
  # Configuration can be applied globally to all clients, or to a single client
2077
2532
  # on construction.
2078
2533
  #
2079
- # # Examples
2080
- #
2081
- # To modify the global config, setting the timeout for list_buckets
2082
- # to 20 seconds, and all remaining timeouts to 10 seconds:
2083
- #
2084
- # ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
2085
- # config.timeout = 10.0
2086
- # config.rpcs.list_buckets.timeout = 20.0
2087
- # end
2088
- #
2089
- # To apply the above configuration only to a new client:
2090
- #
2091
- # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config|
2092
- # config.timeout = 10.0
2093
- # config.rpcs.list_buckets.timeout = 20.0
2094
- # end
2534
+ # @example
2535
+ #
2536
+ # # Modify the global config, setting the timeout for
2537
+ # # list_buckets to 20 seconds,
2538
+ # # and all remaining timeouts to 10 seconds.
2539
+ # ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
2540
+ # config.timeout = 10.0
2541
+ # config.rpcs.list_buckets.timeout = 20.0
2542
+ # end
2543
+ #
2544
+ # # Apply the above configuration only to a new client.
2545
+ # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config|
2546
+ # config.timeout = 10.0
2547
+ # config.rpcs.list_buckets.timeout = 20.0
2548
+ # end
2095
2549
  #
2096
2550
  # @!attribute [rw] endpoint
2097
2551
  # The hostname or hostname:port of the service endpoint.