google-cloud-talent-v4 0.1.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +188 -190
  3. data/README.md +66 -2
  4. data/lib/google/cloud/talent/v4.rb +3 -0
  5. data/lib/google/cloud/talent/v4/common_pb.rb +1 -3
  6. data/lib/google/cloud/talent/v4/company_pb.rb +1 -1
  7. data/lib/google/cloud/talent/v4/company_service/client.rb +31 -30
  8. data/lib/google/cloud/talent/v4/company_service_services_pb.rb +1 -1
  9. data/lib/google/cloud/talent/v4/completion/client.rb +17 -13
  10. data/lib/google/cloud/talent/v4/completion_service_pb.rb +1 -1
  11. data/lib/google/cloud/talent/v4/completion_service_services_pb.rb +1 -1
  12. data/lib/google/cloud/talent/v4/event_pb.rb +1 -1
  13. data/lib/google/cloud/talent/v4/event_service/client.rb +14 -8
  14. data/lib/google/cloud/talent/v4/event_service_services_pb.rb +1 -1
  15. data/lib/google/cloud/talent/v4/filters_pb.rb +1 -1
  16. data/lib/google/cloud/talent/v4/job_pb.rb +1 -1
  17. data/lib/google/cloud/talent/v4/job_service/client.rb +30 -24
  18. data/lib/google/cloud/talent/v4/job_service/operations.rb +95 -10
  19. data/lib/google/cloud/talent/v4/job_service_services_pb.rb +1 -1
  20. data/lib/google/cloud/talent/v4/tenant_pb.rb +1 -1
  21. data/lib/google/cloud/talent/v4/tenant_service/client.rb +28 -25
  22. data/lib/google/cloud/talent/v4/tenant_service_services_pb.rb +1 -1
  23. data/lib/google/cloud/talent/v4/version.rb +1 -1
  24. data/proto_docs/google/api/field_behavior.rb +6 -0
  25. data/proto_docs/google/cloud/talent/v4/common.rb +56 -122
  26. data/proto_docs/google/cloud/talent/v4/company.rb +4 -7
  27. data/proto_docs/google/cloud/talent/v4/company_service.rb +6 -11
  28. data/proto_docs/google/cloud/talent/v4/completion_service.rb +10 -21
  29. data/proto_docs/google/cloud/talent/v4/event.rb +9 -17
  30. data/proto_docs/google/cloud/talent/v4/event_service.rb +2 -2
  31. data/proto_docs/google/cloud/talent/v4/filters.rb +34 -51
  32. data/proto_docs/google/cloud/talent/v4/histogram.rb +2 -6
  33. data/proto_docs/google/cloud/talent/v4/job.rb +55 -83
  34. data/proto_docs/google/cloud/talent/v4/tenant.rb +1 -2
  35. data/proto_docs/google/cloud/talent/v4/tenant_service.rb +3 -6
  36. data/proto_docs/google/longrunning/operations.rb +17 -3
  37. data/proto_docs/google/protobuf/any.rb +5 -2
  38. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  39. data/proto_docs/google/type/latlng.rb +2 -2
  40. metadata +19 -11
@@ -37,3 +37,6 @@ module Google
37
37
  end
38
38
  end
39
39
  end
40
+
41
+ helper_path = ::File.join __dir__, "v4", "_helpers.rb"
42
+ require "google/cloud/talent/v4/_helpers" if ::File.file? helper_path
@@ -3,13 +3,13 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/field_behavior_pb'
8
7
  require 'google/protobuf/timestamp_pb'
9
8
  require 'google/protobuf/wrappers_pb'
10
9
  require 'google/type/latlng_pb'
11
10
  require 'google/type/money_pb'
12
11
  require 'google/type/postal_address_pb'
12
+ require 'google/api/annotations_pb'
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_file("google/cloud/talent/v4/common.proto", :syntax => :proto3) do
15
15
  add_message "google.cloud.talent.v4.TimestampRange" do
@@ -238,8 +238,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
238
238
  value :COMMUTE_METHOD_UNSPECIFIED, 0
239
239
  value :DRIVING, 1
240
240
  value :TRANSIT, 2
