google-cloud-talent-v4 0.10.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/talent/v4/company_service/client.rb +41 -9
  4. data/lib/google/cloud/talent/v4/company_service/rest/client.rb +117 -7
  5. data/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb +14 -2
  6. data/lib/google/cloud/talent/v4/completion/client.rb +41 -9
  7. data/lib/google/cloud/talent/v4/completion/rest/client.rb +49 -7
  8. data/lib/google/cloud/talent/v4/completion/rest/service_stub.rb +14 -2
  9. data/lib/google/cloud/talent/v4/event_service/client.rb +41 -9
  10. data/lib/google/cloud/talent/v4/event_service/rest/client.rb +49 -7
  11. data/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb +14 -2
  12. data/lib/google/cloud/talent/v4/job_service/client.rb +42 -9
  13. data/lib/google/cloud/talent/v4/job_service/operations.rb +38 -7
  14. data/lib/google/cloud/talent/v4/job_service/rest/client.rb +219 -7
  15. data/lib/google/cloud/talent/v4/job_service/rest/operations.rb +108 -8
  16. data/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb +14 -2
  17. data/lib/google/cloud/talent/v4/tenant_service/client.rb +41 -9
  18. data/lib/google/cloud/talent/v4/tenant_service/rest/client.rb +117 -7
  19. data/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb +14 -2
  20. data/lib/google/cloud/talent/v4/version.rb +1 -1
  21. data/proto_docs/google/api/client.rb +14 -0
  22. data/proto_docs/google/api/field_behavior.rb +14 -0
  23. data/proto_docs/google/cloud/talent/v4/common.rb +1 -0
  24. data/proto_docs/google/cloud/talent/v4/company.rb +1 -0
  25. data/proto_docs/google/cloud/talent/v4/job.rb +1 -0
  26. data/proto_docs/google/cloud/talent/v4/job_service.rb +1 -0
  27. metadata +5 -5
@@ -30,6 +30,9 @@ module Google
30
30
  # A service handles auto completion.
31
31
  #
32
32
  class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$"
35
+
33
36
  include Paths
34
37
 
35
38
  # @private
@@ -95,6 +98,15 @@ module Google
95
98
  @config
96
99
  end
97
100
 
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @completion_stub.universe_domain
108
+ end
109
+
98
110
  ##
99
111
  # Create a new Completion client object.
100
112
  #
@@ -128,8 +140,9 @@ module Google
128
140
  credentials = @config.credentials
129
141
  # Use self-signed JWT if the endpoint is unchanged from default,
130
142
  # but only if the default endpoint does not have a region prefix.
131
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
132
- !@config.endpoint.split(".").first.include?("-")
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
133
146
  credentials ||= Credentials.default scope: @config.scope,
134
147
  enable_self_signed_jwt: enable_self_signed_jwt
135
148
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -140,10 +153,13 @@ module Google
140
153
 
141
154
  @completion_stub = ::Gapic::ServiceStub.new(
142
155
  ::Google::Cloud::Talent::V4::Completion::Stub,
143
- credentials: credentials,
144
- endpoint: @config.endpoint,
156
+ credentials: credentials,
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
145
160
  channel_args: @config.channel_args,
146
- interceptors: @config.interceptors
161
+ interceptors: @config.interceptors,
162
+ channel_pool_config: @config.channel_pool
147
163
  )
148
164
  end
149
165
 
@@ -295,9 +311,9 @@ module Google
295
311
  # end
296
312
  #
297
313
  # @!attribute [rw] endpoint
298
- # The hostname or hostname:port of the service endpoint.
299
- # Defaults to `"jobs.googleapis.com"`.
300
- # @return [::String]
314
+ # A custom service endpoint, as a hostname or hostname:port. The default is
315
+ # nil, indicating to use the default endpoint in the current universe domain.
316
+ # @return [::String,nil]
301
317
  # @!attribute [rw] credentials
302
318
  # Credentials to send with calls. You may provide any of the following types:
303
319
  # * (`String`) The path to a service account key file in JSON format
@@ -343,13 +359,20 @@ module Google
343
359
  # @!attribute [rw] quota_project
344
360
  # A separate project against which to charge quota.
345
361
  # @return [::String]
