google-cloud-talent-v4beta1 0.2.4 → 0.4.1

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 (31) 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/v4beta1.rb +3 -0
  5. data/lib/google/cloud/talent/v4beta1/application_service/client.rb +26 -20
  6. data/lib/google/cloud/talent/v4beta1/application_service/paths.rb +2 -2
  7. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +6 -6
  8. data/lib/google/cloud/talent/v4beta1/company_service/client.rb +26 -20
  9. data/lib/google/cloud/talent/v4beta1/company_service/paths.rb +1 -1
  10. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +6 -6
  11. data/lib/google/cloud/talent/v4beta1/completion/client.rb +16 -10
  12. data/lib/google/cloud/talent/v4beta1/completion/paths.rb +1 -1
  13. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +2 -2
  14. data/lib/google/cloud/talent/v4beta1/event_service/client.rb +13 -7
  15. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +2 -2
  16. data/lib/google/cloud/talent/v4beta1/job_service/client.rb +31 -25
  17. data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +96 -11
  18. data/lib/google/cloud/talent/v4beta1/job_service/paths.rb +2 -2
  19. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +11 -11
  20. data/lib/google/cloud/talent/v4beta1/profile_service/client.rb +27 -21
  21. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +7 -7
  22. data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +26 -20
  23. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +6 -6
  24. data/lib/google/cloud/talent/v4beta1/version.rb +1 -1
  25. data/proto_docs/google/api/field_behavior.rb +6 -0
  26. data/proto_docs/google/api/resource.rb +50 -14
  27. data/proto_docs/google/longrunning/operations.rb +17 -3
  28. data/proto_docs/google/protobuf/any.rb +5 -2
  29. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  30. data/proto_docs/google/type/latlng.rb +2 -2
  31. metadata +19 -11
@@ -39,3 +39,6 @@ module Google
39
39
  end
40
40
  end
41
41
  end
42
+
43
+ helper_path = ::File.join __dir__, "v4beta1", "_helpers.rb"
44
+ require "google/cloud/talent/v4beta1/_helpers" if ::File.file? helper_path
@@ -61,7 +61,7 @@ module Google
61
61
  parent_config = while namespace.any?
62
62
  parent_name = namespace.join "::"
63
63
  parent_const = const_get parent_name
64
- break parent_const.configure if parent_const&.respond_to? :configure
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
65
  namespace.pop
66
66
  end
67
67
  default_config = Client::Configuration.new parent_config
@@ -71,9 +71,9 @@ module Google
71
71
  default_config.rpcs.get_application.timeout = 30.0
72
72
  default_config.rpcs.get_application.retry_policy = {
73
73
  initial_delay: 0.1,
74
- max_delay: 60.0,
75
- multiplier: 1.3,
76
- retry_codes: [4, 14]
74
+ max_delay: 60.0,
75
+ multiplier: 1.3,
76
+ retry_codes: [4, 14]
77
77
  }
78
78
 
79
79
  default_config.rpcs.update_application.timeout = 30.0
@@ -81,17 +81,17 @@ module Google
81
81
  default_config.rpcs.delete_application.timeout = 30.0
82
82
  default_config.rpcs.delete_application.retry_policy = {
83
83
  initial_delay: 0.1,
84
- max_delay: 60.0,
85
- multiplier: 1.3,
86
- retry_codes: [4, 14]
84
+ max_delay: 60.0,
85
+ multiplier: 1.3,
86
+ retry_codes: [4, 14]
87
87
  }
88
88
 
89
89
  default_config.rpcs.list_applications.timeout = 30.0
90
90
  default_config.rpcs.list_applications.retry_policy = {
91
91
  initial_delay: 0.1,
92
- max_delay: 60.0,
93
- multiplier: 1.3,
94
- retry_codes: [4, 14]
92
+ max_delay: 60.0,
93
+ multiplier: 1.3,
94
+ retry_codes: [4, 14]
95
95
  }
96
96
 
97
97
  default_config
@@ -155,7 +155,13 @@ module Google
155
155
 
156
156
  # Create credentials
157
157
  credentials = @config.credentials
158
- credentials ||= Credentials.default scope: @config.scope
158
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
159
+ # but only if the default endpoint does not have a region prefix.
160
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
161
+ @config.endpoint == Client.configure.endpoint &&
162
+ !@config.endpoint.split(".").first.include?("-")
163
+ credentials ||= Credentials.default scope: @config.scope,
164
+ enable_self_signed_jwt: enable_self_signed_jwt
159
165
  if credentials.is_a?(String) || credentials.is_a?(Hash)
160
166
  credentials = Credentials.new credentials, scope: @config.scope
