google-cloud-talent-v4beta1 0.8.1 → 0.10.0

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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/talent/v4beta1/company_service/client.rb +41 -9
  4. data/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +117 -7
  5. data/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +14 -2
  6. data/lib/google/cloud/talent/v4beta1/completion/client.rb +41 -9
  7. data/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +49 -7
  8. data/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +14 -2
  9. data/lib/google/cloud/talent/v4beta1/event_service/client.rb +41 -9
  10. data/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +49 -7
  11. data/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +14 -2
  12. data/lib/google/cloud/talent/v4beta1/job_service/client.rb +42 -9
  13. data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +38 -7
  14. data/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +212 -7
  15. data/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +108 -8
  16. data/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +14 -2
  17. data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +41 -9
  18. data/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +117 -7
  19. data/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +14 -2
  20. data/lib/google/cloud/talent/v4beta1/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/v4beta1/common.rb +1 -0
  24. data/proto_docs/google/cloud/talent/v4beta1/company.rb +1 -0
  25. data/proto_docs/google/cloud/talent/v4beta1/job.rb +1 -0
  26. data/proto_docs/google/cloud/talent/v4beta1/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::V4beta1::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
 
@@ -301,9 +317,9 @@ module Google
301
317
  # end
302
318
  #
303
319
  # @!attribute [rw] endpoint
304
- # The hostname or hostname:port of the service endpoint.
305
- # Defaults to `"jobs.googleapis.com"`.
306
- # @return [::String]
320
+ # A custom service endpoint, as a hostname or hostname:port. The default is
321
+ # nil, indicating to use the default endpoint in the current universe domain.
322
+ # @return [::String,nil]
307
323
  # @!attribute [rw] credentials
308
324
  # Credentials to send with calls. You may provide any of the following types:
309
325
  # * (`String`) The path to a service account key file in JSON format
@@ -349,13 +365,20 @@ module Google
349
365
  # @!attribute [rw] quota_project
350
366
  # A separate project against which to charge quota.
351
367
  # @return [::String]
368
+ # @!attribute [rw] universe_domain
369
+ # The universe domain within which to make requests. This determines the
370
+ # default endpoint URL. The default value of nil uses the environment
371
+ # universe (usually the default "googleapis.com" universe).
372
+ # @return [::String,nil]
352
373
  #
353
374
  class Configuration
354
375
  extend ::Gapic::Config
355
376
 
377
+ # @private
378
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
356
379
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
357
380
 
358
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
381
+ config_attr :endpoint, nil, ::String, nil
359
382
  config_attr :credentials, nil do |value|
360
383
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
361
384
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -370,6 +393,7 @@ module Google
370
393
  config_attr :metadata, nil, ::Hash, nil
371
394
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
372
395
  config_attr :quota_project, nil, ::String, nil
396
+ config_attr :universe_domain, nil, ::String, nil
373
397
 
374
398
  # @private
375
399
  def initialize parent_config = nil
@@ -390,6 +414,14 @@ module Google
390
414
  end
391
415
  end
392
416
 
417
+ ##
418
+ # Configuration for the channel pool
419
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
420
+ #
421
+ def channel_pool
422
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
423
+ end
424
+
393
425
  ##
394
426
  # Configuration RPC class for the Completion API.
395
427
  #
@@ -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::V4beta1::Completion::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
151
+ @completion_stub = ::Google::Cloud::Talent::V4beta1::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
@@ -204,6 +222,22 @@ module Google
204
222
  # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
205
223
  #
206
224
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
225
+ #
226
+ # @example Basic example
227
+ # require "google/cloud/talent/v4beta1"
228
+ #
229
+ # # Create a client object. The client can be reused for multiple calls.
230
+ # client = Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new
231
+ #
232
+ # # Create a request. To set request fields, pass in keyword arguments.
233
+ # request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new
234
+ #
235
+ # # Call the complete_query method.
236
+ # result = client.complete_query request
237
+ #
238
+ # # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse.
239
+ # p result
240
+ #
207
241
  def complete_query request, options = nil
208
242
  raise ::ArgumentError, "request must be provided" if request.nil?
209
243
 
@@ -269,9 +303,9 @@ module Google
269
303
  # end
270
304
  #
271
305
  # @!attribute [rw] endpoint
272
- # The hostname or hostname:port of the service endpoint.
273
- # Defaults to `"jobs.googleapis.com"`.
274
- # @return [::String]
306
+ # A custom service endpoint, as a hostname or hostname:port. The default is
307
+ # nil, indicating to use the default endpoint in the current universe domain.
308
+ # @return [::String,nil]
275
309
  # @!attribute [rw] credentials
276
310
  # Credentials to send with calls. You may provide any of the following types:
277
311
  # * (`String`) The path to a service account key file in JSON format
@@ -308,13 +342,20 @@ module Google
308
342
  # @!attribute [rw] quota_project
309
343
  # A separate project against which to charge quota.
310
344
  # @return [::String]