241
- value :WALKING, 3
242
- value :CYCLING, 4
243
241
  end
244
242
  end
245
243
  end
@@ -3,10 +3,10 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/field_behavior_pb'
8
7
  require 'google/api/resource_pb'
9
8
  require 'google/cloud/talent/v4/common_pb'
9
+ require 'google/api/annotations_pb'
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/cloud/talent/v4/company.proto", :syntax => :proto3) do
12
12
  add_message "google.cloud.talent.v4.Company" do
@@ -60,7 +60,7 @@ module Google
60
60
  parent_config = while namespace.any?
61
61
  parent_name = namespace.join "::"
62
62
  parent_const = const_get parent_name
63
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
64
  namespace.pop
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
@@ -70,9 +70,9 @@ module Google
70
70
  default_config.rpcs.get_company.timeout = 30.0
71
71
  default_config.rpcs.get_company.retry_policy = {
72
72
  initial_delay: 0.1,
73
- max_delay: 60.0,
74
- multiplier: 1.3,
75
- retry_codes: [4, 14]
73
+ max_delay: 60.0,
74
+ multiplier: 1.3,
75
+ retry_codes: [4, 14]
76
76
  }
77
77
 
78
78
  default_config.rpcs.update_company.timeout = 30.0
@@ -80,17 +80,17 @@ module Google
80
80
  default_config.rpcs.delete_company.timeout = 30.0
81
81
  default_config.rpcs.delete_company.retry_policy = {
82
82
  initial_delay: 0.1,
83
- max_delay: 60.0,
84
- multiplier: 1.3,
85
- retry_codes: [4, 14]
83
+ max_delay: 60.0,
84
+ multiplier: 1.3,
85
+ retry_codes: [4, 14]
86
86
  }
87
87
 
88
88
  default_config.rpcs.list_companies.timeout = 30.0
89
89
  default_config.rpcs.list_companies.retry_policy = {
90
90
  initial_delay: 0.1,
91
- max_delay: 60.0,
92
- multiplier: 1.3,
93
- retry_codes: [4, 14]
91
+ max_delay: 60.0,
92
+ multiplier: 1.3,
93
+ retry_codes: [4, 14]
94
94
  }
95
95
 
96
96
  default_config
@@ -154,7 +154,13 @@ module Google
154
154
 
155
155
  # Create credentials
156
156
  credentials = @config.credentials
157
- credentials ||= Credentials.default scope: @config.scope
157
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
158
+ # 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 &&
161
+ !@config.endpoint.split(".").first.include?("-")
162
+ credentials ||= Credentials.default scope: @config.scope,
163
+ enable_self_signed_jwt: enable_self_signed_jwt
158
164
  if credentials.is_a?(String) || credentials.is_a?(Hash)
159
165
  credentials = Credentials.new credentials, scope: @config.scope
160
166
  end
@@ -332,19 +338,15 @@ module Google
332
338
  # the default parameter values, pass an empty Hash as a request object (see above).
333
339
  #
334
340
  # @param company [::Google::Cloud::Talent::V4::Company, ::Hash]
335
- # Required. The company resource to replace the current resource in the
336
- # system.
341
+ # Required. The company resource to replace the current resource in the system.
337
342
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
338
343
  # Strongly recommended for the best service experience.
339
344
  #
340
- # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask}
341
- # is provided, only the specified fields in
342
- # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated.
343
- # Otherwise all the fields are updated.
345
+ # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} is provided, only the specified fields in
346
+ # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. Otherwise all the fields are updated.
344
347
  #
345
348
  # A field mask to specify the company fields to be updated. Only
346
- # top level fields of {::Google::Cloud::Talent::V4::Company Company} are
347
- # supported.
349
+ # top level fields of {::Google::Cloud::Talent::V4::Company Company} are supported.
348
350
  #
349
351
  # @yield [response, operation] Access the result along with the RPC operation
350
352
  # @yieldparam response [::Google::Cloud::Talent::V4::Company]
@@ -495,9 +497,8 @@ module Google
495
497
  #
496
498
  # Defaults to false.
497
499
  #