362
+ # @!attribute [rw] universe_domain
363
+ # The universe domain within which to make requests. This determines the
364
+ # default endpoint URL. The default value of nil uses the environment
365
+ # universe (usually the default "googleapis.com" universe).
366
+ # @return [::String,nil]
346
367
  #
347
368
  class Configuration
348
369
  extend ::Gapic::Config
349
370
 
371
+ # @private
372
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
350
373
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
351
374
 
352
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
375
+ config_attr :endpoint, nil, ::String, nil
353
376
  config_attr :credentials, nil do |value|
354
377
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
355
378
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -364,6 +387,7 @@ module Google
364
387
  config_attr :metadata, nil, ::Hash, nil
365
388
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
366
389
  config_attr :quota_project, nil, ::String, nil
390
+ config_attr :universe_domain, nil, ::String, nil
367
391
 
368
392
  # @private
369
393
  def initialize parent_config = nil
@@ -384,6 +408,14 @@ module Google
384
408
  end
385
409
  end
386
410
 
411
+ ##
412
+ # Configuration for the channel pool
413
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
414
+ #
415
+ def channel_pool
416
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
417
+ end
418
+
387
419
  ##
388
420
  # Configuration RPC class for the Completion API.
389
421
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # A service handles auto completion.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -97,6 +100,15 @@ module Google
97
100
  @config
98
101
  end
99
102
 
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @completion_stub.universe_domain
110
+ end
111
+
100
112
  ##
101
113
  # Create a new Completion REST client object.
102
114
  #
@@ -124,8 +136,9 @@ module Google
124
136
  credentials = @config.credentials
125
137
  # Use self-signed JWT if the endpoint is unchanged from default,
126
138
  # but only if the default endpoint does not have a region prefix.
127
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
128
- !@config.endpoint.split(".").first.include?("-")
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
129
142
  credentials ||= Credentials.default scope: @config.scope,
130
143
  enable_self_signed_jwt: enable_self_signed_jwt
131
144
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -135,7 +148,12 @@ module Google
135
148
  @quota_project_id = @config.quota_project
136
149
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
150
 
138
- @completion_stub = ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
151
+ @completion_stub = ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.new(
152
+ endpoint: @config.endpoint,
153
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
+ universe_domain: @config.universe_domain,
155
+ credentials: credentials
156
+ )
139
157
  end
140
158
 
141
159
  # Service calls
@@ -198,6 +216,22 @@ module Google
198
216
  # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse]
199
217
  #
200
218
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
219
+ #
220
+ # @example Basic example
221
+ # require "google/cloud/talent/v4"
222
+ #
223
+ # # Create a client object. The client can be reused for multiple calls.
224
+ # client = Google::Cloud::Talent::V4::Completion::Rest::Client.new
225
+ #
226
+ # # Create a request. To set request fields, pass in keyword arguments.
227
+ # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new
228
+ #
229
+ # # Call the complete_query method.
230
+ # result = client.complete_query request
231
+ #
232
+ # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse.
233
+ # p result
234
+ #
201
235
  def complete_query request, options = nil
202
236
  raise ::ArgumentError, "request must be provided" if request.nil?
203
237
 
@@ -263,9 +297,9 @@ module Google
263
297
  # end
264
298
  #
265
299
  # @!attribute [rw] endpoint
266
- # The hostname or hostname:port of the service endpoint.
267
- # Defaults to `"jobs.googleapis.com"`.
268
- # @return [::String]
300
+ # A custom service endpoint, as a hostname or hostname:port. The default is
301
+ # nil, indicating to use the default endpoint in the current universe domain.
302
+ # @return [::String,nil]
269
303
  # @!attribute [rw] credentials
270
304
  # Credentials to send with calls. You may provide any of the following types:
271
305
  # * (`String`) The path to a service account key file in JSON format
@@ -302,13 +336,20 @@ module Google
302
336
  # @!attribute [rw] quota_project
303
337
  # A separate project against which to charge quota.
304
338
  # @return [::String]
339
+ # @!attribute [rw] universe_domain
340
+ # The universe domain within which to make requests. This determines the
341
+ # default endpoint URL. The default value of nil uses the environment
342
+ # universe (usually the default "googleapis.com" universe).
343
+ # @return [::String,nil]
305
344
  #
306
345
  class Configuration
307
346
  extend ::Gapic::Config
308
347
 
348
+ # @private
349
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
309
350
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
310
351
 
