google-cloud-os_config-v1alpha 0.1.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,13 +44,12 @@ module Google
44
44
  # See {::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client::Configuration}
45
45
  # for a description of the configuration fields.
46
46
  #
47
- # ## Example
47
+ # @example
48
48
  #
49
- # To modify the configuration for all OsConfigZonalService clients:
50
- #
51
- # ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.configure do |config|
52
- # config.timeout = 10.0
53
- # end
49
+ # # Modify the configuration for all OsConfigZonalService clients
50
+ # ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
54
53
  #
55
54
  # @yield [config] Configure the Client client.
56
55
  # @yieldparam config [Client::Configuration]
@@ -102,19 +101,15 @@ module Google
102
101
  ##
103
102
  # Create a new OsConfigZonalService client object.
104
103
  #
105
- # ## Examples
106
- #
107
- # To create a new OsConfigZonalService client with the default
108
- # configuration:
104
+ # @example
109
105
  #
110
- # client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
106
+ # # Create a client using the default configuration
107
+ # client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
111
108
  #
112
- # To create a new OsConfigZonalService client with a custom
113
- # configuration:
114
- #
115
- # client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config|
116
- # config.timeout = 10.0
117
- # end
109
+ # # Create a client using a custom configuration
110
+ # client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config|
111
+ # config.timeout = 10.0
112
+ # end
118
113
  #
119
114
  # @yield [config] Configure the OsConfigZonalService client.
120
115
  # @yieldparam config [Client::Configuration]
@@ -134,10 +129,9 @@ module Google
134
129
 
135
130
  # Create credentials
136
131
  credentials = @config.credentials
137
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
132
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
133
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
- @config.endpoint == Client.configure.endpoint &&
134
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
135
  !@config.endpoint.split(".").first.include?("-")
142
136
  credentials ||= Credentials.default scope: @config.scope,
143
137
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -149,6 +143,7 @@ module Google
149
143
 
150
144
  @operations_client = Operations.new do |config|
151
145
  config.credentials = credentials
146
+ config.quota_project = @quota_project_id
152
147
  config.endpoint = @config.endpoint
153
148
  end
154
149
 
@@ -219,6 +214,28 @@ module Google
219
214
  #
220
215
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
221
216
  #
217
+ # @example Basic example
218
+ # require "google/cloud/os_config/v1alpha"
219
+ #
220
+ # # Create a client object. The client can be reused for multiple calls.
221
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
222
+ #
223
+ # # Create a request. To set request fields, pass in keyword arguments.
224
+ # request = Google::Cloud::OsConfig::V1alpha::CreateOSPolicyAssignmentRequest.new
225
+ #
226
+ # # Call the create_os_policy_assignment method.
227
+ # result = client.create_os_policy_assignment request
228
+ #
229
+ # # The returned object is of type Gapic::Operation. You can use this
230
+ # # object to check the status of an operation, cancel it, or wait
231
+ # # for results. Here is how to block until completion:
232
+ # result.wait_until_done! timeout: 60
233
+ # if result.response?
234
+ # p result.response
235
+ # else
236
+ # puts "Error!"
237
+ # end
238
+ #
222
239
  def create_os_policy_assignment request, options = nil
223
240
  raise ::ArgumentError, "request must be provided" if request.nil?
224
241
 
@@ -236,16 +253,20 @@ module Google
236
253
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
237
254
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
238
255
 
239
- header_params = {
240
- "parent" => request.parent
241
- }
256
+ header_params = {}
257
+ if request.parent
258
+ header_params["parent"] = request.parent
259
+ end
260
+
242
261
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
243
262
  metadata[:"x-goog-request-params"] ||= request_params_header
244
263
 
245
264
  options.apply_defaults timeout: @config.rpcs.create_os_policy_assignment.timeout,
246
265
  metadata: metadata,
247
266
  retry_policy: @config.rpcs.create_os_policy_assignment.retry_policy
248
- options.apply_defaults metadata: @config.metadata,
267
+
268
+ options.apply_defaults timeout: @config.timeout,
269
+ metadata: @config.metadata,
249
270
  retry_policy: @config.retry_policy