161
167
  end
@@ -620,14 +626,14 @@ module Google
620
626
 
621
627
  config_attr :endpoint, "jobs.googleapis.com", ::String
622
628
  config_attr :credentials, nil do |value|
623
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
629
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
624
630
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
625
631
  allowed.any? { |klass| klass === value }
626
632
  end
627
633
  config_attr :scope, nil, ::String, ::Array, nil
628
634
  config_attr :lib_name, nil, ::String, nil
629
635
  config_attr :lib_version, nil, ::String, nil
630
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
636
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
631
637
  config_attr :interceptors, nil, ::Array, nil
632
638
  config_attr :timeout, nil, ::Numeric, nil
633
639
  config_attr :metadata, nil, ::Hash, nil
@@ -648,7 +654,7 @@ module Google
648
654
  def rpcs
649
655
  @rpcs ||= begin
650
656
  parent_rpcs = nil
651
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
657
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
652
658
  Rpcs.new parent_rpcs
653
659
  end
654
660
  end
@@ -660,7 +666,7 @@ module Google
660
666
  # Each configuration object is of type `Gapic::Config::Method` and includes
661
667
  # the following configuration fields:
662
668
  #
663
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
669
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
664
670
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
665
671
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
666
672
  # include the following keys:
@@ -699,15 +705,15 @@ module Google
699
705
 
700
706
  # @private
701
707
  def initialize parent_rpcs = nil
702
- create_application_config = parent_rpcs&.create_application if parent_rpcs&.respond_to? :create_application
708
+ create_application_config = parent_rpcs.create_application if parent_rpcs.respond_to? :create_application
703
709
  @create_application = ::Gapic::Config::Method.new create_application_config
704
- get_application_config = parent_rpcs&.get_application if parent_rpcs&.respond_to? :get_application
710
+ get_application_config = parent_rpcs.get_application if parent_rpcs.respond_to? :get_application
705
711
  @get_application = ::Gapic::Config::Method.new get_application_config
706
- update_application_config = parent_rpcs&.update_application if parent_rpcs&.respond_to? :update_application
712
+ update_application_config = parent_rpcs.update_application if parent_rpcs.respond_to? :update_application
707
713
  @update_application = ::Gapic::Config::Method.new update_application_config
708
- delete_application_config = parent_rpcs&.delete_application if parent_rpcs&.respond_to? :delete_application
714
+ delete_application_config = parent_rpcs.delete_application if parent_rpcs.respond_to? :delete_application
709
715
  @delete_application = ::Gapic::Config::Method.new delete_application_config
710
- list_applications_config = parent_rpcs&.list_applications if parent_rpcs&.respond_to? :list_applications
716
+ list_applications_config = parent_rpcs.list_applications if parent_rpcs.respond_to? :list_applications
711
717
  @list_applications = ::Gapic::Config::Method.new list_applications_config
712
718
 
713
719
  yield self if block_given?
@@ -74,7 +74,7 @@ module Google
74
74
 
75
75
  "projects/#{project}/tenants/#{tenant}/companies/#{company}"
76
76
  end),