311
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
352
+ config_attr :endpoint, nil, ::String, nil
312
353
  config_attr :credentials, nil do |value|
313
354
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
314
355
  allowed.any? { |klass| klass === value }
@@ -320,6 +361,7 @@ module Google
320
361
  config_attr :metadata, nil, ::Hash, nil
321
362
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
322
363
  config_attr :quota_project, nil, ::String, nil
364
+ config_attr :universe_domain, nil, ::String, nil
323
365
 
324
366
  # @private
325
367
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
43
55
  ##
44
56
  # Baseline implementation for the complete_query REST call
45
57
  #
@@ -30,6 +30,9 @@ module Google
30
30
  # A service handles client event report.
31
31
  #
32
32
  class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$"
35
+
33
36
  include Paths
34
37
 
35
38
  # @private
@@ -92,6 +95,15 @@ module Google
92
95
  @config
93
96
  end
94
97
 
98
+ ##
99
+ # The effective universe domain
100
+ #
101
+ # @return [String]
102
+ #
103
+ def universe_domain
104
+ @event_service_stub.universe_domain
105
+ end
106
+
95
107
  ##
96
108
  # Create a new EventService client object.
97
109
  #
@@ -125,8 +137,9 @@ module Google
125
137
  credentials = @config.credentials
126
138
  # Use self-signed JWT if the endpoint is unchanged from default,
127
139
  # but only if the default endpoint does not have a region prefix.
128
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
129
- !@config.endpoint.split(".").first.include?("-")
140
+ enable_self_signed_jwt = @config.endpoint.nil? ||
141
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
+ !@config.endpoint.split(".").first.include?("-"))
130
143
  credentials ||= Credentials.default scope: @config.scope,
131
144
  enable_self_signed_jwt: enable_self_signed_jwt
132
145
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -137,10 +150,13 @@ module Google
137
150
 
138
151
  @event_service_stub = ::Gapic::ServiceStub.new(
139
152
  ::Google::Cloud::Talent::V4::EventService::Stub,
140
- credentials: credentials,
141
- endpoint: @config.endpoint,
153
+ credentials: credentials,
154
+ endpoint: @config.endpoint,
155
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
156
+ universe_domain: @config.universe_domain,
142
157
  channel_args: @config.channel_args,
143
- interceptors: @config.interceptors
158
+ interceptors: @config.interceptors,
159
+ channel_pool_config: @config.channel_pool
144
160
  )
145
161
  end
146
162
 
@@ -273,9 +289,9 @@ module Google
273
289
  # end
274
290
  #
275
291
  # @!attribute [rw] endpoint
276
- # The hostname or hostname:port of the service endpoint.
277
- # Defaults to `"jobs.googleapis.com"`.
278
- # @return [::String]
292
+ # A custom service endpoint, as a hostname or hostname:port. The default is
293
+ # nil, indicating to use the default endpoint in the current universe domain.
294
+ # @return [::String,nil]
279
295
  # @!attribute [rw] credentials
280
296
  # Credentials to send with calls. You may provide any of the following types:
281
297
  # * (`String`) The path to a service account key file in JSON format
@@ -321,13 +337,20 @@ module Google
321
337
  # @!attribute [rw] quota_project
322
338
  # A separate project against which to charge quota.
323
339
  # @return [::String]
340
+ # @!attribute [rw] universe_domain
341
+ # The universe domain within which to make requests. This determines the
342
+ # default endpoint URL. The default value of nil uses the environment
343
+ # universe (usually the default "googleapis.com" universe).
344
+ # @return [::String,nil]
324
345
  #
325
346
  class Configuration
326
347
  extend ::Gapic::Config
327
348
 
349
+ # @private
350
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
328
351
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
329
352
 
330
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
353
+ config_attr :endpoint, nil, ::String, nil
331
354
  config_attr :credentials, nil do |value|
332
355
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
333
356
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -342,6 +365,7 @@ module Google
342
365
  config_attr :metadata, nil, ::Hash, nil
343
366
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
344
367
  config_attr :quota_project, nil, ::String, nil
368
+ config_attr :universe_domain, nil, ::String, nil
345
369
 
346
370
  # @private
347
371
  def initialize parent_config = nil
@@ -362,6 +386,14 @@ module Google
362
386
  end
363
387
  end
364
388
 