250
271
 
251
272
  @os_config_zonal_service_stub.call_rpc :create_os_policy_assignment, request, options: options do |response, operation|
@@ -296,6 +317,28 @@ module Google
296
317
  #
297
318
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
298
319
  #
320
+ # @example Basic example
321
+ # require "google/cloud/os_config/v1alpha"
322
+ #
323
+ # # Create a client object. The client can be reused for multiple calls.
324
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
325
+ #
326
+ # # Create a request. To set request fields, pass in keyword arguments.
327
+ # request = Google::Cloud::OsConfig::V1alpha::UpdateOSPolicyAssignmentRequest.new
328
+ #
329
+ # # Call the update_os_policy_assignment method.
330
+ # result = client.update_os_policy_assignment request
331
+ #
332
+ # # The returned object is of type Gapic::Operation. You can use this
333
+ # # object to check the status of an operation, cancel it, or wait
334
+ # # for results. Here is how to block until completion:
335
+ # result.wait_until_done! timeout: 60
336
+ # if result.response?
337
+ # p result.response
338
+ # else
339
+ # puts "Error!"
340
+ # end
341
+ #
299
342
  def update_os_policy_assignment request, options = nil
300
343
  raise ::ArgumentError, "request must be provided" if request.nil?
301
344
 
@@ -313,16 +356,20 @@ module Google
313
356
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
314
357
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
315
358
 
316
- header_params = {
317
- "os_policy_assignment.name" => request.os_policy_assignment.name
318
- }
359
+ header_params = {}
360
+ if request.os_policy_assignment&.name
361
+ header_params["os_policy_assignment.name"] = request.os_policy_assignment.name
362
+ end
363
+
319
364
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
320
365
  metadata[:"x-goog-request-params"] ||= request_params_header
321
366
 
322
367
  options.apply_defaults timeout: @config.rpcs.update_os_policy_assignment.timeout,
323
368
  metadata: metadata,
324
369
  retry_policy: @config.rpcs.update_os_policy_assignment.retry_policy
325
- options.apply_defaults metadata: @config.metadata,
370
+
371
+ options.apply_defaults timeout: @config.timeout,
372
+ metadata: @config.metadata,
326
373
  retry_policy: @config.retry_policy
327
374
 
328
375
  @os_config_zonal_service_stub.call_rpc :update_os_policy_assignment, request, options: options do |response, operation|
@@ -370,6 +417,21 @@ module Google
370
417
  #
371
418
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
372
419
  #
420
+ # @example Basic example
421
+ # require "google/cloud/os_config/v1alpha"
422
+ #
423
+ # # Create a client object. The client can be reused for multiple calls.
424
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
425
+ #
426
+ # # Create a request. To set request fields, pass in keyword arguments.
427
+ # request = Google::Cloud::OsConfig::V1alpha::GetOSPolicyAssignmentRequest.new
428
+ #
429
+ # # Call the get_os_policy_assignment method.
430
+ # result = client.get_os_policy_assignment request
431
+ #
432
+ # # The returned object is of type Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment.
433
+ # p result
434
+ #
373
435
  def get_os_policy_assignment request, options = nil
374
436
  raise ::ArgumentError, "request must be provided" if request.nil?
375
437
 
@@ -387,16 +449,20 @@ module Google
387
449
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
388
450
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
389
451
 
390
- header_params = {
391
- "name" => request.name
392
- }
452
+ header_params = {}
453
+ if request.name
454
+ header_params["name"] = request.name
455
+ end
456
+
393
457
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
394
458
  metadata[:"x-goog-request-params"] ||= request_params_header
395
459
 
396
460
  options.apply_defaults timeout: @config.rpcs.get_os_policy_assignment.timeout,
397
461
  metadata: metadata,
398
462
  retry_policy: @config.rpcs.get_os_policy_assignment.retry_policy
399
- options.apply_defaults metadata: @config.metadata,
463
+
464
+ options.apply_defaults timeout: @config.timeout,
465
+ metadata: @config.metadata,
400
466
  retry_policy: @config.retry_policy
401
467
 