498
- # If true, at most
499
- # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of
500
- # companies are fetched, among which only those with open jobs are returned.
500
+ # If true, at most {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of companies are fetched, among which
501
+ # only those with open jobs are returned.
501
502
  #
502
503
  # @yield [response, operation] Access the result along with the RPC operation
503
504
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>]
@@ -637,7 +638,7 @@ module Google
637
638
  config_attr :scope, nil, ::String, ::Array, nil
638
639
  config_attr :lib_name, nil, ::String, nil
639
640
  config_attr :lib_version, nil, ::String, nil
640
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
641
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
641
642
  config_attr :interceptors, nil, ::Array, nil
642
643
  config_attr :timeout, nil, ::Numeric, nil
643
644
  config_attr :metadata, nil, ::Hash, nil
@@ -658,7 +659,7 @@ module Google
658
659
  def rpcs
659
660
  @rpcs ||= begin
660
661
  parent_rpcs = nil
661
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
662
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
662
663
  Rpcs.new parent_rpcs
663
664
  end
664
665
  end
@@ -670,7 +671,7 @@ module Google
670
671
  # Each configuration object is of type `Gapic::Config::Method` and includes
671
672
  # the following configuration fields:
672
673
  #
673
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
674
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
674
675
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
675
676
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
676
677
  # include the following keys:
@@ -709,15 +710,15 @@ module Google
709
710
 
710
711
  # @private
711
712
  def initialize parent_rpcs = nil
712
- create_company_config = parent_rpcs&.create_company if parent_rpcs&.respond_to? :create_company
713
+ create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company
713
714
  @create_company = ::Gapic::Config::Method.new create_company_config
714
- get_company_config = parent_rpcs&.get_company if parent_rpcs&.respond_to? :get_company
715
+ get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company
715
716
  @get_company = ::Gapic::Config::Method.new get_company_config
716
- update_company_config = parent_rpcs&.update_company if parent_rpcs&.respond_to? :update_company
717
+ update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company
717
718
  @update_company = ::Gapic::Config::Method.new update_company_config
718
- delete_company_config = parent_rpcs&.delete_company if parent_rpcs&.respond_to? :delete_company
719
+ delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company
719
720
  @delete_company = ::Gapic::Config::Method.new delete_company_config
720
- list_companies_config = parent_rpcs&.list_companies if parent_rpcs&.respond_to? :list_companies
721
+ list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies
721
722
  @list_companies = ::Gapic::Config::Method.new list_companies_config
722
723
 
723
724
  yield self if block_given?
@@ -27,7 +27,7 @@ module Google
27
27
  # A service that handles company management, including CRUD and enumeration.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -60,7 +60,7 @@ module Google
60
60
  parent_config = while namespace.any?
61
61
  parent_name = namespace.join "::"
62
62
  parent_const = const_get parent_name
63
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
64
  namespace.pop
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
@@ -68,9 +68,9 @@ module Google
68
68
  default_config.rpcs.complete_query.timeout = 30.0
69
69
  default_config.rpcs.complete_query.retry_policy = {
70
70
  initial_delay: 0.1,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [4, 14]
71
+ max_delay: 60.0,
72
+ multiplier: 1.3,
73
+ retry_codes: [4, 14]
74
74
  }
75
75
 
76
76
  default_config
@@ -134,7 +134,13 @@ module Google
134
134
 
135
135
  # Create credentials
136
136
  credentials = @config.credentials
137
- credentials ||= Credentials.default scope: @config.scope
137
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
+ @config.endpoint == Client.configure.endpoint &&
141
+ !@config.endpoint.split(".").first.include?("-")
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
138
144
  if credentials.is_a?(String) || credentials.is_a?(Hash)
139
145
  credentials = Credentials.new credentials, scope: @config.scope
140
146
  end
@@ -198,11 +204,9 @@ module Google
198
204
  # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
199
205
  # example, "projects/foo/tenants/bar/companies/baz".
200
206
  # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope]
201
- # The scope of the completion. The defaults is
202
- # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}.
207
+ # The scope of the completion. The defaults is {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}.
203
208
  # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType]