389
+ ##
390
+ # Configuration for the channel pool
391
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
392
+ #
393
+ def channel_pool
394
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
395
+ end
396
+
365
397
  ##
366
398
  # Configuration RPC class for the EventService API.
367
399
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # A service handles client event report.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -94,6 +97,15 @@ module Google
94
97
  @config
95
98
  end
96
99
 
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @event_service_stub.universe_domain
107
+ end
108
+
97
109
  ##
98
110
  # Create a new EventService REST client object.
99
111
  #
@@ -121,8 +133,9 @@ module Google
121
133
  credentials = @config.credentials
122
134
  # Use self-signed JWT if the endpoint is unchanged from default,
123
135
  # but only if the default endpoint does not have a region prefix.
124
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
125
- !@config.endpoint.split(".").first.include?("-")
136
+ enable_self_signed_jwt = @config.endpoint.nil? ||
137
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
138
+ !@config.endpoint.split(".").first.include?("-"))
126
139
  credentials ||= Credentials.default scope: @config.scope,
127
140
  enable_self_signed_jwt: enable_self_signed_jwt
128
141
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -132,7 +145,12 @@ module Google
132
145
  @quota_project_id = @config.quota_project
133
146
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
134
147
 
135
- @event_service_stub = ::Google::Cloud::Talent::V4::EventService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
148
+ @event_service_stub = ::Google::Cloud::Talent::V4::EventService::Rest::ServiceStub.new(
149
+ endpoint: @config.endpoint,
150
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
151
+ universe_domain: @config.universe_domain,
152
+ credentials: credentials
153
+ )
136
154
  end
137
155
 
138
156
  # Service calls
@@ -176,6 +194,22 @@ module Google
176
194
  # @return [::Google::Cloud::Talent::V4::ClientEvent]
177
195
  #
178
196
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
197
+ #
198
+ # @example Basic example
199
+ # require "google/cloud/talent/v4"
200
+ #
201
+ # # Create a client object. The client can be reused for multiple calls.
202
+ # client = Google::Cloud::Talent::V4::EventService::Rest::Client.new
203
+ #
204
+ # # Create a request. To set request fields, pass in keyword arguments.
205
+ # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new
206
+ #
207
+ # # Call the create_client_event method.
208
+ # result = client.create_client_event request
209
+ #
210
+ # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent.
211
+ # p result
212
+ #
179
213
  def create_client_event request, options = nil
180
214
  raise ::ArgumentError, "request must be provided" if request.nil?
181
215
 
@@ -241,9 +275,9 @@ module Google
241
275
  # end
242
276
  #
243
277
  # @!attribute [rw] endpoint
244
- # The hostname or hostname:port of the service endpoint.
245
- # Defaults to `"jobs.googleapis.com"`.
246
- # @return [::String]
278
+ # A custom service endpoint, as a hostname or hostname:port. The default is
279
+ # nil, indicating to use the default endpoint in the current universe domain.
280
+ # @return [::String,nil]
247
281
  # @!attribute [rw] credentials
248
282
  # Credentials to send with calls. You may provide any of the following types:
249
283
  # * (`String`) The path to a service account key file in JSON format
@@ -280,13 +314,20 @@ module Google
280
314
  # @!attribute [rw] quota_project
281
315
  # A separate project against which to charge quota.
282
316
  # @return [::String]
317
+ # @!attribute [rw] universe_domain
318
+ # The universe domain within which to make requests. This determines the
319
+ # default endpoint URL. The default value of nil uses the environment
320
+ # universe (usually the default "googleapis.com" universe).
321
+ # @return [::String,nil]
283
322
  #
284
323
  class Configuration
285
324
  extend ::Gapic::Config
286
325
 
326
+ # @private
327
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
287
328
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
288
329
 
289
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
330
+ config_attr :endpoint, nil, ::String, nil
290
331
  config_attr :credentials, nil do |value|
291
332
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
292
333
  allowed.any? { |klass| klass === value }
@@ -298,6 +339,7 @@ module Google
298
339
  config_attr :metadata, nil, ::Hash, nil
299
340
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
300
341
  config_attr :quota_project, nil, ::String, nil
342
+ config_attr :universe_domain, nil, ::String, nil
301
343
 
302
344
  # @private
303
345
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
43
55
  ##
44
56
  # Baseline implementation for the create_client_event REST call
45
57
  #
