google-cloud-talent-v4beta1 0.3.0 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -82,7 +82,7 @@ module Google
82
82
  # Create credentials
83
83
  credentials = @config.credentials
84
84
  credentials ||= Credentials.default scope: @config.scope
85
- if credentials.is_a?(String) || credentials.is_a?(Hash)
85
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
88
  @quota_project_id = @config.quota_project
@@ -169,7 +169,9 @@ module Google
169
169
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
170
170
  metadata: metadata,
171
171
  retry_policy: @config.rpcs.list_operations.retry_policy
172
- options.apply_defaults metadata: @config.metadata,
172
+
173
+ options.apply_defaults timeout: @config.timeout,
174
+ metadata: @config.metadata,
173
175
  retry_policy: @config.retry_policy
174
176
 
175
177
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -239,7 +241,9 @@ module Google
239
241
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
240
242
  metadata: metadata,
241
243
  retry_policy: @config.rpcs.get_operation.retry_policy
242
- options.apply_defaults metadata: @config.metadata,
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
243
247
  retry_policy: @config.retry_policy
244
248
 
245
249
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -309,7 +313,9 @@ module Google
309
313
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
310
314
  metadata: metadata,
311
315
  retry_policy: @config.rpcs.delete_operation.retry_policy
312
- options.apply_defaults metadata: @config.metadata,
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
313
319
  retry_policy: @config.retry_policy
314
320
 
315
321
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -384,7 +390,9 @@ module Google
384
390
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
385
391
  metadata: metadata,
386
392
  retry_policy: @config.rpcs.cancel_operation.retry_policy
387
- options.apply_defaults metadata: @config.metadata,
393
+
394
+ options.apply_defaults timeout: @config.timeout,
395
+ metadata: @config.metadata,
388
396
  retry_policy: @config.retry_policy
389
397
 
390
398
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -396,9 +404,9 @@ module Google
396
404
  end
397
405
 
398
406
  ##
399
- # Waits for the specified long-running operation until it is done or reaches
400
- # at most a specified timeout, returning the latest state. If the operation
401
- # is already done, the latest state is immediately returned. If the timeout
407
+ # Waits until the specified long-running operation is done or reaches at most
408
+ # a specified timeout, returning the latest state. If the operation is
409
+ # already done, the latest state is immediately returned. If the timeout
402
410
  # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
403
411
  # timeout is used. If the server does not support this method, it returns
404
412
  # `google.rpc.Code.UNIMPLEMENTED`.
@@ -456,7 +464,9 @@ module Google
456
464
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
465
  metadata: metadata,
458
466
  retry_policy: @config.rpcs.wait_operation.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
467
+
468
+ options.apply_defaults timeout: @config.timeout,
469
+ metadata: @config.metadata,
460
470
  retry_policy: @config.retry_policy
461
471
 
462
472
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
@@ -481,22 +491,21 @@ module Google
481
491
  # Configuration can be applied globally to all clients, or to a single client
482
492
  # on construction.
483
493
  #
484
- # # Examples
485
- #
486
- # To modify the global config, setting the timeout for list_operations
487
- # to 20 seconds, and all remaining timeouts to 10 seconds:
488
- #
489
- # ::Google::Longrunning::Operations::Client.configure do |config|
490
- # config.timeout = 10.0
491
- # config.rpcs.list_operations.timeout = 20.0
492
- # end
494
+ # @example
493
495
  #
494
- # To apply the above configuration only to a new client:
496
+ # # Modify the global config, setting the timeout for
497
+ # # list_operations to 20 seconds,
498
+ # # and all remaining timeouts to 10 seconds.
499
+ # ::Google::Longrunning::Operations::Client.configure do |config|
500
+ # config.timeout = 10.0
501
+ # config.rpcs.list_operations.timeout = 20.0
502
+ # end
495
503
  #
496
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
499
- # end
504
+ # # Apply the above configuration only to a new client.
505
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
506
+ # config.timeout = 10.0
507
+ # config.rpcs.list_operations.timeout = 20.0
508
+ # end
500
509
  #
501
510
  # @!attribute [rw] endpoint
502
511
  # The hostname or hostname:port of the service endpoint.
@@ -560,7 +569,7 @@ module Google
560
569
  config_attr :scope, nil, ::String, ::Array, nil
561
570
  config_attr :lib_name, nil, ::String, nil
562
571
  config_attr :lib_version, nil, ::String, nil
563
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
572
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
564
573
  config_attr :interceptors, nil, ::Array, nil
