google-cloud-service_directory-v1beta1 0.7.0 → 0.7.4

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.
@@ -55,13 +55,12 @@ module Google
55
55
  # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client::Configuration}
56
56
  # for a description of the configuration fields.
57
57
  #
58
- # ## Example
58
+ # @example
59
59
  #
60
- # To modify the configuration for all RegistrationService clients:
61
- #
62
- # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config|
63
- # config.timeout = 10.0
64
- # end
60
+ # # Modify the configuration for all RegistrationService clients
61
+ # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config|
62
+ # config.timeout = 10.0
63
+ # end
65
64
  #
66
65
  # @yield [config] Configure the Client client.
67
66
  # @yieldparam config [Client::Configuration]
@@ -81,10 +80,7 @@ module Google
81
80
 
82
81
  default_config.timeout = 15.0
83
82
  default_config.retry_policy = {
84
- initial_delay: 1.0,
85
- max_delay: 60.0,
86
- multiplier: 1.3,
87
- retry_codes: [14, 2]
83
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2]
88
84
  }
89
85
 
90
86
  default_config
@@ -116,19 +112,15 @@ module Google
116
112
  ##
117
113
  # Create a new RegistrationService client object.
118
114
  #
119
- # ## Examples
120
- #
121
- # To create a new RegistrationService client with the default
122
- # configuration:
123
- #
124
- # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
115
+ # @example
125
116
  #
126
- # To create a new RegistrationService client with a custom
127
- # configuration:
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
128
119
  #
129
- # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config|
130
- # config.timeout = 10.0
131
- # end
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
132
124
  #
133
125
  # @yield [config] Configure the RegistrationService client.
134
126
  # @yieldparam config [Client::Configuration]
@@ -148,14 +140,13 @@ module Google
148
140
 
149
141
  # Create credentials
150
142
  credentials = @config.credentials
151
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
152
144
  # but only if the default endpoint does not have a region prefix.
153
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
154
- @config.endpoint == Client.configure.endpoint &&
145
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
155
146
  !@config.endpoint.split(".").first.include?("-")
156
147
  credentials ||= Credentials.default scope: @config.scope,
157
148
  enable_self_signed_jwt: enable_self_signed_jwt
158
- if credentials.is_a?(String) || credentials.is_a?(Hash)
149
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
159
150
  credentials = Credentials.new credentials, scope: @config.scope
160
151
  end
161
152
  @quota_project_id = @config.quota_project
@@ -212,6 +203,21 @@ module Google
212
203
  #
213
204
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
214
205
  #
206
+ # @example Basic example
207
+ # require "google/cloud/service_directory/v1beta1"
208
+ #
209
+ # # Create a client object. The client can be reused for multiple calls.
210
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
211
+ #
212
+ # # Create a request. To set request fields, pass in keyword arguments.
213
+ # request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new
214
+ #
215
+ # # Call the create_namespace method.
216
+ # result = client.create_namespace request
217
+ #
218
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace.
219
+ # p result
220
+ #
215
221
  def create_namespace request, options = nil
216
222
  raise ::ArgumentError, "request must be provided" if request.nil?
217
223
 
@@ -229,16 +235,20 @@ module Google
229
235
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
230
236
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
237
 
232
- header_params = {
233
- "parent" => request.parent
234
- }
238
+ header_params = {}
239
+ if request.parent
240
+ header_params["parent"] = request.parent
241
+ end
242
+
235
243
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
236
244
  metadata[:"x-goog-request-params"] ||= request_params_header
237
245
 
238
246
  options.apply_defaults timeout: @config.rpcs.create_namespace.timeout,
239
247
  metadata: metadata,
240
248
  retry_policy: @config.rpcs.create_namespace.retry_policy
241
- options.apply_defaults metadata: @config.metadata,
249
+
250
+ options.apply_defaults timeout: @config.timeout,
251
+ metadata: @config.metadata,
242
252
  retry_policy: @config.retry_policy
243
253
 
244
254
  @registration_service_stub.call_rpc :create_namespace, request, options: options do |response, operation|
@@ -322,6 +332,27 @@ module Google
322
332
  #
323
333
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
324
334
  #