@@ -30,6 +30,9 @@ module Google
30
30
  # A service handles job management, including job CRUD, enumeration and search.
31
31
  #
32
32
  class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$"
35
+
33
36
  include Paths
34
37
 
35
38
  # @private
@@ -117,6 +120,15 @@ module Google
117
120
  @config
118
121
  end
119
122
 
123
+ ##
124
+ # The effective universe domain
125
+ #
126
+ # @return [String]
127
+ #
128
+ def universe_domain
129
+ @job_service_stub.universe_domain
130
+ end
131
+
120
132
  ##
121
133
  # Create a new JobService client object.
122
134
  #
@@ -150,8 +162,9 @@ module Google
150
162
  credentials = @config.credentials
151
163
  # Use self-signed JWT if the endpoint is unchanged from default,
152
164
  # but only if the default endpoint does not have a region prefix.
153
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
154
- !@config.endpoint.split(".").first.include?("-")
165
+ enable_self_signed_jwt = @config.endpoint.nil? ||
166
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
167
+ !@config.endpoint.split(".").first.include?("-"))
155
168
  credentials ||= Credentials.default scope: @config.scope,
156
169
  enable_self_signed_jwt: enable_self_signed_jwt
157
170
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -164,14 +177,18 @@ module Google
164
177
  config.credentials = credentials
165
178
  config.quota_project = @quota_project_id
166
179
  config.endpoint = @config.endpoint
180
+ config.universe_domain = @config.universe_domain
167
181
  end
168
182
 
169
183
  @job_service_stub = ::Gapic::ServiceStub.new(
170
184
  ::Google::Cloud::Talent::V4::JobService::Stub,
171
- credentials: credentials,
172
- endpoint: @config.endpoint,
185
+ credentials: credentials,
186
+ endpoint: @config.endpoint,
187
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
188
+ universe_domain: @config.universe_domain,
173
189
  channel_args: @config.channel_args,
174
- interceptors: @config.interceptors
190
+ interceptors: @config.interceptors,
191
+ channel_pool_config: @config.channel_pool
175
192
  )
176
193
  end
177
194
 
@@ -1767,9 +1784,9 @@ module Google
1767
1784
  # end
1768
1785
  #
1769
1786
  # @!attribute [rw] endpoint
1770
- # The hostname or hostname:port of the service endpoint.
1771
- # Defaults to `"jobs.googleapis.com"`.
1772
- # @return [::String]
1787
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1788
+ # nil, indicating to use the default endpoint in the current universe domain.
1789
+ # @return [::String,nil]
1773
1790
  # @!attribute [rw] credentials
1774
1791
  # Credentials to send with calls. You may provide any of the following types:
1775
1792
  # * (`String`) The path to a service account key file in JSON format
@@ -1815,13 +1832,20 @@ module Google
1815
1832
  # @!attribute [rw] quota_project
1816
1833
  # A separate project against which to charge quota.
1817
1834
  # @return [::String]
1835
+ # @!attribute [rw] universe_domain
1836
+ # The universe domain within which to make requests. This determines the
1837
+ # default endpoint URL. The default value of nil uses the environment
1838
+ # universe (usually the default "googleapis.com" universe).
1839
+ # @return [::String,nil]
1818
1840
  #
1819
1841
  class Configuration
1820
1842
  extend ::Gapic::Config
1821
1843
 
1844
+ # @private
1845
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1822
1846
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
1823
1847
 
1824
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1848
+ config_attr :endpoint, nil, ::String, nil
1825
1849
  config_attr :credentials, nil do |value|
1826
1850
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1827
1851
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1836,6 +1860,7 @@ module Google
1836
1860
  config_attr :metadata, nil, ::Hash, nil
1837
1861
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1838
1862
  config_attr :quota_project, nil, ::String, nil
1863
+ config_attr :universe_domain, nil, ::String, nil
1839
1864
 
1840
1865
  # @private
1841
1866
  def initialize parent_config = nil
@@ -1856,6 +1881,14 @@ module Google
1856
1881
  end
1857
1882
  end
1858
1883
 
1884
+ ##
1885
+ # Configuration for the channel pool
1886
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1887
+ #
1888
+ def channel_pool
1889
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1890
+ end
1891
+
1859
1892
  ##
1860
1893
  # Configuration RPC class for the JobService API.
1861
1894
  #