77
- "company:project" => (proc do |project:, company:|
77
+ "company:project" => (proc do |project:, company:|
78
78
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
79
79
 
80
80
  "projects/#{project}/companies/#{company}"
@@ -115,7 +115,7 @@ module Google
115
115
 
116
116
  "projects/#{project}/tenants/#{tenant}/jobs/#{job}"
117
117
  end),
118
- "job:project" => (proc do |project:, job:|
118
+ "job:project" => (proc do |project:, job:|
119
119
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
120
120
 
121
121
  "projects/#{project}/jobs/#{job}"
@@ -28,22 +28,22 @@ module Google
28
28
  # enumeration.
29
29
  class Service
30
30
 
31
- include GRPC::GenericService
31
+ include ::GRPC::GenericService
32
32
 
33
33
  self.marshal_class_method = :encode
34
34
  self.unmarshal_class_method = :decode
35
35
  self.service_name = 'google.cloud.talent.v4beta1.ApplicationService'
36
36
 
37
37
  # Creates a new application entity.
38
- rpc :CreateApplication, Google::Cloud::Talent::V4beta1::CreateApplicationRequest, Google::Cloud::Talent::V4beta1::Application
38
+ rpc :CreateApplication, ::Google::Cloud::Talent::V4beta1::CreateApplicationRequest, ::Google::Cloud::Talent::V4beta1::Application
39
39
  # Retrieves specified application.
40
- rpc :GetApplication, Google::Cloud::Talent::V4beta1::GetApplicationRequest, Google::Cloud::Talent::V4beta1::Application
40
+ rpc :GetApplication, ::Google::Cloud::Talent::V4beta1::GetApplicationRequest, ::Google::Cloud::Talent::V4beta1::Application
41
41
  # Updates specified application.
42
- rpc :UpdateApplication, Google::Cloud::Talent::V4beta1::UpdateApplicationRequest, Google::Cloud::Talent::V4beta1::Application
42
+ rpc :UpdateApplication, ::Google::Cloud::Talent::V4beta1::UpdateApplicationRequest, ::Google::Cloud::Talent::V4beta1::Application
43
43
  # Deletes specified application.
44
- rpc :DeleteApplication, Google::Cloud::Talent::V4beta1::DeleteApplicationRequest, Google::Protobuf::Empty
44
+ rpc :DeleteApplication, ::Google::Cloud::Talent::V4beta1::DeleteApplicationRequest, ::Google::Protobuf::Empty
45
45
  # Lists all applications associated with the profile.
46
- rpc :ListApplications, Google::Cloud::Talent::V4beta1::ListApplicationsRequest, Google::Cloud::Talent::V4beta1::ListApplicationsResponse
46
+ rpc :ListApplications, ::Google::Cloud::Talent::V4beta1::ListApplicationsRequest, ::Google::Cloud::Talent::V4beta1::ListApplicationsResponse
47
47
  end
48
48
 
49
49
  Stub = Service.rpc_stub_class
@@ -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
@@ -635,14 +641,14 @@ module Google
635
641
 
636
642
  config_attr :endpoint, "jobs.googleapis.com", ::String
637
643
  config_attr :credentials, nil do |value|
638
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
644
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
639
645
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
640
646
  allowed.any? { |klass| klass === value }
641
647
  end
642
648
  config_attr :scope, nil, ::String, ::Array, nil
643
649
  config_attr :lib_name, nil, ::String, nil
644
650
  config_attr :lib_version, nil, ::String, nil
645
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
651
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
646
652
  config_attr :interceptors, nil, ::Array, nil
647
653
  config_attr :timeout, nil, ::Numeric, nil
648
654
  config_attr :metadata, nil, ::Hash, nil
@@ -663,7 +669,7 @@ module Google
663
669
  def rpcs
664
670
  @rpcs ||= begin
665
671
  parent_rpcs = nil
666
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
672
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
667
673
  Rpcs.new parent_rpcs
668
674
  end
669
675
  end
@@ -675,7 +681,7 @@ module Google
675
681
  # Each configuration object is of type `Gapic::Config::Method` and includes
676
682
  # the following configuration fields:
677
683
  #
678
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
684
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
679
685
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
680
686
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
681
687
  # include the following keys:
@@ -714,15 +720,15 @@ module Google
714
720
 
715
721
  # @private
716
722
  def initialize parent_rpcs = nil
717
- create_company_config = parent_rpcs&.create_company if parent_rpcs&.respond_to? :create_company
723
+ create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company
718
724
  @create_company = ::Gapic::Config::Method.new create_company_config
719
- get_company_config = parent_rpcs&.get_company if parent_rpcs&.respond_to? :get_company
725
+ get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company
720
726
  @get_company = ::Gapic::Config::Method.new get_company_config
721
- update_company_config = parent_rpcs&.update_company if parent_rpcs&.respond_to? :update_company
727
+ update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company
722
728
  @update_company = ::Gapic::Config::Method.new update_company_config
723
- delete_company_config = parent_rpcs&.delete_company if parent_rpcs&.respond_to? :delete_company
729
+ delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company
724
730
  @delete_company = ::Gapic::Config::Method.new delete_company_config
725
- list_companies_config = parent_rpcs&.list_companies if parent_rpcs&.respond_to? :list_companies
731
+ list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies
726
732
  @list_companies = ::Gapic::Config::Method.new list_companies_config
727
733
 
728
734
  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}"
@@ -27,23 +27,23 @@ 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
34
34
  self.service_name = 'google.cloud.talent.v4beta1.CompanyService'
35
35
 
36
36
  # Creates a new company entity.
37
- rpc :CreateCompany, Google::Cloud::Talent::V4beta1::CreateCompanyRequest, Google::Cloud::Talent::V4beta1::Company
37
+ rpc :CreateCompany, ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company
38
38
  # Retrieves specified company.
39
- rpc :GetCompany, Google::Cloud::Talent::V4beta1::GetCompanyRequest, Google::Cloud::Talent::V4beta1::Company
39
+ rpc :GetCompany, ::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company
40
40
  # Updates specified company.
41
- rpc :UpdateCompany, Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, Google::Cloud::Talent::V4beta1::Company
41
+ rpc :UpdateCompany, ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company
42
42
  # Deletes specified company.
43
43
  # Prerequisite: The company has no jobs associated with it.
44
- rpc :DeleteCompany, Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, Google::Protobuf::Empty
44
+ rpc :DeleteCompany, ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Google::Protobuf::Empty
45
45
  # Lists all companies associated with the project.
46
- rpc :ListCompanies, Google::Cloud::Talent::V4beta1::ListCompaniesRequest, Google::Cloud::Talent::V4beta1::ListCompaniesResponse
46
+ rpc :ListCompanies, ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse
47
47
  end
48
48
 
49
49
  Stub = Service.rpc_stub_class
@@ -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
@@ -338,14 +344,14 @@ module Google
338
344
 
339
345
  config_attr :endpoint, "jobs.googleapis.com", ::String
340
346
  config_attr :credentials, nil do |value|
341
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
347
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
342
348
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
343
349
  allowed.any? { |klass| klass === value }
344
350
  end
345
351
  config_attr :scope, nil, ::String, ::Array, nil
346
352
  config_attr :lib_name, nil, ::String, nil
347
353
  config_attr :lib_version, nil, ::String, nil
348
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
354
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
349
355
  config_attr :interceptors, nil, ::Array, nil
350
356
  config_attr :timeout, nil, ::Numeric, nil
351
357
  config_attr :metadata, nil, ::Hash, nil
@@ -366,7 +372,7 @@ module Google
366
372
  def rpcs
367
373
  @rpcs ||= begin
368
374
  parent_rpcs = nil
369
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
375
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
370
376
  Rpcs.new parent_rpcs
371
377
  end
372
378
  end
@@ -378,7 +384,7 @@ module Google
378
384
  # Each configuration object is of type `Gapic::Config::Method` and includes
379
385
  # the following configuration fields:
380
386
  #
381
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
387
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
382
388
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
383
389
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
384
390
  # include the following keys:
@@ -397,7 +403,7 @@ module Google
397
403
 
398
404
  # @private
399
405
  def initialize parent_rpcs = nil
400
- complete_query_config = parent_rpcs&.complete_query if parent_rpcs&.respond_to? :complete_query
406
+ complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query
401
407
  @complete_query = ::Gapic::Config::Method.new complete_query_config
402
408
 
403
409
  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}"
@@ -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
@@ -35,7 +35,7 @@ module Google
35
35
 
36
36
  # Completes the specified prefix with keyword suggestions.
37
37
  # Intended for use by a job search auto-complete search box.
38
- rpc :CompleteQuery, Google::Cloud::Talent::V4beta1::CompleteQueryRequest, Google::Cloud::Talent::V4beta1::CompleteQueryResponse
38
+ rpc :CompleteQuery, ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse
39
39
  end
40
40
 
41
41
  Stub = Service.rpc_stub_class
@@ -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
@@ -310,14 +316,14 @@ module Google
310
316
 
311
317
  config_attr :endpoint, "jobs.googleapis.com", ::String
312
318
  config_attr :credentials, nil do |value|
313
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
319
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
314
320
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
315
321
  allowed.any? { |klass| klass === value }
316
322
  end
317
323
  config_attr :scope, nil, ::String, ::Array, nil
318
324
  config_attr :lib_name, nil, ::String, nil
319
325
  config_attr :lib_version, nil, ::String, nil
320
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
326
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
321
327
  config_attr :interceptors, nil, ::Array, nil
322
328
  config_attr :timeout, nil, ::Numeric, nil
323
329
  config_attr :metadata, nil, ::Hash, nil
@@ -338,7 +344,7 @@ module Google
338
344
  def rpcs
339
345
  @rpcs ||= begin
340
346
  parent_rpcs = nil
341
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
347
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
342
348
  Rpcs.new parent_rpcs
343
349
  end
344
350
  end
@@ -350,7 +356,7 @@ module Google
350
356
  # Each configuration object is of type `Gapic::Config::Method` and includes
351
357
  # the following configuration fields:
352
358
  #
353
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
359
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
354
360
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
355
361
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
356
362
  # include the following keys:
@@ -369,7 +375,7 @@ module Google
369
375
 
370
376
  # @private
371
377
  def initialize parent_rpcs = nil
372
- create_client_event_config = parent_rpcs&.create_client_event if parent_rpcs&.respond_to? :create_client_event
378
+ create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event
373
379
  @create_client_event = ::Gapic::Config::Method.new create_client_event_config
374
380
 
375
381
  yield self if block_given?