335
+ # @example Basic example
336
+ # require "google/cloud/service_directory/v1beta1"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new
343
+ #
344
+ # # Call the list_namespaces method.
345
+ # result = client.list_namespaces request
346
+ #
347
+ # # The returned object is of type Gapic::PagedEnumerable. You can
348
+ # # iterate over all elements by calling #each, and the enumerable
349
+ # # will lazily make API calls to fetch subsequent pages. Other
350
+ # # methods are also available for managing paging directly.
351
+ # result.each do |response|
352
+ # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.
353
+ # p response
354
+ # end
355
+ #
325
356
  def list_namespaces request, options = nil
326
357
  raise ::ArgumentError, "request must be provided" if request.nil?
327
358
 
@@ -339,16 +370,20 @@ module Google
339
370
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
340
371
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
341
372
 
342
- header_params = {
343
- "parent" => request.parent
344
- }
373
+ header_params = {}
374
+ if request.parent
375
+ header_params["parent"] = request.parent
376
+ end
377
+
345
378
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
346
379
  metadata[:"x-goog-request-params"] ||= request_params_header
347
380
 
348
381
  options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout,
349
382
  metadata: metadata,
350
383
  retry_policy: @config.rpcs.list_namespaces.retry_policy
351
- options.apply_defaults metadata: @config.metadata,
384
+
385
+ options.apply_defaults timeout: @config.timeout,
386
+ metadata: @config.metadata,
352
387
  retry_policy: @config.retry_policy
353
388
 
354
389
  @registration_service_stub.call_rpc :list_namespaces, request, options: options do |response, operation|
@@ -389,6 +424,21 @@ module Google
389
424
  #
390
425
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
391
426
  #
427
+ # @example Basic example
428
+ # require "google/cloud/service_directory/v1beta1"
429
+ #
430
+ # # Create a client object. The client can be reused for multiple calls.
431
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
432
+ #
433
+ # # Create a request. To set request fields, pass in keyword arguments.
434
+ # request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new
435
+ #
436
+ # # Call the get_namespace method.
437
+ # result = client.get_namespace request
438
+ #
439
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace.
440
+ # p result
441
+ #
392
442
  def get_namespace request, options = nil
393
443
  raise ::ArgumentError, "request must be provided" if request.nil?
394
444
 
@@ -406,16 +456,20 @@ module Google
406
456
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
407
457
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
408
458
 
409
- header_params = {
410
- "name" => request.name
411
- }
459
+ header_params = {}
460
+ if request.name
461
+ header_params["name"] = request.name
462
+ end
463
+
412
464
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
413
465
  metadata[:"x-goog-request-params"] ||= request_params_header
414
466
 
415
467
  options.apply_defaults timeout: @config.rpcs.get_namespace.timeout,
416
468
  metadata: metadata,
417
469
  retry_policy: @config.rpcs.get_namespace.retry_policy
418
- options.apply_defaults metadata: @config.metadata,
470
+
471
+ options.apply_defaults timeout: @config.timeout,
472
+ metadata: @config.metadata,
419
473
  retry_policy: @config.retry_policy
420
474
 
421
475
  @registration_service_stub.call_rpc :get_namespace, request, options: options do |response, operation|
@@ -457,6 +511,21 @@ module Google
457
511
  #
458
512
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
459
513
  #
514
+ # @example Basic example
515
+ # require "google/cloud/service_directory/v1beta1"
516
+ #
517
+ # # Create a client object. The client can be reused for multiple calls.
518
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
519
+ #
520
+ # # Create a request. To set request fields, pass in keyword arguments.
521
+ # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new
522
+ #
523
+ # # Call the update_namespace method.
524
+ # result = client.update_namespace request
525
+ #
526
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace.
527
+ # p result
528
+ #
460
529
  def update_namespace request, options = nil
461
530
  raise ::ArgumentError, "request must be provided" if request.nil?
462
531
 
@@ -474,16 +543,20 @@ module Google
474
543
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
475
544
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
476
545
 
477
- header_params = {
478
- "namespace.name" => request.namespace.name
479
- }
546
+ header_params = {}
547
+ if request.namespace&.name
548
+ header_params["namespace.name"] = request.namespace.name
549
+ end
550
+
480
551
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
481
552
  metadata[:"x-goog-request-params"] ||= request_params_header
482
553
 
483
554
  options.apply_defaults timeout: @config.rpcs.update_namespace.timeout,
484
555
  metadata: metadata,
485
556
  retry_policy: @config.rpcs.update_namespace.retry_policy