402
468
  @os_config_zonal_service_stub.call_rpc :get_os_policy_assignment, request, options: options do |response, operation|
@@ -444,6 +510,27 @@ module Google
444
510
  #
445
511
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
512
  #
513
+ # @example Basic example
514
+ # require "google/cloud/os_config/v1alpha"
515
+ #
516
+ # # Create a client object. The client can be reused for multiple calls.
517
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
518
+ #
519
+ # # Create a request. To set request fields, pass in keyword arguments.
520
+ # request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentsRequest.new
521
+ #
522
+ # # Call the list_os_policy_assignments method.
523
+ # result = client.list_os_policy_assignments request
524
+ #
525
+ # # The returned object is of type Gapic::PagedEnumerable. You can
526
+ # # iterate over all elements by calling #each, and the enumerable
527
+ # # will lazily make API calls to fetch subsequent pages. Other
528
+ # # methods are also available for managing paging directly.
529
+ # result.each do |response|
530
+ # # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment.
531
+ # p response
532
+ # end
533
+ #
447
534
  def list_os_policy_assignments request, options = nil
448
535
  raise ::ArgumentError, "request must be provided" if request.nil?
449
536
 
@@ -461,16 +548,20 @@ module Google
461
548
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
462
549
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
463
550
 
464
- header_params = {
465
- "parent" => request.parent
466
- }
551
+ header_params = {}
552
+ if request.parent
553
+ header_params["parent"] = request.parent
554
+ end
555
+
467
556
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
468
557
  metadata[:"x-goog-request-params"] ||= request_params_header
469
558
 
470
559
  options.apply_defaults timeout: @config.rpcs.list_os_policy_assignments.timeout,
471
560
  metadata: metadata,
472
561
  retry_policy: @config.rpcs.list_os_policy_assignments.retry_policy
473
- options.apply_defaults metadata: @config.metadata,
562
+
563
+ options.apply_defaults timeout: @config.timeout,
564
+ metadata: @config.metadata,
474
565
  retry_policy: @config.retry_policy
475
566
 
476
567
  @os_config_zonal_service_stub.call_rpc :list_os_policy_assignments, request, options: options do |response, operation|
@@ -517,6 +608,27 @@ module Google
517
608
  #
518
609
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
519
610
  #
611
+ # @example Basic example
612
+ # require "google/cloud/os_config/v1alpha"
613
+ #
614
+ # # Create a client object. The client can be reused for multiple calls.
615
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
616
+ #
617
+ # # Create a request. To set request fields, pass in keyword arguments.
618
+ # request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentRevisionsRequest.new
619
+ #
620
+ # # Call the list_os_policy_assignment_revisions method.
621
+ # result = client.list_os_policy_assignment_revisions request
622
+ #
623
+ # # The returned object is of type Gapic::PagedEnumerable. You can
624
+ # # iterate over all elements by calling #each, and the enumerable
625
+ # # will lazily make API calls to fetch subsequent pages. Other
626
+ # # methods are also available for managing paging directly.
627
+ # result.each do |response|
628
+ # # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment.
629
+ # p response
630
+ # end
631
+ #
520
632
  def list_os_policy_assignment_revisions request, options = nil
521
633
  raise ::ArgumentError, "request must be provided" if request.nil?
522
634
 
@@ -534,16 +646,20 @@ module Google
534
646
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
535
647
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
536
648
 
537
- header_params = {
538
- "name" => request.name
539
- }
649
+ header_params = {}
650
+ if request.name
651
+ header_params["name"] = request.name
652
+ end
653
+
540
654
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
541
655
  metadata[:"x-goog-request-params"] ||= request_params_header
542
656
 
543
657
  options.apply_defaults timeout: @config.rpcs.list_os_policy_assignment_revisions.timeout,
544
658
  metadata: metadata,
545
659
  retry_policy: @config.rpcs.list_os_policy_assignment_revisions.retry_policy
546
- options.apply_defaults metadata: @config.metadata,
660
+
661
+ options.apply_defaults timeout: @config.timeout,
662
+ metadata: @config.metadata,
547
663
  retry_policy: @config.retry_policy