204
- # The completion topic. The default is
205
- # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}.
209
+ # The completion topic. The default is {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}.
206
210
  #
207
211
  # @yield [response, operation] Access the result along with the RPC operation
208
212
  # @yieldparam response [::Google::Cloud::Talent::V4::CompleteQueryResponse]
@@ -341,7 +345,7 @@ module Google
341
345
  config_attr :scope, nil, ::String, ::Array, nil
342
346
  config_attr :lib_name, nil, ::String, nil
343
347
  config_attr :lib_version, nil, ::String, nil
344
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
348
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
345
349
  config_attr :interceptors, nil, ::Array, nil
346
350
  config_attr :timeout, nil, ::Numeric, nil
347
351
  config_attr :metadata, nil, ::Hash, nil
@@ -362,7 +366,7 @@ module Google
362
366
  def rpcs
363
367
  @rpcs ||= begin
364
368
  parent_rpcs = nil
365
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
369
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
366
370
  Rpcs.new parent_rpcs
367
371
  end
368
372
  end
@@ -374,7 +378,7 @@ module Google
374
378
  # Each configuration object is of type `Gapic::Config::Method` and includes
375
379
  # the following configuration fields:
376
380
  #
377
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
381
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
378
382
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
379
383
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
380
384
  # include the following keys:
@@ -393,7 +397,7 @@ module Google
393
397
 
394
398
  # @private
395
399
  def initialize parent_rpcs = nil
396
- complete_query_config = parent_rpcs&.complete_query if parent_rpcs&.respond_to? :complete_query
400
+ complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query
397
401
  @complete_query = ::Gapic::Config::Method.new complete_query_config
398
402
 
399
403
  yield self if block_given?
@@ -4,10 +4,10 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'google/api/annotations_pb'
7
- require 'google/api/client_pb'
8
7
  require 'google/api/field_behavior_pb'
9
8
  require 'google/api/resource_pb'
10
9
  require 'google/cloud/talent/v4/common_pb'
10
+ require 'google/api/client_pb'
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/talent/v4/completion_service.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.talent.v4.CompleteQueryRequest" do
@@ -27,7 +27,7 @@ module Google
27
27
  # A service handles auto completion.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -3,9 +3,9 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/field_behavior_pb'
8
7
  require 'google/protobuf/timestamp_pb'
8
+ require 'google/api/annotations_pb'
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/cloud/talent/v4/event.proto", :syntax => :proto3) do
11
11
  add_message "google.cloud.talent.v4.ClientEvent" do
@@ -60,7 +60,7 @@ module Google
60
60
  parent_config = while namespace.any?
61
61
  parent_name = namespace.join "::"
62
62
  parent_const = const_get parent_name
63
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
64
  namespace.pop
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
@@ -128,7 +128,13 @@ module Google
128
128
 
129
129
  # Create credentials
130
130
  credentials = @config.credentials
131
- credentials ||= Credentials.default scope: @config.scope
131
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
132
+ # but only if the default endpoint does not have a region prefix.
133
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
134
+ @config.endpoint == Client.configure.endpoint &&
135
+ !@config.endpoint.split(".").first.include?("-")
136
+ credentials ||= Credentials.default scope: @config.scope,
137
+ enable_self_signed_jwt: enable_self_signed_jwt
132
138
  if credentials.is_a?(String) || credentials.is_a?(Hash)
133
139
  credentials = Credentials.new credentials, scope: @config.scope
134
140
  end
@@ -176,8 +182,8 @@ module Google
176
182
  # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
177
183
  # "projects/foo/tenants/bar".
178
184
  # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash]
179
- # Required. Events issued when end user interacts with customer's application
180
- # that uses Cloud Talent Solution.
185
+ # Required. Events issued when end user interacts with customer's application that
186
+ # uses Cloud Talent Solution.
181
187
  #
182
188
  # @yield [response, operation] Access the result along with the RPC operation
183
189
  # @yieldparam response [::Google::Cloud::Talent::V4::ClientEvent]
@@ -316,7 +322,7 @@ module Google
316
322
  config_attr :scope, nil, ::String, ::Array, nil