486
- options.apply_defaults metadata: @config.metadata,
557
+
558
+ options.apply_defaults timeout: @config.timeout,
559
+ metadata: @config.metadata,
487
560
  retry_policy: @config.retry_policy
488
561
 
489
562
  @registration_service_stub.call_rpc :update_namespace, request, options: options do |response, operation|
@@ -524,6 +597,21 @@ module Google
524
597
  #
525
598
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
526
599
  #
600
+ # @example Basic example
601
+ # require "google/cloud/service_directory/v1beta1"
602
+ #
603
+ # # Create a client object. The client can be reused for multiple calls.
604
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
605
+ #
606
+ # # Create a request. To set request fields, pass in keyword arguments.
607
+ # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new
608
+ #
609
+ # # Call the delete_namespace method.
610
+ # result = client.delete_namespace request
611
+ #
612
+ # # The returned object is of type Google::Protobuf::Empty.
613
+ # p result
614
+ #
527
615
  def delete_namespace request, options = nil
528
616
  raise ::ArgumentError, "request must be provided" if request.nil?
529
617
 
@@ -541,16 +629,20 @@ module Google
541
629
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
542
630
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
543
631
 
544
- header_params = {
545
- "name" => request.name
546
- }
632
+ header_params = {}
633
+ if request.name
634
+ header_params["name"] = request.name
635
+ end
636
+
547
637
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
548
638
  metadata[:"x-goog-request-params"] ||= request_params_header
549
639
 
550
640
  options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout,
551
641
  metadata: metadata,
552
642
  retry_policy: @config.rpcs.delete_namespace.retry_policy
553
- options.apply_defaults metadata: @config.metadata,
643
+
644
+ options.apply_defaults timeout: @config.timeout,
645
+ metadata: @config.metadata,
554
646
  retry_policy: @config.retry_policy
555
647
 
556
648
  @registration_service_stub.call_rpc :delete_namespace, request, options: options do |response, operation|
@@ -600,6 +692,21 @@ module Google
600
692
  #
601
693
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
602
694
  #
695
+ # @example Basic example
696
+ # require "google/cloud/service_directory/v1beta1"
697
+ #
698
+ # # Create a client object. The client can be reused for multiple calls.
699
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
700
+ #
701
+ # # Create a request. To set request fields, pass in keyword arguments.
702
+ # request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new
703
+ #
704
+ # # Call the create_service method.
705
+ # result = client.create_service request
706
+ #
707
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service.
708
+ # p result
709
+ #
603
710
  def create_service request, options = nil
604
711
  raise ::ArgumentError, "request must be provided" if request.nil?
605
712
 
@@ -617,16 +724,20 @@ module Google
617
724
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
618
725
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
619
726
 
620
- header_params = {
621
- "parent" => request.parent
622
- }
727
+ header_params = {}
728
+ if request.parent
729
+ header_params["parent"] = request.parent
730
+ end
731
+
623
732
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
624
733
  metadata[:"x-goog-request-params"] ||= request_params_header
625
734
 
626
735
  options.apply_defaults timeout: @config.rpcs.create_service.timeout,
627
736
  metadata: metadata,
628
737
  retry_policy: @config.rpcs.create_service.retry_policy
629
- options.apply_defaults metadata: @config.metadata,
738
+
739
+ options.apply_defaults timeout: @config.timeout,
740
+ metadata: @config.metadata,
630
741
  retry_policy: @config.retry_policy
631
742
 
632
743
  @registration_service_stub.call_rpc :create_service, request, options: options do |response, operation|
@@ -714,6 +825,27 @@ module Google
714
825
  #
715
826
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
716
827
  #
828
+ # @example Basic example
829
+ # require "google/cloud/service_directory/v1beta1"
830
+ #
831
+ # # Create a client object. The client can be reused for multiple calls.
832
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
833
+ #
834
+ # # Create a request. To set request fields, pass in keyword arguments.
835
+ # request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new
836
+ #
837
+ # # Call the list_services method.
838
+ # result = client.list_services request
839
+ #
840
+ # # The returned object is of type Gapic::PagedEnumerable. You can
841
+ # # iterate over all elements by calling #each, and the enumerable
842
+ # # will lazily make API calls to fetch subsequent pages. Other
843
+ # # methods are also available for managing paging directly.
844
+ # result.each do |response|
845
+ # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service.
846
+ # p response
847
+ # end
848
+ #
717
849
  def list_services request, options = nil