548
664
 
549
665
  @os_config_zonal_service_stub.call_rpc :list_os_policy_assignment_revisions, request, options: options do |response, operation|
@@ -595,6 +711,28 @@ module Google
595
711
  #
596
712
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
597
713
  #
714
+ # @example Basic example
715
+ # require "google/cloud/os_config/v1alpha"
716
+ #
717
+ # # Create a client object. The client can be reused for multiple calls.
718
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
719
+ #
720
+ # # Create a request. To set request fields, pass in keyword arguments.
721
+ # request = Google::Cloud::OsConfig::V1alpha::DeleteOSPolicyAssignmentRequest.new
722
+ #
723
+ # # Call the delete_os_policy_assignment method.
724
+ # result = client.delete_os_policy_assignment request
725
+ #
726
+ # # The returned object is of type Gapic::Operation. You can use this
727
+ # # object to check the status of an operation, cancel it, or wait
728
+ # # for results. Here is how to block until completion:
729
+ # result.wait_until_done! timeout: 60
730
+ # if result.response?
731
+ # p result.response
732
+ # else
733
+ # puts "Error!"
734
+ # end
735
+ #
598
736
  def delete_os_policy_assignment request, options = nil
599
737
  raise ::ArgumentError, "request must be provided" if request.nil?
600
738
 
@@ -612,16 +750,20 @@ module Google
612
750
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
613
751
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
614
752
 
615
- header_params = {
616
- "name" => request.name
617
- }
753
+ header_params = {}
754
+ if request.name
755
+ header_params["name"] = request.name
756
+ end
757
+
618
758
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
619
759
  metadata[:"x-goog-request-params"] ||= request_params_header
620
760
 
621
761
  options.apply_defaults timeout: @config.rpcs.delete_os_policy_assignment.timeout,
622
762
  metadata: metadata,
623
763
  retry_policy: @config.rpcs.delete_os_policy_assignment.retry_policy
624
- options.apply_defaults metadata: @config.metadata,
764
+
765
+ options.apply_defaults timeout: @config.timeout,
766
+ metadata: @config.metadata,
625
767
  retry_policy: @config.retry_policy
626
768
 
627
769
  @os_config_zonal_service_stub.call_rpc :delete_os_policy_assignment, request, options: options do |response, operation|
@@ -671,6 +813,21 @@ module Google
671
813
  #
672
814
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
673
815
  #
816
+ # @example Basic example
817
+ # require "google/cloud/os_config/v1alpha"
818
+ #
819
+ # # Create a client object. The client can be reused for multiple calls.
820
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
821
+ #
822
+ # # Create a request. To set request fields, pass in keyword arguments.
823
+ # request = Google::Cloud::OsConfig::V1alpha::GetInstanceOSPoliciesComplianceRequest.new
824
+ #
825
+ # # Call the get_instance_os_policies_compliance method.
826
+ # result = client.get_instance_os_policies_compliance request
827
+ #
828
+ # # The returned object is of type Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance.
829
+ # p result
830
+ #
674
831
  def get_instance_os_policies_compliance request, options = nil
675
832
  raise ::ArgumentError, "request must be provided" if request.nil?
676
833
 
@@ -688,16 +845,20 @@ module Google
688
845
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
689
846
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
690
847
 
691
- header_params = {
692
- "name" => request.name
693
- }
848
+ header_params = {}
849
+ if request.name
850
+ header_params["name"] = request.name
851
+ end
852
+
694
853
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
695
854
  metadata[:"x-goog-request-params"] ||= request_params_header
696
855
 
697
856
  options.apply_defaults timeout: @config.rpcs.get_instance_os_policies_compliance.timeout,
698
857
  metadata: metadata,
699
858
  retry_policy: @config.rpcs.get_instance_os_policies_compliance.retry_policy
700
- options.apply_defaults metadata: @config.metadata,
859
+
860
+ options.apply_defaults timeout: @config.timeout,
861
+ metadata: @config.metadata,
701
862
  retry_policy: @config.retry_policy
702
863
 