317
323
  config_attr :lib_name, nil, ::String, nil
318
324
  config_attr :lib_version, nil, ::String, nil
319
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
325
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
320
326
  config_attr :interceptors, nil, ::Array, nil
321
327
  config_attr :timeout, nil, ::Numeric, nil
322
328
  config_attr :metadata, nil, ::Hash, nil
@@ -337,7 +343,7 @@ module Google
337
343
  def rpcs
338
344
  @rpcs ||= begin
339
345
  parent_rpcs = nil
340
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
346
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
341
347
  Rpcs.new parent_rpcs
342
348
  end
343
349
  end
@@ -349,7 +355,7 @@ module Google
349
355
  # Each configuration object is of type `Gapic::Config::Method` and includes
350
356
  # the following configuration fields:
351
357
  #
352
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
358
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
353
359
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
354
360
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
355
361
  # include the following keys:
@@ -368,7 +374,7 @@ module Google
368
374
 
369
375
  # @private
370
376
  def initialize parent_rpcs = nil
371
- create_client_event_config = parent_rpcs&.create_client_event if parent_rpcs&.respond_to? :create_client_event
377
+ create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event
372
378
  @create_client_event = ::Gapic::Config::Method.new create_client_event_config
373
379
 
374
380
  yield self if block_given?
@@ -27,7 +27,7 @@ module Google
27
27
  # A service handles client event report.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -3,12 +3,12 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/field_behavior_pb'
8
7
  require 'google/cloud/talent/v4/common_pb'
9
8
  require 'google/protobuf/duration_pb'
10
9
  require 'google/type/latlng_pb'
11
10
  require 'google/type/timeofday_pb'
11
+ require 'google/api/annotations_pb'
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/talent/v4/filters.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.talent.v4.JobQuery" do
@@ -3,11 +3,11 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
- require 'google/api/annotations_pb'
7
6
  require 'google/api/field_behavior_pb'
8
7
  require 'google/api/resource_pb'
9
8
  require 'google/cloud/talent/v4/common_pb'
10
9
  require 'google/protobuf/timestamp_pb'
10
+ require 'google/api/annotations_pb'
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/talent/v4/job.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.talent.v4.Job" do
@@ -60,7 +60,7 @@ module Google
60
60
  parent_config = while namespace.any?
61
61
  parent_name = namespace.join "::"
62
62
  parent_const = const_get parent_name
63
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
64
  namespace.pop
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
@@ -72,9 +72,9 @@ module Google
72
72
  default_config.rpcs.get_job.timeout = 30.0
73
73
  default_config.rpcs.get_job.retry_policy = {
74
74
  initial_delay: 0.1,
75
- max_delay: 60.0,
76
- multiplier: 1.3,
77
- retry_codes: [4, 14]
75
+ max_delay: 60.0,
76
+ multiplier: 1.3,
77
+ retry_codes: [4, 14]
78
78
  }
79
79
 
80
80
  default_config.rpcs.update_job.timeout = 30.0
@@ -84,9 +84,9 @@ module Google
84
84
  default_config.rpcs.delete_job.timeout = 30.0
85
85
  default_config.rpcs.delete_job.retry_policy = {
86
86
  initial_delay: 0.1,
87
- max_delay: 60.0,
88
- multiplier: 1.3,
89
- retry_codes: [4, 14]
87
+ max_delay: 60.0,
88
+ multiplier: 1.3,
89
+ retry_codes: [4, 14]
90
90
  }
91
91
 
92
92
  default_config.rpcs.batch_delete_jobs.timeout = 30.0
@@ -94,9 +94,9 @@ module Google
94
94
  default_config.rpcs.list_jobs.timeout = 30.0
95
95
  default_config.rpcs.list_jobs.retry_policy = {
96
96
  initial_delay: 0.1,
97
- max_delay: 60.0,
98
- multiplier: 1.3,
99
- retry_codes: [4, 14]
97
+ max_delay: 60.0,
98
+ multiplier: 1.3,
99
+ retry_codes: [4, 14]
100
100
  }
101
101
 
102
102
  default_config.rpcs.search_jobs.timeout = 30.0