718
850
  raise ::ArgumentError, "request must be provided" if request.nil?
719
851
 
@@ -731,16 +863,20 @@ module Google
731
863
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
732
864
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
733
865
 
734
- header_params = {
735
- "parent" => request.parent
736
- }
866
+ header_params = {}
867
+ if request.parent
868
+ header_params["parent"] = request.parent
869
+ end
870
+
737
871
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
738
872
  metadata[:"x-goog-request-params"] ||= request_params_header
739
873
 
740
874
  options.apply_defaults timeout: @config.rpcs.list_services.timeout,
741
875
  metadata: metadata,
742
876
  retry_policy: @config.rpcs.list_services.retry_policy
743
- options.apply_defaults metadata: @config.metadata,
877
+
878
+ options.apply_defaults timeout: @config.timeout,
879
+ metadata: @config.metadata,
744
880
  retry_policy: @config.retry_policy
745
881
 
746
882
  @registration_service_stub.call_rpc :list_services, request, options: options do |response, operation|
@@ -781,6 +917,21 @@ module Google
781
917
  #
782
918
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
783
919
  #
920
+ # @example Basic example
921
+ # require "google/cloud/service_directory/v1beta1"
922
+ #
923
+ # # Create a client object. The client can be reused for multiple calls.
924
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
925
+ #
926
+ # # Create a request. To set request fields, pass in keyword arguments.
927
+ # request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new
928
+ #
929
+ # # Call the get_service method.
930
+ # result = client.get_service request
931
+ #
932
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service.
933
+ # p result
934
+ #
784
935
  def get_service request, options = nil
785
936
  raise ::ArgumentError, "request must be provided" if request.nil?
786
937
 
@@ -798,16 +949,20 @@ module Google
798
949
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
799
950
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
800
951
 
801
- header_params = {
802
- "name" => request.name
803
- }
952
+ header_params = {}
953
+ if request.name
954
+ header_params["name"] = request.name
955
+ end
956
+
804
957
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
805
958
  metadata[:"x-goog-request-params"] ||= request_params_header
806
959
 
807
960
  options.apply_defaults timeout: @config.rpcs.get_service.timeout,
808
961
  metadata: metadata,
809
962
  retry_policy: @config.rpcs.get_service.retry_policy
810
- options.apply_defaults metadata: @config.metadata,
963
+
964
+ options.apply_defaults timeout: @config.timeout,
965
+ metadata: @config.metadata,
811
966
  retry_policy: @config.retry_policy
812
967
 
813
968
  @registration_service_stub.call_rpc :get_service, request, options: options do |response, operation|
@@ -849,6 +1004,21 @@ module Google
849
1004
  #
850
1005
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
851
1006
  #
1007
+ # @example Basic example
1008
+ # require "google/cloud/service_directory/v1beta1"
1009
+ #
1010
+ # # Create a client object. The client can be reused for multiple calls.
1011
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1012
+ #
1013
+ # # Create a request. To set request fields, pass in keyword arguments.
1014
+ # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new
1015
+ #
1016
+ # # Call the update_service method.
1017
+ # result = client.update_service request
1018
+ #
1019
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service.
1020
+ # p result
1021
+ #
852
1022
  def update_service request, options = nil
853
1023
  raise ::ArgumentError, "request must be provided" if request.nil?
854
1024
 
@@ -866,16 +1036,20 @@ module Google
866
1036
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
867
1037
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
868
1038
 
869
- header_params = {
870
- "service.name" => request.service.name
871
- }
1039
+ header_params = {}
1040
+ if request.service&.name
1041
+ header_params["service.name"] = request.service.name
1042
+ end
1043
+
872
1044
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
873
1045
  metadata[:"x-goog-request-params"] ||= request_params_header
874
1046
 
875
1047
  options.apply_defaults timeout: @config.rpcs.update_service.timeout,
876
1048
  metadata: metadata,
877
1049
  retry_policy: @config.rpcs.update_service.retry_policy
878
- options.apply_defaults metadata: @config.metadata,
1050
+
1051
+ options.apply_defaults timeout: @config.timeout,
1052
+ metadata: @config.metadata,
879
1053
  retry_policy: @config.retry_policy