565
574
  config_attr :timeout, nil, ::Numeric, nil
566
575
  config_attr :metadata, nil, ::Hash, nil
@@ -581,7 +590,7 @@ module Google
581
590
  def rpcs
582
591
  @rpcs ||= begin
583
592
  parent_rpcs = nil
584
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
593
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
585
594
  Rpcs.new parent_rpcs
586
595
  end
587
596
  end
@@ -632,15 +641,15 @@ module Google
632
641
 
633
642
  # @private
634
643
  def initialize parent_rpcs = nil
635
- list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
644
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
636
645
  @list_operations = ::Gapic::Config::Method.new list_operations_config
637
- get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
646
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
638
647
  @get_operation = ::Gapic::Config::Method.new get_operation_config
639
- delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
648
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
640
649
  @delete_operation = ::Gapic::Config::Method.new delete_operation_config
641
- cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
650
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
642
651
  @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
643
- wait_operation_config = parent_rpcs&.wait_operation if parent_rpcs&.respond_to? :wait_operation
652
+ wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
644
653
  @wait_operation = ::Gapic::Config::Method.new wait_operation_config
645
654
 
646
655
  yield self if block_given?
@@ -53,7 +53,7 @@ module Google
53
53
 
54
54
  "projects/#{project}/tenants/#{tenant}/companies/#{company}"
55
55
  end),