703
864
  @os_config_zonal_service_stub.call_rpc :get_instance_os_policies_compliance, request, options: options do |response, operation|
@@ -752,6 +913,27 @@ module Google
752
913
  #
753
914
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
754
915
  #
916
+ # @example Basic example
917
+ # require "google/cloud/os_config/v1alpha"
918
+ #
919
+ # # Create a client object. The client can be reused for multiple calls.
920
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
921
+ #
922
+ # # Create a request. To set request fields, pass in keyword arguments.
923
+ # request = Google::Cloud::OsConfig::V1alpha::ListInstanceOSPoliciesCompliancesRequest.new
924
+ #
925
+ # # Call the list_instance_os_policies_compliances method.
926
+ # result = client.list_instance_os_policies_compliances request
927
+ #
928
+ # # The returned object is of type Gapic::PagedEnumerable. You can
929
+ # # iterate over all elements by calling #each, and the enumerable
930
+ # # will lazily make API calls to fetch subsequent pages. Other
931
+ # # methods are also available for managing paging directly.
932
+ # result.each do |response|
933
+ # # Each element is of type ::Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance.
934
+ # p response
935
+ # end
936
+ #
755
937
  def list_instance_os_policies_compliances request, options = nil
756
938
  raise ::ArgumentError, "request must be provided" if request.nil?
757
939
 
@@ -769,16 +951,20 @@ module Google
769
951
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
770
952
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
771
953
 
772
- header_params = {
773
- "parent" => request.parent
774
- }
954
+ header_params = {}
955
+ if request.parent
956
+ header_params["parent"] = request.parent
957
+ end
958
+
775
959
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
776
960
  metadata[:"x-goog-request-params"] ||= request_params_header
777
961
 
778
962
  options.apply_defaults timeout: @config.rpcs.list_instance_os_policies_compliances.timeout,
779
963
  metadata: metadata,
780
964
  retry_policy: @config.rpcs.list_instance_os_policies_compliances.retry_policy
781
- options.apply_defaults metadata: @config.metadata,
965
+
966
+ options.apply_defaults timeout: @config.timeout,
967
+ metadata: @config.metadata,
782
968
  retry_policy: @config.retry_policy
783
969
 
784
970
  @os_config_zonal_service_stub.call_rpc :list_instance_os_policies_compliances, request, options: options do |response, operation|
@@ -830,6 +1016,21 @@ module Google
830
1016
  #
831
1017
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
832
1018
  #
1019
+ # @example Basic example
1020
+ # require "google/cloud/os_config/v1alpha"
1021
+ #
1022
+ # # Create a client object. The client can be reused for multiple calls.
1023
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
1024
+ #
1025
+ # # Create a request. To set request fields, pass in keyword arguments.
1026
+ # request = Google::Cloud::OsConfig::V1alpha::GetInventoryRequest.new
1027
+ #
1028
+ # # Call the get_inventory method.
1029
+ # result = client.get_inventory request
1030
+ #
1031
+ # # The returned object is of type Google::Cloud::OsConfig::V1alpha::Inventory.
1032
+ # p result
1033
+ #
833
1034
  def get_inventory request, options = nil
834
1035
  raise ::ArgumentError, "request must be provided" if request.nil?
835
1036
 
@@ -847,16 +1048,20 @@ module Google
847
1048
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
848
1049
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
849
1050
 
850
- header_params = {
851
- "name" => request.name
852
- }
1051
+ header_params = {}
1052
+ if request.name
1053
+ header_params["name"] = request.name
1054
+ end
1055
+
853
1056
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
854
1057
  metadata[:"x-goog-request-params"] ||= request_params_header
855
1058
 
856
1059
  options.apply_defaults timeout: @config.rpcs.get_inventory.timeout,
857
1060
  metadata: metadata,
858
1061
  retry_policy: @config.rpcs.get_inventory.retry_policy
859
- options.apply_defaults metadata: @config.metadata,
1062
+
1063
+ options.apply_defaults timeout: @config.timeout,
1064
+ metadata: @config.metadata,
860
1065
  retry_policy: @config.retry_policy
861
1066
 