880
1054
 
881
1055
  @registration_service_stub.call_rpc :update_service, request, options: options do |response, operation|
@@ -916,6 +1090,21 @@ module Google
916
1090
  #
917
1091
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
918
1092
  #
1093
+ # @example Basic example
1094
+ # require "google/cloud/service_directory/v1beta1"
1095
+ #
1096
+ # # Create a client object. The client can be reused for multiple calls.
1097
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1098
+ #
1099
+ # # Create a request. To set request fields, pass in keyword arguments.
1100
+ # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new
1101
+ #
1102
+ # # Call the delete_service method.
1103
+ # result = client.delete_service request
1104
+ #
1105
+ # # The returned object is of type Google::Protobuf::Empty.
1106
+ # p result
1107
+ #
919
1108
  def delete_service request, options = nil
920
1109
  raise ::ArgumentError, "request must be provided" if request.nil?
921
1110
 
@@ -933,16 +1122,20 @@ module Google
933
1122
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
934
1123
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
935
1124
 
936
- header_params = {
937
- "name" => request.name
938
- }
1125
+ header_params = {}
1126
+ if request.name
1127
+ header_params["name"] = request.name
1128
+ end
1129
+
939
1130
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
940
1131
  metadata[:"x-goog-request-params"] ||= request_params_header
941
1132
 
942
1133
  options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
943
1134
  metadata: metadata,
944
1135
  retry_policy: @config.rpcs.delete_service.retry_policy
945
- options.apply_defaults metadata: @config.metadata,
1136
+
1137
+ options.apply_defaults timeout: @config.timeout,
1138
+ metadata: @config.metadata,
946
1139
  retry_policy: @config.retry_policy
947
1140
 
948
1141
  @registration_service_stub.call_rpc :delete_service, request, options: options do |response, operation|
@@ -992,6 +1185,21 @@ module Google
992
1185
  #
993
1186
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
994
1187
  #
1188
+ # @example Basic example
1189
+ # require "google/cloud/service_directory/v1beta1"
1190
+ #
1191
+ # # Create a client object. The client can be reused for multiple calls.
1192
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1193
+ #
1194
+ # # Create a request. To set request fields, pass in keyword arguments.
1195
+ # request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new
1196
+ #
1197
+ # # Call the create_endpoint method.
1198
+ # result = client.create_endpoint request
1199
+ #
1200
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint.
1201
+ # p result
1202
+ #
995
1203
  def create_endpoint request, options = nil
996
1204
  raise ::ArgumentError, "request must be provided" if request.nil?
997
1205
 
@@ -1009,16 +1217,20 @@ module Google
1009
1217
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1010
1218
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1011
1219
 
1012
- header_params = {
1013
- "parent" => request.parent
1014
- }
1220
+ header_params = {}
1221
+ if request.parent
1222
+ header_params["parent"] = request.parent
1223
+ end
1224
+
1015
1225
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1016
1226
  metadata[:"x-goog-request-params"] ||= request_params_header
1017
1227
 
1018
1228
  options.apply_defaults timeout: @config.rpcs.create_endpoint.timeout,
1019
1229
  metadata: metadata,
1020
1230
  retry_policy: @config.rpcs.create_endpoint.retry_policy
1021
- options.apply_defaults metadata: @config.metadata,
1231
+
1232
+ options.apply_defaults timeout: @config.timeout,
1233
+ metadata: @config.metadata,
1022
1234
  retry_policy: @config.retry_policy
1023
1235
 
1024
1236
  @registration_service_stub.call_rpc :create_endpoint, request, options: options do |response, operation|
@@ -1109,6 +1321,27 @@ module Google
1109
1321
  #
1110
1322
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1111
1323
  #
1324
+ # @example Basic example
1325
+ # require "google/cloud/service_directory/v1beta1"
1326
+ #
1327
+ # # Create a client object. The client can be reused for multiple calls.
1328
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1329
+ #
1330
+ # # Create a request. To set request fields, pass in keyword arguments.
1331
+ # request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new
1332
+ #
1333
+ # # Call the list_endpoints method.
1334
+ # result = client.list_endpoints request
1335
+ #
1336
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1337
+ # # iterate over all elements by calling #each, and the enumerable
1338
+ # # will lazily make API calls to fetch subsequent pages. Other
1339
+ # # methods are also available for managing paging directly.
1340
+ # result.each do |response|
1341
+ # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.
1342
+ # p response
1343
+ # end
1344
+ #
1112
1345
  def list_endpoints request, options = nil