345
+ # @!attribute [rw] universe_domain
346
+ # The universe domain within which to make requests. This determines the
347
+ # default endpoint URL. The default value of nil uses the environment
348
+ # universe (usually the default "googleapis.com" universe).
349
+ # @return [::String,nil]
311
350
  #
312
351
  class Configuration
313
352
  extend ::Gapic::Config
314
353
 
354
+ # @private
355
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
315
356
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
316
357
 
317
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
358
+ config_attr :endpoint, nil, ::String, nil
318
359
  config_attr :credentials, nil do |value|
319
360
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
320
361
  allowed.any? { |klass| klass === value }
@@ -326,6 +367,7 @@ module Google
326
367
  config_attr :metadata, nil, ::Hash, nil
327
368
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
328
369
  config_attr :quota_project, nil, ::String, nil
370
+ config_attr :universe_domain, nil, ::String, nil
329
371
 
330
372
  # @private
331
373
  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::V4beta1::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
 
@@ -274,9 +290,9 @@ module Google
274
290
  # end
275
291
  #
276
292
  # @!attribute [rw] endpoint
277
- # The hostname or hostname:port of the service endpoint.
278
- # Defaults to `"jobs.googleapis.com"`.
279
- # @return [::String]
293
+ # A custom service endpoint, as a hostname or hostname:port. The default is
294
+ # nil, indicating to use the default endpoint in the current universe domain.
295
+ # @return [::String,nil]
280
296
  # @!attribute [rw] credentials
281
297
  # Credentials to send with calls. You may provide any of the following types:
282
298
  # * (`String`) The path to a service account key file in JSON format
@@ -322,13 +338,20 @@ module Google
322
338
  # @!attribute [rw] quota_project
323
339
  # A separate project against which to charge quota.
324
340
  # @return [::String]
341
+ # @!attribute [rw] universe_domain
342
+ # The universe domain within which to make requests. This determines the
343
+ # default endpoint URL. The default value of nil uses the environment
344
+ # universe (usually the default "googleapis.com" universe).
345
+ # @return [::String,nil]
325
346
  #
326
347
  class Configuration
327
348
  extend ::Gapic::Config
328
349
 
350
+ # @private
351
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
329
352
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
330
353
 
331
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
354
+ config_attr :endpoint, nil, ::String, nil
332
355
  config_attr :credentials, nil do |value|
333
356
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
334
357
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -343,6 +366,7 @@ module Google
343
366
  config_attr :metadata, nil, ::Hash, nil
344
367
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
345
368
  config_attr :quota_project, nil, ::String, nil
369
+ config_attr :universe_domain, nil, ::String, nil
346
370
 
347
371
  # @private
348
372
  def initialize parent_config = nil
@@ -363,6 +387,14 @@ module Google
363
387
  end
364
388
  end
365
389
 
390
+ ##
391
+ # Configuration for the channel pool
392
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
393
+ #
394
+ def channel_pool
395
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
396
+ end
397
+
366
398
  ##
367
399
  # Configuration RPC class for the EventService API.
368
400
  #
@@ -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::V4beta1::EventService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
148
+ @event_service_stub = ::Google::Cloud::Talent::V4beta1::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
@@ -177,6 +195,22 @@ module Google
177
195
  # @return [::Google::Cloud::Talent::V4beta1::ClientEvent]
178
196
  #
179
197
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
198
+ #
199
+ # @example Basic example
200
+ # require "google/cloud/talent/v4beta1"
201
+ #
202
+ # # Create a client object. The client can be reused for multiple calls.
203
+ # client = Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new
204
+ #
205
+ # # Create a request. To set request fields, pass in keyword arguments.
206
+ # request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new
207
+ #
208
+ # # Call the create_client_event method.
209
+ # result = client.create_client_event request
210
+ #
211
+ # # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent.
212
+ # p result
213
+ #
180
214
  def create_client_event request, options = nil
181
215
  raise ::ArgumentError, "request must be provided" if request.nil?
182
216
 
@@ -242,9 +276,9 @@ module Google
242
276
  # end
243
277
  #
244
278
  # @!attribute [rw] endpoint
245
- # The hostname or hostname:port of the service endpoint.
246
- # Defaults to `"jobs.googleapis.com"`.
247
- # @return [::String]
279
+ # A custom service endpoint, as a hostname or hostname:port. The default is
280
+ # nil, indicating to use the default endpoint in the current universe domain.
281
+ # @return [::String,nil]
248
282
  # @!attribute [rw] credentials
249
283
  # Credentials to send with calls. You may provide any of the following types:
250
284
  # * (`String`) The path to a service account key file in JSON format
@@ -281,13 +315,20 @@ module Google
281
315
  # @!attribute [rw] quota_project
282
316
  # A separate project against which to charge quota.
283
317
  # @return [::String]
318
+ # @!attribute [rw] universe_domain
319
+ # The universe domain within which to make requests. This determines the
320
+ # default endpoint URL. The default value of nil uses the environment
321
+ # universe (usually the default "googleapis.com" universe).
322
+ # @return [::String,nil]
284
323
  #