@@ -164,7 +164,13 @@ module Google
164
164
 
165
165
  # Create credentials
166
166
  credentials = @config.credentials
167
- credentials ||= Credentials.default scope: @config.scope
167
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
168
+ # but only if the default endpoint does not have a region prefix.
169
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
170
+ @config.endpoint == Client.configure.endpoint &&
171
+ !@config.endpoint.split(".").first.include?("-")
172
+ credentials ||= Credentials.default scope: @config.scope,
173
+ enable_self_signed_jwt: enable_self_signed_jwt
168
174
  if credentials.is_a?(String) || credentials.is_a?(Hash)
169
175
  credentials = Credentials.new credentials, scope: @config.scope
170
176
  end
@@ -1502,7 +1508,7 @@ module Google
1502
1508
  config_attr :scope, nil, ::String, ::Array, nil
1503
1509
  config_attr :lib_name, nil, ::String, nil
1504
1510
  config_attr :lib_version, nil, ::String, nil
1505
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1511
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1506
1512
  config_attr :interceptors, nil, ::Array, nil
1507
1513
  config_attr :timeout, nil, ::Numeric, nil
1508
1514
  config_attr :metadata, nil, ::Hash, nil
@@ -1523,7 +1529,7 @@ module Google
1523
1529
  def rpcs
1524
1530
  @rpcs ||= begin
1525
1531
  parent_rpcs = nil
1526
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1532
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1527
1533
  Rpcs.new parent_rpcs
1528
1534
  end
1529
1535
  end
@@ -1535,7 +1541,7 @@ module Google
1535
1541
  # Each configuration object is of type `Gapic::Config::Method` and includes
1536
1542
  # the following configuration fields:
1537
1543
  #
1538
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1544
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1539
1545
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1540
1546
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1541
1547
  # include the following keys:
@@ -1599,25 +1605,25 @@ module Google
1599
1605
 
1600
1606
  # @private
1601
1607
  def initialize parent_rpcs = nil
1602
- create_job_config = parent_rpcs&.create_job if parent_rpcs&.respond_to? :create_job
1608
+ create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job
1603
1609
  @create_job = ::Gapic::Config::Method.new create_job_config
1604
- batch_create_jobs_config = parent_rpcs&.batch_create_jobs if parent_rpcs&.respond_to? :batch_create_jobs
1610
+ batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs
1605
1611
  @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config
1606
- get_job_config = parent_rpcs&.get_job if parent_rpcs&.respond_to? :get_job
1612
+ get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job
1607
1613
  @get_job = ::Gapic::Config::Method.new get_job_config
1608
- update_job_config = parent_rpcs&.update_job if parent_rpcs&.respond_to? :update_job
1614
+ update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job
1609
1615
  @update_job = ::Gapic::Config::Method.new update_job_config
1610
- batch_update_jobs_config = parent_rpcs&.batch_update_jobs if parent_rpcs&.respond_to? :batch_update_jobs
1616
+ batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs
1611
1617
  @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config
1612
- delete_job_config = parent_rpcs&.delete_job if parent_rpcs&.respond_to? :delete_job
1618
+ delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
1613
1619
  @delete_job = ::Gapic::Config::Method.new delete_job_config
1614
- batch_delete_jobs_config = parent_rpcs&.batch_delete_jobs if parent_rpcs&.respond_to? :batch_delete_jobs
1620
+ batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs
1615
1621
  @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config
1616
- list_jobs_config = parent_rpcs&.list_jobs if parent_rpcs&.respond_to? :list_jobs
1622
+ list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
1617
1623
  @list_jobs = ::Gapic::Config::Method.new list_jobs_config
1618
- search_jobs_config = parent_rpcs&.search_jobs if parent_rpcs&.respond_to? :search_jobs
1624
+ search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs
1619
1625
  @search_jobs = ::Gapic::Config::Method.new search_jobs_config
1620
- search_jobs_for_alert_config = parent_rpcs&.search_jobs_for_alert if parent_rpcs&.respond_to? :search_jobs_for_alert
1626
+ search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert
1621
1627
  @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config
1622
1628
 
1623
1629
  yield self if block_given?