1113
1346
  raise ::ArgumentError, "request must be provided" if request.nil?
1114
1347
 
@@ -1126,16 +1359,20 @@ module Google
1126
1359
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1127
1360
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1128
1361
 
1129
- header_params = {
1130
- "parent" => request.parent
1131
- }
1362
+ header_params = {}
1363
+ if request.parent
1364
+ header_params["parent"] = request.parent
1365
+ end
1366
+
1132
1367
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1133
1368
  metadata[:"x-goog-request-params"] ||= request_params_header
1134
1369
 
1135
1370
  options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout,
1136
1371
  metadata: metadata,
1137
1372
  retry_policy: @config.rpcs.list_endpoints.retry_policy
1138
- options.apply_defaults metadata: @config.metadata,
1373
+
1374
+ options.apply_defaults timeout: @config.timeout,
1375
+ metadata: @config.metadata,
1139
1376
  retry_policy: @config.retry_policy
1140
1377
 
1141
1378
  @registration_service_stub.call_rpc :list_endpoints, request, options: options do |response, operation|
@@ -1176,6 +1413,21 @@ module Google
1176
1413
  #
1177
1414
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1178
1415
  #
1416
+ # @example Basic example
1417
+ # require "google/cloud/service_directory/v1beta1"
1418
+ #
1419
+ # # Create a client object. The client can be reused for multiple calls.
1420
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1421
+ #
1422
+ # # Create a request. To set request fields, pass in keyword arguments.
1423
+ # request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new
1424
+ #
1425
+ # # Call the get_endpoint method.
1426
+ # result = client.get_endpoint request
1427
+ #
1428
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint.
1429
+ # p result
1430
+ #
1179
1431
  def get_endpoint request, options = nil
1180
1432
  raise ::ArgumentError, "request must be provided" if request.nil?
1181
1433
 
@@ -1193,16 +1445,20 @@ module Google
1193
1445
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1194
1446
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1195
1447
 
1196
- header_params = {
1197
- "name" => request.name
1198
- }
1448
+ header_params = {}
1449
+ if request.name
1450
+ header_params["name"] = request.name
1451
+ end
1452
+
1199
1453
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1200
1454
  metadata[:"x-goog-request-params"] ||= request_params_header
1201
1455
 
1202
1456
  options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout,
1203
1457
  metadata: metadata,
1204
1458
  retry_policy: @config.rpcs.get_endpoint.retry_policy
1205
- options.apply_defaults metadata: @config.metadata,
1459
+
1460
+ options.apply_defaults timeout: @config.timeout,
1461
+ metadata: @config.metadata,
1206
1462
  retry_policy: @config.retry_policy
1207
1463
 
1208
1464
  @registration_service_stub.call_rpc :get_endpoint, request, options: options do |response, operation|
@@ -1244,6 +1500,21 @@ module Google
1244
1500
  #
1245
1501
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1246
1502
  #
1503
+ # @example Basic example
1504
+ # require "google/cloud/service_directory/v1beta1"
1505
+ #
1506
+ # # Create a client object. The client can be reused for multiple calls.
1507
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1508
+ #
1509
+ # # Create a request. To set request fields, pass in keyword arguments.
1510
+ # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new
1511
+ #
1512
+ # # Call the update_endpoint method.
1513
+ # result = client.update_endpoint request
1514
+ #
1515
+ # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint.
1516
+ # p result
1517
+ #
1247
1518
  def update_endpoint request, options = nil
1248
1519
  raise ::ArgumentError, "request must be provided" if request.nil?
1249
1520
 
@@ -1261,16 +1532,20 @@ module Google
1261
1532
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1262
1533
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1263
1534
 
1264
- header_params = {
1265
- "endpoint.name" => request.endpoint.name
1266
- }
1535
+ header_params = {}
1536
+ if request.endpoint&.name
1537
+ header_params["endpoint.name"] = request.endpoint.name
1538
+ end
1539
+
1267
1540
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1268
1541
  metadata[:"x-goog-request-params"] ||= request_params_header
1269
1542
 
1270
1543
  options.apply_defaults timeout: @config.rpcs.update_endpoint.timeout,