285
324
  class Configuration
286
325
  extend ::Gapic::Config
287
326
 
327
+ # @private
328
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
288
329
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
289
330
 
290
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
331
+ config_attr :endpoint, nil, ::String, nil
291
332
  config_attr :credentials, nil do |value|
292
333
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
293
334
  allowed.any? { |klass| klass === value }
@@ -299,6 +340,7 @@ module Google
299
340
  config_attr :metadata, nil, ::Hash, nil
300
341
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
301
342
  config_attr :quota_project, nil, ::String, nil
343
+ config_attr :universe_domain, nil, ::String, nil
302
344
 
303
345
  # @private
304
346
  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
@@ -119,6 +122,15 @@ module Google
119
122
  @config
120
123
  end
121
124
 
125
+ ##
126
+ # The effective universe domain
127
+ #
128
+ # @return [String]
129
+ #
130
+ def universe_domain
131
+ @job_service_stub.universe_domain
132
+ end
133
+
122
134
  ##
123
135
  # Create a new JobService client object.
124
136
  #
@@ -152,8 +164,9 @@ module Google
152
164
  credentials = @config.credentials
153
165
  # Use self-signed JWT if the endpoint is unchanged from default,
154
166
  # but only if the default endpoint does not have a region prefix.
155
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
156
- !@config.endpoint.split(".").first.include?("-")
167
+ enable_self_signed_jwt = @config.endpoint.nil? ||
168
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
169
+ !@config.endpoint.split(".").first.include?("-"))
157
170
  credentials ||= Credentials.default scope: @config.scope,
158
171
  enable_self_signed_jwt: enable_self_signed_jwt
159
172
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -166,14 +179,18 @@ module Google
166
179
  config.credentials = credentials
167
180
  config.quota_project = @quota_project_id
168
181
  config.endpoint = @config.endpoint
182
+ config.universe_domain = @config.universe_domain
169
183
  end
170
184
 
171
185
  @job_service_stub = ::Gapic::ServiceStub.new(
172
186
  ::Google::Cloud::Talent::V4beta1::JobService::Stub,
173
- credentials: credentials,
174
- endpoint: @config.endpoint,
187
+ credentials: credentials,
188
+ endpoint: @config.endpoint,
189
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
190
+ universe_domain: @config.universe_domain,
175
191
  channel_args: @config.channel_args,
176
- interceptors: @config.interceptors
192
+ interceptors: @config.interceptors,
193
+ channel_pool_config: @config.channel_pool
177
194
  )
178
195
  end
179
196
 
@@ -1789,9 +1806,9 @@ module Google
1789
1806
  # end
1790
1807
  #
1791
1808
  # @!attribute [rw] endpoint
1792
- # The hostname or hostname:port of the service endpoint.
1793
- # Defaults to `"jobs.googleapis.com"`.
1794
- # @return [::String]
1809
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1810
+ # nil, indicating to use the default endpoint in the current universe domain.
1811
+ # @return [::String,nil]
1795
1812
  # @!attribute [rw] credentials
1796
1813
  # Credentials to send with calls. You may provide any of the following types:
1797
1814
  # * (`String`) The path to a service account key file in JSON format
@@ -1837,13 +1854,20 @@ module Google
1837
1854
  # @!attribute [rw] quota_project
1838
1855
  # A separate project against which to charge quota.
1839
1856
  # @return [::String]
1857
+ # @!attribute [rw] universe_domain
1858
+ # The universe domain within which to make requests. This determines the
1859
+ # default endpoint URL. The default value of nil uses the environment
1860
+ # universe (usually the default "googleapis.com" universe).
1861
+ # @return [::String,nil]
1840
1862
  #
1841
1863
  class Configuration
1842
1864
  extend ::Gapic::Config
1843
1865
 
1866
+ # @private
1867
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1844
1868
  DEFAULT_ENDPOINT = "jobs.googleapis.com"
1845
1869
 
1846
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1870
+ config_attr :endpoint, nil, ::String, nil
1847
1871
  config_attr :credentials, nil do |value|
1848
1872
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1849
1873
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1858,6 +1882,7 @@ module Google
1858
1882
  config_attr :metadata, nil, ::Hash, nil
1859
1883
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1860
1884
  config_attr :quota_project, nil, ::String, nil
1885
+ config_attr :universe_domain, nil, ::String, nil
1861
1886
 
1862
1887
  # @private
1863
1888
  def initialize parent_config = nil
@@ -1878,6 +1903,14 @@ module Google
1878
1903
  end
1879
1904
  end
1880
1905
 
1906
+ ##
1907
+ # Configuration for the channel pool
1908
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1909
+ #
1910
+ def channel_pool
1911
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1912
+ end
1913
+
1881
1914
  ##
1882
1915
  # Configuration RPC class for the JobService API.
1883
1916
  #