862
1067
  @os_config_zonal_service_stub.call_rpc :get_inventory, request, options: options do |response, operation|
@@ -914,6 +1119,27 @@ module Google
914
1119
  #
915
1120
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
916
1121
  #
1122
+ # @example Basic example
1123
+ # require "google/cloud/os_config/v1alpha"
1124
+ #
1125
+ # # Create a client object. The client can be reused for multiple calls.
1126
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
1127
+ #
1128
+ # # Create a request. To set request fields, pass in keyword arguments.
1129
+ # request = Google::Cloud::OsConfig::V1alpha::ListInventoriesRequest.new
1130
+ #
1131
+ # # Call the list_inventories method.
1132
+ # result = client.list_inventories request
1133
+ #
1134
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1135
+ # # iterate over all elements by calling #each, and the enumerable
1136
+ # # will lazily make API calls to fetch subsequent pages. Other
1137
+ # # methods are also available for managing paging directly.
1138
+ # result.each do |response|
1139
+ # # Each element is of type ::Google::Cloud::OsConfig::V1alpha::Inventory.
1140
+ # p response
1141
+ # end
1142
+ #
917
1143
  def list_inventories request, options = nil
918
1144
  raise ::ArgumentError, "request must be provided" if request.nil?
919
1145
 
@@ -931,16 +1157,20 @@ module Google
931
1157
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
932
1158
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
933
1159
 
934
- header_params = {
935
- "parent" => request.parent
936
- }
1160
+ header_params = {}
1161
+ if request.parent
1162
+ header_params["parent"] = request.parent
1163
+ end
1164
+
937
1165
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
938
1166
  metadata[:"x-goog-request-params"] ||= request_params_header
939
1167
 
940
1168
  options.apply_defaults timeout: @config.rpcs.list_inventories.timeout,
941
1169
  metadata: metadata,
942
1170
  retry_policy: @config.rpcs.list_inventories.retry_policy
943
- options.apply_defaults metadata: @config.metadata,
1171
+
1172
+ options.apply_defaults timeout: @config.timeout,
1173
+ metadata: @config.metadata,
944
1174
  retry_policy: @config.retry_policy
945
1175
 
946
1176
  @os_config_zonal_service_stub.call_rpc :list_inventories, request, options: options do |response, operation|
@@ -989,6 +1219,21 @@ module Google
989
1219
  #
990
1220
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
991
1221
  #
1222
+ # @example Basic example
1223
+ # require "google/cloud/os_config/v1alpha"
1224
+ #
1225
+ # # Create a client object. The client can be reused for multiple calls.
1226
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
1227
+ #
1228
+ # # Create a request. To set request fields, pass in keyword arguments.
1229
+ # request = Google::Cloud::OsConfig::V1alpha::GetVulnerabilityReportRequest.new
1230
+ #
1231
+ # # Call the get_vulnerability_report method.
1232
+ # result = client.get_vulnerability_report request
1233
+ #
1234
+ # # The returned object is of type Google::Cloud::OsConfig::V1alpha::VulnerabilityReport.
1235
+ # p result
1236
+ #
992
1237
  def get_vulnerability_report request, options = nil
993
1238
  raise ::ArgumentError, "request must be provided" if request.nil?
994
1239
 
@@ -1006,16 +1251,20 @@ module Google
1006
1251
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
1007
1252
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1008
1253
 
1009
- header_params = {
1010
- "name" => request.name
1011
- }
1254
+ header_params = {}
1255
+ if request.name
1256
+ header_params["name"] = request.name
1257
+ end
1258
+
1012
1259
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1013
1260
  metadata[:"x-goog-request-params"] ||= request_params_header
1014
1261
 
1015
1262
  options.apply_defaults timeout: @config.rpcs.get_vulnerability_report.timeout,
1016
1263
  metadata: metadata,
1017
1264
  retry_policy: @config.rpcs.get_vulnerability_report.retry_policy
1018
- options.apply_defaults metadata: @config.metadata,
1265
+
1266
+ options.apply_defaults timeout: @config.timeout,
1267
+ metadata: @config.metadata,
1019
1268
  retry_policy: @config.retry_policy