1271
1544
  metadata: metadata,
1272
1545
  retry_policy: @config.rpcs.update_endpoint.retry_policy
1273
- options.apply_defaults metadata: @config.metadata,
1546
+
1547
+ options.apply_defaults timeout: @config.timeout,
1548
+ metadata: @config.metadata,
1274
1549
  retry_policy: @config.retry_policy
1275
1550
 
1276
1551
  @registration_service_stub.call_rpc :update_endpoint, request, options: options do |response, operation|
@@ -1310,6 +1585,21 @@ module Google
1310
1585
  #
1311
1586
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1312
1587
  #
1588
+ # @example Basic example
1589
+ # require "google/cloud/service_directory/v1beta1"
1590
+ #
1591
+ # # Create a client object. The client can be reused for multiple calls.
1592
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1593
+ #
1594
+ # # Create a request. To set request fields, pass in keyword arguments.
1595
+ # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new
1596
+ #
1597
+ # # Call the delete_endpoint method.
1598
+ # result = client.delete_endpoint request
1599
+ #
1600
+ # # The returned object is of type Google::Protobuf::Empty.
1601
+ # p result
1602
+ #
1313
1603
  def delete_endpoint request, options = nil
1314
1604
  raise ::ArgumentError, "request must be provided" if request.nil?
1315
1605
 
@@ -1327,16 +1617,20 @@ module Google
1327
1617
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1328
1618
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1329
1619
 
1330
- header_params = {
1331
- "name" => request.name
1332
- }
1620
+ header_params = {}
1621
+ if request.name
1622
+ header_params["name"] = request.name
1623
+ end
1624
+
1333
1625
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1334
1626
  metadata[:"x-goog-request-params"] ||= request_params_header
1335
1627
 
1336
1628
  options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout,
1337
1629
  metadata: metadata,
1338
1630
  retry_policy: @config.rpcs.delete_endpoint.retry_policy
1339
- options.apply_defaults metadata: @config.metadata,
1631
+
1632
+ options.apply_defaults timeout: @config.timeout,
1633
+ metadata: @config.metadata,
1340
1634
  retry_policy: @config.retry_policy
1341
1635
 
1342
1636
  @registration_service_stub.call_rpc :delete_endpoint, request, options: options do |response, operation|
@@ -1380,6 +1674,21 @@ module Google
1380
1674
  #
1381
1675
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1382
1676
  #
1677
+ # @example Basic example
1678
+ # require "google/cloud/service_directory/v1beta1"
1679
+ #
1680
+ # # Create a client object. The client can be reused for multiple calls.
1681
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1682
+ #
1683
+ # # Create a request. To set request fields, pass in keyword arguments.
1684
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1685
+ #
1686
+ # # Call the get_iam_policy method.
1687
+ # result = client.get_iam_policy request
1688
+ #
1689
+ # # The returned object is of type Google::Iam::V1::Policy.
1690
+ # p result
1691
+ #
1383
1692
  def get_iam_policy request, options = nil
1384
1693
  raise ::ArgumentError, "request must be provided" if request.nil?
1385
1694
 
@@ -1397,16 +1706,20 @@ module Google
1397
1706
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1398
1707
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1399
1708
 
1400
- header_params = {
1401
- "resource" => request.resource
1402
- }
1709
+ header_params = {}
1710
+ if request.resource
1711
+ header_params["resource"] = request.resource
1712
+ end
1713
+
1403
1714
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1404
1715
  metadata[:"x-goog-request-params"] ||= request_params_header
1405
1716
 
1406
1717
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1407
1718
  metadata: metadata,
1408
1719
  retry_policy: @config.rpcs.get_iam_policy.retry_policy
1409
- options.apply_defaults metadata: @config.metadata,
1720
+
1721
+ options.apply_defaults timeout: @config.timeout,
1722
+ metadata: @config.metadata,
1410
1723
  retry_policy: @config.retry_policy
1411
1724
 
1412
1725
  @registration_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
@@ -1452,6 +1765,21 @@ module Google
1452
1765
  #
1453
1766
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1454
1767
  #