56
- "company:project" => (proc do |project:, company:|
56
+ "company:project" => (proc do |project:, company:|
57
57
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
58
58
 
59
59
  "projects/#{project}/companies/#{company}"
@@ -94,7 +94,7 @@ module Google
94
94
 
95
95
  "projects/#{project}/tenants/#{tenant}/jobs/#{job}"
96
96
  end),
97
- "job:project" => (proc do |project:, job:|
97
+ "job:project" => (proc do |project:, job:|
98
98
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
99
99
 
100
100
  "projects/#{project}/jobs/#{job}"
@@ -42,13 +42,12 @@ module Google
42
42
  # See {::Google::Cloud::Talent::V4beta1::ProfileService::Client::Configuration}
43
43
  # for a description of the configuration fields.
44
44
  #
45
- # ## Example
45
+ # @example
46
46
  #
47
- # To modify the configuration for all ProfileService clients:
48
- #
49
- # ::Google::Cloud::Talent::V4beta1::ProfileService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
47
+ # # Modify the configuration for all ProfileService clients
48
+ # ::Google::Cloud::Talent::V4beta1::ProfileService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
52
51
  #
53
52
  # @yield [config] Configure the Client client.
54
53
  # @yieldparam config [Client::Configuration]
@@ -61,37 +60,28 @@ module Google
61
60
  parent_config = while namespace.any?
62
61
  parent_name = namespace.join "::"
63
62
  parent_const = const_get parent_name
64
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
65
64
  namespace.pop
66
65
  end
67
66
  default_config = Client::Configuration.new parent_config
68
67
 
69
68
  default_config.rpcs.list_profiles.timeout = 30.0
70
69
  default_config.rpcs.list_profiles.retry_policy = {
71
- initial_delay: 0.1,
72
- max_delay: 60.0,
73
- multiplier: 1.3,
74
- retry_codes: [4, 14]
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
75
71
  }
76
72
 
77
73
  default_config.rpcs.create_profile.timeout = 30.0
78
74
 
79
75
  default_config.rpcs.get_profile.timeout = 30.0
80
76
  default_config.rpcs.get_profile.retry_policy = {
81
- initial_delay: 0.1,
82
- max_delay: 60.0,
83
- multiplier: 1.3,
84
- retry_codes: [4, 14]
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
78
  }
86
79
 
87
80
  default_config.rpcs.update_profile.timeout = 30.0
88
81
 
89
82
  default_config.rpcs.delete_profile.timeout = 30.0
90
83
  default_config.rpcs.delete_profile.retry_policy = {
91
- initial_delay: 0.1,
92
- max_delay: 60.0,
93
- multiplier: 1.3,
94
- retry_codes: [4, 14]
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
95
85
  }
96
86
 
97
87
  default_config.rpcs.search_profiles.timeout = 30.0
@@ -125,19 +115,15 @@ module Google
125
115
  ##
126
116
  # Create a new ProfileService client object.
127
117
  #
128
- # ## Examples
129
- #
130
- # To create a new ProfileService client with the default
131
- # configuration:
132
- #
133
- # client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new
118
+ # @example
134
119
  #
135
- # To create a new ProfileService client with a custom
136
- # configuration:
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new
137
122
  #
138
- # client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new do |config|
139
- # config.timeout = 10.0
140
- # end
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
141
127
  #
142
128
  # @yield [config] Configure the ProfileService client.
143
129
  # @yieldparam config [Client::Configuration]
@@ -157,14 +143,13 @@ module Google
157
143
 
158
144
  # Create credentials
159
145
  credentials = @config.credentials
160
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
146
+ # Use self-signed JWT if the endpoint is unchanged from default,
161
147
  # but only if the default endpoint does not have a region prefix.
162
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
163
- @config.endpoint == Client.configure.endpoint &&
148
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
164
149
  !@config.endpoint.split(".").first.include?("-")
165
- credentials ||= Credentials.default scope: @config.scope,
150
+ credentials ||= Credentials.default scope: @config.scope,
166
151
  enable_self_signed_jwt: enable_self_signed_jwt
167
- if credentials.is_a?(String) || credentials.is_a?(Hash)
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
168
153
  credentials = Credentials.new credentials, scope: @config.scope
169
154
  end
170
155
  @quota_project_id = @config.quota_project
@@ -273,7 +258,9 @@ module Google
273
258
  options.apply_defaults timeout: @config.rpcs.list_profiles.timeout,
274
259
  metadata: metadata,
275
260
  retry_policy: @config.rpcs.list_profiles.retry_policy
276
- options.apply_defaults metadata: @config.metadata,
261
+
262
+ options.apply_defaults timeout: @config.timeout,
263
+ metadata: @config.metadata,
277
264
  retry_policy: @config.retry_policy
278
265
 
279
266
  @profile_service_stub.call_rpc :list_profiles, request, options: options do |response, operation|
@@ -345,7 +332,9 @@ module Google
345
332
  options.apply_defaults timeout: @config.rpcs.create_profile.timeout,
346
333
  metadata: metadata,
347
334
  retry_policy: @config.rpcs.create_profile.retry_policy
348
- options.apply_defaults metadata: @config.metadata,
335
+
336
+ options.apply_defaults timeout: @config.timeout,
337
+ metadata: @config.metadata,
349
338
  retry_policy: @config.retry_policy
350
339
 
351
340
  @profile_service_stub.call_rpc :create_profile, request, options: options do |response, operation|
@@ -415,7 +404,9 @@ module Google
415
404
  options.apply_defaults timeout: @config.rpcs.get_profile.timeout,
416
405
  metadata: metadata,
417
406
  retry_policy: @config.rpcs.get_profile.retry_policy
418
- options.apply_defaults metadata: @config.metadata,
407
+
408
+ options.apply_defaults timeout: @config.timeout,
409
+ metadata: @config.metadata,
419
410
  retry_policy: @config.retry_policy
420
411
 
421
412
  @profile_service_stub.call_rpc :get_profile, request, options: options do |response, operation|
@@ -485,7 +476,9 @@ module Google
485
476
  options.apply_defaults timeout: @config.rpcs.update_profile.timeout,
486
477
  metadata: metadata,
487
478
  retry_policy: @config.rpcs.update_profile.retry_policy
488
- options.apply_defaults metadata: @config.metadata,
479
+
480
+ options.apply_defaults timeout: @config.timeout,
481
+ metadata: @config.metadata,
489
482
  retry_policy: @config.retry_policy
490
483
 
491
484
  @profile_service_stub.call_rpc :update_profile, request, options: options do |response, operation|
@@ -557,7 +550,9 @@ module Google
557
550
  options.apply_defaults timeout: @config.rpcs.delete_profile.timeout,
558
551
  metadata: metadata,
559
552
  retry_policy: @config.rpcs.delete_profile.retry_policy
560
- options.apply_defaults metadata: @config.metadata,
553
+
554
+ options.apply_defaults timeout: @config.timeout,
555
+ metadata: @config.metadata,
561
556
  retry_policy: @config.retry_policy
562
557
 
563
558
  @profile_service_stub.call_rpc :delete_profile, request, options: options do |response, operation|
@@ -798,7 +793,9 @@ module Google
798
793
  options.apply_defaults timeout: @config.rpcs.search_profiles.timeout,
799
794
  metadata: metadata,
800
795
  retry_policy: @config.rpcs.search_profiles.retry_policy
801
- options.apply_defaults metadata: @config.metadata,
796
+
797
+ options.apply_defaults timeout: @config.timeout,
798
+ metadata: @config.metadata,
802
799
  retry_policy: @config.retry_policy
803
800
 
804
801
  @profile_service_stub.call_rpc :search_profiles, request, options: options do |response, operation|
@@ -822,22 +819,21 @@ module Google
822
819
  # Configuration can be applied globally to all clients, or to a single client
823
820
  # on construction.
824
821
  #
825
- # # Examples
826
- #
827
- # To modify the global config, setting the timeout for list_profiles
828
- # to 20 seconds, and all remaining timeouts to 10 seconds:
829
- #
830
- # ::Google::Cloud::Talent::V4beta1::ProfileService::Client.configure do |config|
831
- # config.timeout = 10.0
832
- # config.rpcs.list_profiles.timeout = 20.0
833
- # end
822
+ # @example
834
823
  #
835
- # To apply the above configuration only to a new client:
824
+ # # Modify the global config, setting the timeout for
825
+ # # list_profiles to 20 seconds,
826
+ # # and all remaining timeouts to 10 seconds.
827
+ # ::Google::Cloud::Talent::V4beta1::ProfileService::Client.configure do |config|
828
+ # config.timeout = 10.0
829
+ # config.rpcs.list_profiles.timeout = 20.0
830
+ # end
836
831
  #
837
- # client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new do |config|
838
- # config.timeout = 10.0
839
- # config.rpcs.list_profiles.timeout = 20.0
840
- # end
832
+ # # Apply the above configuration only to a new client.
833
+ # client = ::Google::Cloud::Talent::V4beta1::ProfileService::Client.new do |config|
834
+ # config.timeout = 10.0
835
+ # config.rpcs.list_profiles.timeout = 20.0
836
+ # end
841
837
  #
842
838
  # @!attribute [rw] endpoint
843
839
  # The hostname or hostname:port of the service endpoint.
@@ -901,7 +897,7 @@ module Google
901
897
  config_attr :scope, nil, ::String, ::Array, nil
902
898
  config_attr :lib_name, nil, ::String, nil
903
899
  config_attr :lib_version, nil, ::String, nil
904
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
900
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
905
901
  config_attr :interceptors, nil, ::Array, nil
906
902
  config_attr :timeout, nil, ::Numeric, nil
907
903
  config_attr :metadata, nil, ::Hash, nil
@@ -922,7 +918,7 @@ module Google
922
918
  def rpcs
923
919
  @rpcs ||= begin
924
920
  parent_rpcs = nil
925
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
921
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
926
922
  Rpcs.new parent_rpcs
927
923
  end
928
924
  end
@@ -978,17 +974,17 @@ module Google
978
974
 
979
975
  # @private
980
976
  def initialize parent_rpcs = nil
981
- list_profiles_config = parent_rpcs&.list_profiles if parent_rpcs&.respond_to? :list_profiles
977
+ list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles
982
978
  @list_profiles = ::Gapic::Config::Method.new list_profiles_config
983
- create_profile_config = parent_rpcs&.create_profile if parent_rpcs&.respond_to? :create_profile
979
+ create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile
984
980
  @create_profile = ::Gapic::Config::Method.new create_profile_config
985
- get_profile_config = parent_rpcs&.get_profile if parent_rpcs&.respond_to? :get_profile
981
+ get_profile_config = parent_rpcs.get_profile if parent_rpcs.respond_to? :get_profile
986
982
  @get_profile = ::Gapic::Config::Method.new get_profile_config
987
- update_profile_config = parent_rpcs&.update_profile if parent_rpcs&.respond_to? :update_profile
983
+ update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile
988
984
  @update_profile = ::Gapic::Config::Method.new update_profile_config
989
- delete_profile_config = parent_rpcs&.delete_profile if parent_rpcs&.respond_to? :delete_profile
985
+ delete_profile_config = parent_rpcs.delete_profile if parent_rpcs.respond_to? :delete_profile
990
986
  @delete_profile = ::Gapic::Config::Method.new delete_profile_config
991
- search_profiles_config = parent_rpcs&.search_profiles if parent_rpcs&.respond_to? :search_profiles
987
+ search_profiles_config = parent_rpcs.search_profiles if parent_rpcs.respond_to? :search_profiles
992
988
  @search_profiles = ::Gapic::Config::Method.new search_profiles_config
993
989
 
994
990
  yield self if block_given?
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Talent::V4beta1::TenantService::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 TenantService clients:
47
- #
48
- # ::Google::Cloud::Talent::V4beta1::TenantService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all TenantService clients
47
+ # ::Google::Cloud::Talent::V4beta1::TenantService::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]
@@ -60,7 +59,7 @@ module Google
60
59
  parent_config = while namespace.any?
61
60
  parent_name = namespace.join "::"
62
61
  parent_const = const_get parent_name
63
- break parent_const.configure if parent_const&.respond_to? :configure
62
+ break parent_const.configure if parent_const.respond_to? :configure
64
63
  namespace.pop
65
64
  end
66
65
  default_config = Client::Configuration.new parent_config
@@ -69,28 +68,19 @@ module Google
69
68
 
70
69
  default_config.rpcs.get_tenant.timeout = 30.0
71
70
  default_config.rpcs.get_tenant.retry_policy = {
72
- initial_delay: 0.1,
73
- max_delay: 60.0,
74
- multiplier: 1.3,
75
- retry_codes: [4, 14]
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
72
  }
77
73
 
78
74
  default_config.rpcs.update_tenant.timeout = 30.0
79
75
 
80
76
  default_config.rpcs.delete_tenant.timeout = 30.0
81
77
  default_config.rpcs.delete_tenant.retry_policy = {
82
- initial_delay: 0.1,
83
- max_delay: 60.0,
84
- multiplier: 1.3,
85
- retry_codes: [4, 14]
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
79
  }
87
80
 
88
81
  default_config.rpcs.list_tenants.timeout = 30.0
89
82
  default_config.rpcs.list_tenants.retry_policy = {
90
- initial_delay: 0.1,
91
- max_delay: 60.0,
92
- multiplier: 1.3,
93
- retry_codes: [4, 14]
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
94
84
  }
95
85
 
96
86
  default_config
@@ -122,19 +112,15 @@ module Google
122
112
  ##
123
113
  # Create a new TenantService client object.
124
114
  #
125
- # ## Examples
126
- #
127
- # To create a new TenantService client with the default
128
- # configuration:
129
- #
130
- # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new
115
+ # @example
131
116
  #
132
- # To create a new TenantService client with a custom
133
- # configuration:
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new
134
119
  #
135
- # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config|
136
- # config.timeout = 10.0
137
- # end
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
138
124
  #
139
125
  # @yield [config] Configure the TenantService client.
140
126
  # @yieldparam config [Client::Configuration]
@@ -154,14 +140,13 @@ module Google
154
140
 
155
141
  # Create credentials
156
142
  credentials = @config.credentials
157
- # 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,
158
144
  # but only if the default endpoint does not have a region prefix.
159
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
160
- @config.endpoint == Client.configure.endpoint &&
145
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
161
146
  !@config.endpoint.split(".").first.include?("-")
162
- credentials ||= Credentials.default scope: @config.scope,
147
+ credentials ||= Credentials.default scope: @config.scope,
163
148
  enable_self_signed_jwt: enable_self_signed_jwt
164
- if credentials.is_a?(String) || credentials.is_a?(Hash)
149
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
165
150
  credentials = Credentials.new credentials, scope: @config.scope
166
151
  end
167
152
  @quota_project_id = @config.quota_project
@@ -238,7 +223,9 @@ module Google
238
223
  options.apply_defaults timeout: @config.rpcs.create_tenant.timeout,
239
224
  metadata: metadata,
240
225
  retry_policy: @config.rpcs.create_tenant.retry_policy
241
- options.apply_defaults metadata: @config.metadata,
226
+
227
+ options.apply_defaults timeout: @config.timeout,
228
+ metadata: @config.metadata,
242
229
  retry_policy: @config.retry_policy
243
230
 
244
231
  @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation|
@@ -307,7 +294,9 @@ module Google
307
294
  options.apply_defaults timeout: @config.rpcs.get_tenant.timeout,
308
295
  metadata: metadata,
309
296
  retry_policy: @config.rpcs.get_tenant.retry_policy
310
- options.apply_defaults metadata: @config.metadata,
297
+
298
+ options.apply_defaults timeout: @config.timeout,
299
+ metadata: @config.metadata,
311
300
  retry_policy: @config.retry_policy
312
301
 
313
302
  @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation|
@@ -381,7 +370,9 @@ module Google
381
370
  options.apply_defaults timeout: @config.rpcs.update_tenant.timeout,
382
371
  metadata: metadata,
383
372
  retry_policy: @config.rpcs.update_tenant.retry_policy
384
- options.apply_defaults metadata: @config.metadata,
373
+
374
+ options.apply_defaults timeout: @config.timeout,
375
+ metadata: @config.metadata,
385
376
  retry_policy: @config.retry_policy
386
377
 
387
378
  @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation|
@@ -450,7 +441,9 @@ module Google
450
441
  options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout,
451
442
  metadata: metadata,
452
443
  retry_policy: @config.rpcs.delete_tenant.retry_policy
453
- options.apply_defaults metadata: @config.metadata,
444
+
445
+ options.apply_defaults timeout: @config.timeout,
446
+ metadata: @config.metadata,
454
447
  retry_policy: @config.retry_policy
455
448
 
456
449
  @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation|
@@ -524,7 +517,9 @@ module Google
524
517
  options.apply_defaults timeout: @config.rpcs.list_tenants.timeout,
525
518
  metadata: metadata,
526
519
  retry_policy: @config.rpcs.list_tenants.retry_policy
527
- options.apply_defaults metadata: @config.metadata,
520
+
521
+ options.apply_defaults timeout: @config.timeout,
522
+ metadata: @config.metadata,
528
523
  retry_policy: @config.retry_policy
529
524
 
530
525
  @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation|
@@ -549,22 +544,21 @@ module Google
549
544
  # Configuration can be applied globally to all clients, or to a single client
550
545
  # on construction.
551
546
  #
552
- # # Examples
553
- #
554
- # To modify the global config, setting the timeout for create_tenant
555
- # to 20 seconds, and all remaining timeouts to 10 seconds:
556
- #
557
- # ::Google::Cloud::Talent::V4beta1::TenantService::Client.configure do |config|
558
- # config.timeout = 10.0
559
- # config.rpcs.create_tenant.timeout = 20.0
560
- # end
547
+ # @example
561
548
  #
562
- # To apply the above configuration only to a new client:
549
+ # # Modify the global config, setting the timeout for
550
+ # # create_tenant to 20 seconds,
551
+ # # and all remaining timeouts to 10 seconds.
552
+ # ::Google::Cloud::Talent::V4beta1::TenantService::Client.configure do |config|
553
+ # config.timeout = 10.0
554
+ # config.rpcs.create_tenant.timeout = 20.0
555
+ # end
563
556
  #
564
- # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config|
565
- # config.timeout = 10.0
566
- # config.rpcs.create_tenant.timeout = 20.0
567
- # end
557
+ # # Apply the above configuration only to a new client.
558
+ # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config|
559
+ # config.timeout = 10.0
560
+ # config.rpcs.create_tenant.timeout = 20.0
561
+ # end
568
562
  #
569
563
  # @!attribute [rw] endpoint
570
564
  # The hostname or hostname:port of the service endpoint.
@@ -628,7 +622,7 @@ module Google
628
622
  config_attr :scope, nil, ::String, ::Array, nil
629
623
  config_attr :lib_name, nil, ::String, nil
630
624
  config_attr :lib_version, nil, ::String, nil
631
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
625
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
632
626
  config_attr :interceptors, nil, ::Array, nil
633
627
  config_attr :timeout, nil, ::Numeric, nil
634
628
  config_attr :metadata, nil, ::Hash, nil
@@ -649,7 +643,7 @@ module Google
649
643
  def rpcs
650
644
  @rpcs ||= begin
651
645
  parent_rpcs = nil
652
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
646
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
653
647
  Rpcs.new parent_rpcs
654
648
  end
655
649
  end
@@ -700,15 +694,15 @@ module Google
700
694
 
701
695
  # @private
702
696
  def initialize parent_rpcs = nil
703
- create_tenant_config = parent_rpcs&.create_tenant if parent_rpcs&.respond_to? :create_tenant
697
+ create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant
704
698
  @create_tenant = ::Gapic::Config::Method.new create_tenant_config
705
- get_tenant_config = parent_rpcs&.get_tenant if parent_rpcs&.respond_to? :get_tenant
699
+ get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant
706
700
  @get_tenant = ::Gapic::Config::Method.new get_tenant_config
707
- update_tenant_config = parent_rpcs&.update_tenant if parent_rpcs&.respond_to? :update_tenant
701
+ update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant
708
702
  @update_tenant = ::Gapic::Config::Method.new update_tenant_config
709
- delete_tenant_config = parent_rpcs&.delete_tenant if parent_rpcs&.respond_to? :delete_tenant
703
+ delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant
710
704
  @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config
711
- list_tenants_config = parent_rpcs&.list_tenants if parent_rpcs&.respond_to? :list_tenants
705
+ list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants
712
706
  @list_tenants = ::Gapic::Config::Method.new list_tenants_config
713
707
 
714
708
  yield self if block_given?