1020
1269
 
1021
1270
  @os_config_zonal_service_stub.call_rpc :get_vulnerability_report, request, options: options do |response, operation|
@@ -1070,6 +1319,27 @@ module Google
1070
1319
  #
1071
1320
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1072
1321
  #
1322
+ # @example Basic example
1323
+ # require "google/cloud/os_config/v1alpha"
1324
+ #
1325
+ # # Create a client object. The client can be reused for multiple calls.
1326
+ # client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new
1327
+ #
1328
+ # # Create a request. To set request fields, pass in keyword arguments.
1329
+ # request = Google::Cloud::OsConfig::V1alpha::ListVulnerabilityReportsRequest.new
1330
+ #
1331
+ # # Call the list_vulnerability_reports method.
1332
+ # result = client.list_vulnerability_reports request
1333
+ #
1334
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1335
+ # # iterate over all elements by calling #each, and the enumerable
1336
+ # # will lazily make API calls to fetch subsequent pages. Other
1337
+ # # methods are also available for managing paging directly.
1338
+ # result.each do |response|
1339
+ # # Each element is of type ::Google::Cloud::OsConfig::V1alpha::VulnerabilityReport.
1340
+ # p response
1341
+ # end
1342
+ #
1073
1343
  def list_vulnerability_reports request, options = nil
1074
1344
  raise ::ArgumentError, "request must be provided" if request.nil?
1075
1345
 
@@ -1087,16 +1357,20 @@ module Google
1087
1357
  gapic_version: ::Google::Cloud::OsConfig::V1alpha::VERSION
1088
1358
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1089
1359
 
1090
- header_params = {
1091
- "parent" => request.parent
1092
- }
1360
+ header_params = {}
1361
+ if request.parent
1362
+ header_params["parent"] = request.parent
1363
+ end
1364
+
1093
1365
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1094
1366
  metadata[:"x-goog-request-params"] ||= request_params_header
1095
1367
 
1096
1368
  options.apply_defaults timeout: @config.rpcs.list_vulnerability_reports.timeout,
1097
1369
  metadata: metadata,
1098
1370
  retry_policy: @config.rpcs.list_vulnerability_reports.retry_policy
1099
- options.apply_defaults metadata: @config.metadata,
1371
+
1372
+ options.apply_defaults timeout: @config.timeout,
1373
+ metadata: @config.metadata,
1100
1374
  retry_policy: @config.retry_policy
1101
1375
 
1102
1376
  @os_config_zonal_service_stub.call_rpc :list_vulnerability_reports, request, options: options do |response, operation|
@@ -1121,22 +1395,21 @@ module Google
1121
1395
  # Configuration can be applied globally to all clients, or to a single client
1122
1396
  # on construction.
1123
1397
  #
1124
- # # Examples
1125
- #
1126
- # To modify the global config, setting the timeout for create_os_policy_assignment
1127
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1128
- #
1129
- # ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.configure do |config|
1130
- # config.timeout = 10.0
1131
- # config.rpcs.create_os_policy_assignment.timeout = 20.0
1132
- # end
1133
- #
1134
- # To apply the above configuration only to a new client:
1135
- #
1136
- # client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config|
1137
- # config.timeout = 10.0
1138
- # config.rpcs.create_os_policy_assignment.timeout = 20.0
1139
- # end
1398
+ # @example
1399
+ #
1400
+ # # Modify the global config, setting the timeout for
1401
+ # # create_os_policy_assignment to 20 seconds,
1402
+ # # and all remaining timeouts to 10 seconds.
1403
+ # ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.configure do |config|
1404
+ # config.timeout = 10.0
1405
+ # config.rpcs.create_os_policy_assignment.timeout = 20.0
1406
+ # end
1407
+ #
1408
+ # # Apply the above configuration only to a new client.
1409
+ # client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config|
1410
+ # config.timeout = 10.0
1411
+ # config.rpcs.create_os_policy_assignment.timeout = 20.0
1412
+ # end
1140
1413
  #
1141
1414
  # @!attribute [rw] endpoint
1142
1415
  # The hostname or hostname:port of the service endpoint.