1768
+ # @example Basic example
1769
+ # require "google/cloud/service_directory/v1beta1"
1770
+ #
1771
+ # # Create a client object. The client can be reused for multiple calls.
1772
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1773
+ #
1774
+ # # Create a request. To set request fields, pass in keyword arguments.
1775
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1776
+ #
1777
+ # # Call the set_iam_policy method.
1778
+ # result = client.set_iam_policy request
1779
+ #
1780
+ # # The returned object is of type Google::Iam::V1::Policy.
1781
+ # p result
1782
+ #
1455
1783
  def set_iam_policy request, options = nil
1456
1784
  raise ::ArgumentError, "request must be provided" if request.nil?
1457
1785
 
@@ -1469,16 +1797,20 @@ module Google
1469
1797
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1470
1798
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1471
1799
 
1472
- header_params = {
1473
- "resource" => request.resource
1474
- }
1800
+ header_params = {}
1801
+ if request.resource
1802
+ header_params["resource"] = request.resource
1803
+ end
1804
+
1475
1805
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1476
1806
  metadata[:"x-goog-request-params"] ||= request_params_header
1477
1807
 
1478
1808
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1479
1809
  metadata: metadata,
1480
1810
  retry_policy: @config.rpcs.set_iam_policy.retry_policy
1481
- options.apply_defaults metadata: @config.metadata,
1811
+
1812
+ options.apply_defaults timeout: @config.timeout,
1813
+ metadata: @config.metadata,
1482
1814
  retry_policy: @config.retry_policy
1483
1815
 
1484
1816
  @registration_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
@@ -1524,6 +1856,21 @@ module Google
1524
1856
  #
1525
1857
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1526
1858
  #
1859
+ # @example Basic example
1860
+ # require "google/cloud/service_directory/v1beta1"
1861
+ #
1862
+ # # Create a client object. The client can be reused for multiple calls.
1863
+ # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new
1864
+ #
1865
+ # # Create a request. To set request fields, pass in keyword arguments.
1866
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1867
+ #
1868
+ # # Call the test_iam_permissions method.
1869
+ # result = client.test_iam_permissions request
1870
+ #
1871
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1872
+ # p result
1873
+ #
1527
1874
  def test_iam_permissions request, options = nil
1528
1875
  raise ::ArgumentError, "request must be provided" if request.nil?
1529
1876
 
@@ -1541,16 +1888,20 @@ module Google
1541
1888
  gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION
1542
1889
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1543
1890
 
1544
- header_params = {
1545
- "resource" => request.resource
1546
- }
1891
+ header_params = {}
1892
+ if request.resource
1893
+ header_params["resource"] = request.resource
1894
+ end
1895
+
1547
1896
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1548
1897
  metadata[:"x-goog-request-params"] ||= request_params_header
1549
1898
 
1550
1899
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1551
1900
  metadata: metadata,
1552
1901
  retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1553
- options.apply_defaults metadata: @config.metadata,
1902
+
1903
+ options.apply_defaults timeout: @config.timeout,
1904
+ metadata: @config.metadata,
1554
1905
  retry_policy: @config.retry_policy
1555
1906
 
1556
1907
  @registration_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
@@ -1574,22 +1925,21 @@ module Google
1574
1925
  # Configuration can be applied globally to all clients, or to a single client
1575
1926
  # on construction.
1576
1927
  #
1577
- # # Examples
1578
- #
1579
- # To modify the global config, setting the timeout for create_namespace
1580
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1581
- #
1582
- # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config|
1583
- # config.timeout = 10.0
1584
- # config.rpcs.create_namespace.timeout = 20.0
1585
- # end
1586
- #
1587
- # To apply the above configuration only to a new client:
1588
- #
1589
- # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config|
1590
- # config.timeout = 10.0
1591
- # config.rpcs.create_namespace.timeout = 20.0
1592
- # end
1928
+ # @example
1929
+ #
1930
+ # # Modify the global config, setting the timeout for
1931
+ # # create_namespace to 20 seconds,
1932
+ # # and all remaining timeouts to 10 seconds.
1933
+ # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config|
1934
+ # config.timeout = 10.0
1935
+ # config.rpcs.create_namespace.timeout = 20.0
1936
+ # end
1937
+ #
1938
+ # # Apply the above configuration only to a new client.
1939
+ # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config|
1940
+ # config.timeout = 10.0
1941
+ # config.rpcs.create_namespace.timeout = 20.0
1942
+ # end
1593
1943
  #
1594
1944
  # @!attribute [rw] endpoint
1595
1945
  # The hostname or hostname:port of the service endpoint.