google-cloud-talent 0.8.3 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -59
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +347 -0
  6. data/README.md +36 -25
  7. data/lib/{google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb → google-cloud-talent.rb} +4 -14
  8. data/lib/google/cloud/talent.rb +203 -453
  9. data/lib/google/cloud/talent/version.rb +6 -2
  10. metadata +75 -110
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/talent/v4beta1.rb +0 -543
  13. data/lib/google/cloud/talent/v4beta1/application_pb.rb +0 -63
  14. data/lib/google/cloud/talent/v4beta1/application_service_client.rb +0 -484
  15. data/lib/google/cloud/talent/v4beta1/application_service_client_config.json +0 -51
  16. data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +0 -55
  17. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +0 -56
  18. data/lib/google/cloud/talent/v4beta1/batch_pb.rb +0 -18
  19. data/lib/google/cloud/talent/v4beta1/common_pb.rb +0 -341
  20. data/lib/google/cloud/talent/v4beta1/company_pb.rb +0 -41
  21. data/lib/google/cloud/talent/v4beta1/company_service_client.rb +0 -529
  22. data/lib/google/cloud/talent/v4beta1/company_service_client_config.json +0 -51
  23. data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +0 -56
  24. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +0 -56
  25. data/lib/google/cloud/talent/v4beta1/completion_client.rb +0 -337
  26. data/lib/google/cloud/talent/v4beta1/completion_client_config.json +0 -31
  27. data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +0 -56
  28. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +0 -48
  29. data/lib/google/cloud/talent/v4beta1/credentials.rb +0 -42
  30. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application.rb +0 -166
  31. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application_service.rb +0 -100
  32. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +0 -1057
  33. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +0 -107
  34. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +0 -116
  35. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +0 -139
  36. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +0 -224
  37. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +0 -36
  38. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +0 -763
  39. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +0 -50
  40. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +0 -331
  41. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +0 -696
  42. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +0 -750
  43. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +0 -410
  44. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +0 -70
  45. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +0 -96
  46. data/lib/google/cloud/talent/v4beta1/doc/google/longrunning/operations.rb +0 -51
  47. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/any.rb +0 -131
  48. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb +0 -91
  49. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb +0 -222
  50. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb +0 -113
  51. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb +0 -34
  52. data/lib/google/cloud/talent/v4beta1/doc/google/rpc/status.rb +0 -39
  53. data/lib/google/cloud/talent/v4beta1/doc/google/type/date.rb +0 -43
  54. data/lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb +0 -31
  55. data/lib/google/cloud/talent/v4beta1/doc/google/type/money.rb +0 -36
  56. data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +0 -128
  57. data/lib/google/cloud/talent/v4beta1/doc/google/type/timeofday.rb +0 -37
  58. data/lib/google/cloud/talent/v4beta1/event_pb.rb +0 -69
  59. data/lib/google/cloud/talent/v4beta1/event_service_client.rb +0 -268
  60. data/lib/google/cloud/talent/v4beta1/event_service_client_config.json +0 -31
  61. data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +0 -27
  62. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +0 -53
  63. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +0 -187
  64. data/lib/google/cloud/talent/v4beta1/helpers.rb +0 -162
  65. data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +0 -27
  66. data/lib/google/cloud/talent/v4beta1/job_pb.rb +0 -72
  67. data/lib/google/cloud/talent/v4beta1/job_service_client.rb +0 -1510
  68. data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +0 -76
  69. data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +0 -166
  70. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +0 -88
  71. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -213
  72. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -811
  73. data/lib/google/cloud/talent/v4beta1/profile_service_client_config.json +0 -56
  74. data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +0 -91
  75. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +0 -65
  76. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -34
  77. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -471
  78. data/lib/google/cloud/talent/v4beta1/tenant_service_client_config.json +0 -51
  79. data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +0 -55
  80. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +0 -55
data/README.md CHANGED
@@ -1,42 +1,53 @@
1
- # Ruby Client for Cloud Talent Solution API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
1
+ # Ruby Client for the Cloud Talent Solution API
2
2
 
3
- [Cloud Talent Solution API][Product Documentation]:
4
- Cloud Talent Solution provides the capability to create, read, update, and
5
- delete job postings, as well as search jobs based on keywords and filters.
6
- - [Client Library Documentation][]
7
- - [Product Documentation][]
3
+ API Client library for the Cloud Talent Solution API
8
4
 
9
- ## Quick Start
10
- In order to use this library, you first need to go through the following
11
- steps:
5
+ Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience.
12
6
 
13
- 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
14
- 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
15
- 3. [Enable the Cloud Talent Solution API.](https://console.cloud.google.com/apis/library/talent.googleapis.com)
16
- 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-talent/latest/file.AUTHENTICATION.html)
7
+ Actual client classes for the various versions of this API are defined in
8
+ _versioned_ client gems, with names of the form `google-cloud-talent-v*`.
9
+ The gem `google-cloud-talent` is a convenience wrapper library that brings the
10
+ verisoned gems in as dependencies, and provides high-level methods for
11
+ constructing clients.
12
+
13
+ View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-talent/latest)
14
+ for this library, google-cloud-talent, to see the convenience methods for
15
+ constructing client objects. Reference documentation for the client objects
16
+ themselves can be found in the client library documentation for the versioned
17
+ client gems:
18
+ [google-cloud-talent-v4](https://googleapis.dev/ruby/google-cloud-talent-v4/latest),
19
+ [google-cloud-talent-v4beta1](https://googleapis.dev/ruby/google-cloud-talent-v4beta1/latest).
20
+
21
+ See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution)
22
+ for more usage information.
23
+
24
+ ## Quick Start
17
25
 
18
- ### Installation
19
26
  ```
20
27
  $ gem install google-cloud-talent
21
28
  ```
22
29
 
23
- ### Next Steps
24
- - Read the [Client Library Documentation][] for Cloud Talent Solution API
25
- to see other available methods on the client.
26
- - Read the [Cloud Talent Solution API Product documentation][Product Documentation]
27
- to learn more about the product and see How-to Guides.
28
- - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
29
- to see the full list of Cloud APIs that we cover.
30
+ In order to use this library, you first need to go through the following steps:
31
+
32
+ 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
33
+ 1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
34
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/jobs.googleapis.com)
35
+ 1. {file:AUTHENTICATION.md Set up authentication.}
36
+
37
+ ## Migrating from pre-0.20 versions
30
38
 
31
- [Client Library Documentation]: https://googleapis.dev/ruby/google-cloud-talent/latest
32
- [Product Documentation]: https://cloud.google.com/talent-solution
39
+ The 0.20 release of the google-cloud-talent client is a significant upgrade
40
+ based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
41
+ and includes substantial interface changes. Existing code written for earlier
42
+ versions of this library will likely require updates to use this version.
43
+ See the {file:MIGRATING.md MIGRATING.md} document for more information.
33
44
 
34
45
  ## Enabling Logging
35
46
 
36
47
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
37
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
48
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
38
49
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
39
- that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
50
+ that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
40
51
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
41
52
 
42
53
  Configuring a Ruby stdlib logger:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright 2020 Google LLC
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,18 +14,6 @@
12
14
  # See the License for the specific language governing permissions and
13
15
  # limitations under the License.
14
16
 
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
15
18
 
16
- module Google
17
- module Protobuf
18
- # A generic empty message that you can re-use to avoid defining duplicated
19
- # empty messages in your APIs. A typical example is to use it as the request
20
- # or the response type of an API method. For instance:
21
- #
22
- # service Foo {
23
- # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
24
- # }
25
- #
26
- # The JSON representation for `Empty` is empty JSON object `{}`.
27
- class Empty; end
28
- end
29
- end
19
+ require "google/cloud/talent" unless defined? Google::Cloud::Talent::VERSION
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright 2020 Google LLC
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,474 +14,222 @@
12
14
  # See the License for the specific language governing permissions and
13
15
  # limitations under the License.
14
16
 
15
-
16
- require "google/gax"
17
- require "pathname"
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # Require this file early so that the version constant gets defined before
20
+ # requiring "google/cloud". This is because google-cloud-core will load the
21
+ # entrypoint (gem name) file, which in turn re-requires this file (hence
22
+ # causing a require cycle) unless the version constant is already defined.
23
+ require "google/cloud/talent/version"
24
+
25
+ require "googleauth"
26
+ gem "google-cloud-core"
27
+ require "google/cloud" unless defined? ::Google::Cloud.new
28
+ require "google/cloud/config"
29
+
30
+ # Set the default configuration
31
+ ::Google::Cloud.configure.add_config! :talent do |config|
32
+ config.add_field! :endpoint, "jobs.googleapis.com", match: ::String
33
+ config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
34
+ config.add_field! :scope, nil, match: [::Array, ::String]
35
+ config.add_field! :lib_name, nil, match: ::String
36
+ config.add_field! :lib_version, nil, match: ::String
37
+ config.add_field! :interceptors, nil, match: ::Array
38
+ config.add_field! :timeout, nil, match: ::Numeric
39
+ config.add_field! :metadata, nil, match: ::Hash
40
+ config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
41
+ config.add_field! :quota_project, nil, match: ::String
42
+ end
18
43
 
19
44
  module Google
20
45
  module Cloud
21
- # rubocop:disable LineLength
22
-
23
- ##
24
- # # Ruby Client for Cloud Talent Solution API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
25
- #
26
- # [Cloud Talent Solution API][Product Documentation]:
27
- # Cloud Talent Solution provides the capability to create, read, update, and
28
- # delete job postings, as well as search jobs based on keywords and filters.
29
- # - [Product Documentation][]
30
- #
31
- # ## Quick Start
32
- # In order to use this library, you first need to go through the following
33
- # steps:
34
- #
35
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
36
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
37
- # 3. [Enable the Cloud Talent Solution API.](https://console.cloud.google.com/apis/library/talent.googleapis.com)
38
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-talent/latest/file.AUTHENTICATION.html)
39
- #
40
- # ### Installation
41
- # ```
42
- # $ gem install google-cloud-talent
43
- # ```
44
- #
45
- # ### Next Steps
46
- # - Read the [Cloud Talent Solution API Product documentation][Product Documentation]
47
- # to learn more about the product and see How-to Guides.
48
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
49
- # to see the full list of Cloud APIs that we cover.
50
- #
51
- # [Product Documentation]: https://cloud.google.com/talent
52
- #
53
- # ## Enabling Logging
54
- #
55
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
56
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
57
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
58
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
59
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
60
- #
61
- # Configuring a Ruby stdlib logger:
62
- #
63
- # ```ruby
64
- # require "logger"
65
- #
66
- # module MyLogger
67
- # LOGGER = Logger.new $stderr, level: Logger::WARN
68
- # def logger
69
- # LOGGER
70
- # end
71
- # end
72
- #
73
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
74
- # module GRPC
75
- # extend MyLogger
76
- # end
77
- # ```
78
- #
79
46
  module Talent
80
- # rubocop:enable LineLength
81
-
82
- FILE_DIR = File.realdirpath(Pathname.new(__FILE__).join("..").join("talent"))
83
-
84
- AVAILABLE_VERSIONS = Dir["#{FILE_DIR}/*"]
85
- .select { |file| File.directory?(file) }
86
- .select { |dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir)) }
87
- .select { |dir| File.exist?(dir + ".rb") }
88
- .map { |dir| File.basename(dir) }
89
-
90
- module ApplicationService
91
- ##
92
- # A service that handles application management, including CRUD and
93
- # enumeration.
94
- #
95
- # @param version [Symbol, String]
96
- # The major version of the service to be used. By default :v4beta1
97
- # is used.
98
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
99
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
100
- # Provides the means for authenticating requests made by the client. This parameter can
101
- # be many types.
102
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
103
- # authenticating requests made by this client.
104
- # A `String` will be treated as the path to the keyfile to be used for the construction of
105
- # credentials for this client.
106
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
107
- # credentials for this client.
108
- # A `GRPC::Core::Channel` will be used to make calls through.
109
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
110
- # should already be composed with a `GRPC::Core::CallCredentials` object.
111
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
112
- # metadata for requests, generally, to give OAuth credentials.
113
- # @param scopes [Array<String>]
114
- # The OAuth scopes for this service. This parameter is ignored if
115
- # an updater_proc is supplied.
116
- # @param client_config [Hash]
117
- # A Hash for call options for each method. See
118
- # Google::Gax#construct_settings for the structure of
119
- # this data. Falls back to the default config if not specified
120
- # or the specified config is missing data points.
121
- # @param timeout [Numeric]
122
- # The default timeout, in seconds, for calls made through this client.
123
- # @param metadata [Hash]
124
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
125
- # @param service_address [String]
126
- # Override for the service hostname, or `nil` to leave as the default.
127
- # @param service_port [Integer]
128
- # Override for the service port, or `nil` to leave as the default.
129
- # @param exception_transformer [Proc]
130
- # An optional proc that intercepts any exceptions raised during an API call to inject
131
- # custom error handling.
132
- def self.new(*args, version: :v4beta1, **kwargs)
133
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
134
- raise "The version: #{version} is not available. The available versions " \
135
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
136
- end
137
-
138
- require "#{FILE_DIR}/#{version.to_s.downcase}"
139
- version_module = Google::Cloud::Talent
140
- .constants
141
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
142
- .first
143
- Google::Cloud::Talent.const_get(version_module)::ApplicationService.new(*args, **kwargs)
144
- end
47
+ ##
48
+ # Create a new client object for CompanyService.
49
+ #
50
+ # By default, this returns an instance of
51
+ # [Google::Cloud::Talent::V4::CompanyService::Client](https://googleapis.dev/ruby/google-cloud-talent-v4/latest/Google/Cloud/Talent/V4/CompanyService/Client.html)
52
+ # for version V4 of the API.
53
+ # However, you can specify specify a different API version by passing it in the
54
+ # `version` parameter. If the CompanyService service is
55
+ # supported by that API version, and the corresponding gem is available, the
56
+ # appropriate versioned client will be returned.
57
+ #
58
+ # ## About CompanyService
59
+ #
60
+ # A service that handles company management, including CRUD and enumeration.
61
+ #
62
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
63
+ # Defaults to `:v4`.
64
+ # @return [CompanyService::Client] A client object for the specified version.
65
+ #
66
+ def self.company_service version: :v4, &block
67
+ require "google/cloud/talent/#{version.to_s.downcase}"
68
+
69
+ package_name = Google::Cloud::Talent
70
+ .constants
71
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
72
+ .first
73
+ package_module = Google::Cloud::Talent.const_get package_name
74
+ package_module.const_get(:CompanyService).const_get(:Client).new(&block)
145
75
  end
146
76
 
147
- module CompanyService
148
- ##
149
- # A service that handles company management, including CRUD and enumeration.
150
- #
151
- # @param version [Symbol, String]
152
- # The major version of the service to be used. By default :v4beta1
153
- # is used.
154
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
155
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
156
- # Provides the means for authenticating requests made by the client. This parameter can
157
- # be many types.
158
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
159
- # authenticating requests made by this client.
160
- # A `String` will be treated as the path to the keyfile to be used for the construction of
161
- # credentials for this client.
162
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
163
- # credentials for this client.
164
- # A `GRPC::Core::Channel` will be used to make calls through.
165
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
166
- # should already be composed with a `GRPC::Core::CallCredentials` object.
167
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
168
- # metadata for requests, generally, to give OAuth credentials.
169
- # @param scopes [Array<String>]
170
- # The OAuth scopes for this service. This parameter is ignored if
171
- # an updater_proc is supplied.
172
- # @param client_config [Hash]
173
- # A Hash for call options for each method. See
174
- # Google::Gax#construct_settings for the structure of
175
- # this data. Falls back to the default config if not specified
176
- # or the specified config is missing data points.
177
- # @param timeout [Numeric]
178
- # The default timeout, in seconds, for calls made through this client.
179
- # @param metadata [Hash]
180
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
181
- # @param service_address [String]
182
- # Override for the service hostname, or `nil` to leave as the default.
183
- # @param service_port [Integer]
184
- # Override for the service port, or `nil` to leave as the default.
185
- # @param exception_transformer [Proc]
186
- # An optional proc that intercepts any exceptions raised during an API call to inject
187
- # custom error handling.
188
- def self.new(*args, version: :v4beta1, **kwargs)
189
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
190
- raise "The version: #{version} is not available. The available versions " \
191
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
192
- end
193
-
194
- require "#{FILE_DIR}/#{version.to_s.downcase}"
195
- version_module = Google::Cloud::Talent
196
- .constants
197
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
198
- .first
199
- Google::Cloud::Talent.const_get(version_module)::CompanyService.new(*args, **kwargs)
200
- end
77
+ ##
78
+ # Create a new client object for Completion.
79
+ #
80
+ # By default, this returns an instance of
81
+ # [Google::Cloud::Talent::V4::Completion::Client](https://googleapis.dev/ruby/google-cloud-talent-v4/latest/Google/Cloud/Talent/V4/Completion/Client.html)
82
+ # for version V4 of the API.
83
+ # However, you can specify specify a different API version by passing it in the
84
+ # `version` parameter. If the Completion service is
85
+ # supported by that API version, and the corresponding gem is available, the
86
+ # appropriate versioned client will be returned.
87
+ #
88
+ # ## About Completion
89
+ #
90
+ # A service handles auto completion.
91
+ #
92
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
93
+ # Defaults to `:v4`.
94
+ # @return [Completion::Client] A client object for the specified version.
95
+ #
96
+ def self.completion version: :v4, &block
97
+ require "google/cloud/talent/#{version.to_s.downcase}"
98
+
99
+ package_name = Google::Cloud::Talent
100
+ .constants
101
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
102
+ .first
103
+ package_module = Google::Cloud::Talent.const_get package_name
104
+ package_module.const_get(:Completion).const_get(:Client).new(&block)
201
105
  end
202
106
 
203
- module Completion
204
- ##
205
- # A service handles auto completion.
206
- #
207
- # @param version [Symbol, String]
208
- # The major version of the service to be used. By default :v4beta1
209
- # is used.
210
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
211
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
212
- # Provides the means for authenticating requests made by the client. This parameter can
213
- # be many types.
214
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
215
- # authenticating requests made by this client.
216
- # A `String` will be treated as the path to the keyfile to be used for the construction of
217
- # credentials for this client.
218
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
219
- # credentials for this client.
220
- # A `GRPC::Core::Channel` will be used to make calls through.
221
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
222
- # should already be composed with a `GRPC::Core::CallCredentials` object.
223
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
224
- # metadata for requests, generally, to give OAuth credentials.
225
- # @param scopes [Array<String>]
226
- # The OAuth scopes for this service. This parameter is ignored if
227
- # an updater_proc is supplied.
228
- # @param client_config [Hash]
229
- # A Hash for call options for each method. See
230
- # Google::Gax#construct_settings for the structure of
231
- # this data. Falls back to the default config if not specified
232
- # or the specified config is missing data points.
233
- # @param timeout [Numeric]
234
- # The default timeout, in seconds, for calls made through this client.
235
- # @param metadata [Hash]
236
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
237
- # @param service_address [String]
238
- # Override for the service hostname, or `nil` to leave as the default.
239
- # @param service_port [Integer]
240
- # Override for the service port, or `nil` to leave as the default.
241
- # @param exception_transformer [Proc]
242
- # An optional proc that intercepts any exceptions raised during an API call to inject
243
- # custom error handling.
244
- def self.new(*args, version: :v4beta1, **kwargs)
245
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
246
- raise "The version: #{version} is not available. The available versions " \
247
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
248
- end
249
-
250
- require "#{FILE_DIR}/#{version.to_s.downcase}"
251
- version_module = Google::Cloud::Talent
252
- .constants
253
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
254
- .first
255
- Google::Cloud::Talent.const_get(version_module)::Completion.new(*args, **kwargs)
256
- end
257
- end
258
-
259
- module Event
260
- ##
261
- # A service handles client event report.
262
- #
263
- # @param version [Symbol, String]
264
- # The major version of the service to be used. By default :v4beta1
265
- # is used.
266
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
267
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
268
- # Provides the means for authenticating requests made by the client. This parameter can
269
- # be many types.
270
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
271
- # authenticating requests made by this client.
272
- # A `String` will be treated as the path to the keyfile to be used for the construction of
273
- # credentials for this client.
274
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
275
- # credentials for this client.
276
- # A `GRPC::Core::Channel` will be used to make calls through.
277
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
278
- # should already be composed with a `GRPC::Core::CallCredentials` object.
279
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
280
- # metadata for requests, generally, to give OAuth credentials.
281
- # @param scopes [Array<String>]
282
- # The OAuth scopes for this service. This parameter is ignored if
283
- # an updater_proc is supplied.
284
- # @param client_config [Hash]
285
- # A Hash for call options for each method. See
286
- # Google::Gax#construct_settings for the structure of
287
- # this data. Falls back to the default config if not specified
288
- # or the specified config is missing data points.
289
- # @param timeout [Numeric]
290
- # The default timeout, in seconds, for calls made through this client.
291
- # @param metadata [Hash]
292
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
293
- # @param service_address [String]
294
- # Override for the service hostname, or `nil` to leave as the default.
295
- # @param service_port [Integer]
296
- # Override for the service port, or `nil` to leave as the default.
297
- # @param exception_transformer [Proc]
298
- # An optional proc that intercepts any exceptions raised during an API call to inject
299
- # custom error handling.
300
- def self.new(*args, version: :v4beta1, **kwargs)
301
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
302
- raise "The version: #{version} is not available. The available versions " \
303
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
304
- end
305
-
306
- require "#{FILE_DIR}/#{version.to_s.downcase}"
307
- version_module = Google::Cloud::Talent
308
- .constants
309
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
310
- .first
311
- Google::Cloud::Talent.const_get(version_module)::Event.new(*args, **kwargs)
312
- end
107
+ ##
108
+ # Create a new client object for EventService.
109
+ #
110
+ # By default, this returns an instance of
111
+ # [Google::Cloud::Talent::V4::EventService::Client](https://googleapis.dev/ruby/google-cloud-talent-v4/latest/Google/Cloud/Talent/V4/EventService/Client.html)
112
+ # for version V4 of the API.
113
+ # However, you can specify specify a different API version by passing it in the
114
+ # `version` parameter. If the EventService service is
115
+ # supported by that API version, and the corresponding gem is available, the
116
+ # appropriate versioned client will be returned.
117
+ #
118
+ # ## About EventService
119
+ #
120
+ # A service handles client event report.
121
+ #
122
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
123
+ # Defaults to `:v4`.
124
+ # @return [EventService::Client] A client object for the specified version.
125
+ #
126
+ def self.event_service version: :v4, &block
127
+ require "google/cloud/talent/#{version.to_s.downcase}"
128
+
129
+ package_name = Google::Cloud::Talent
130
+ .constants
131
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
132
+ .first
133
+ package_module = Google::Cloud::Talent.const_get package_name
134
+ package_module.const_get(:EventService).const_get(:Client).new(&block)
313
135
  end
314
136
 
315
- module JobService
316
- ##
317
- # A service handles job management, including job CRUD, enumeration and search.
318
- #
319
- # @param version [Symbol, String]
320
- # The major version of the service to be used. By default :v4beta1
321
- # is used.
322
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
323
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
324
- # Provides the means for authenticating requests made by the client. This parameter can
325
- # be many types.
326
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
327
- # authenticating requests made by this client.
328
- # A `String` will be treated as the path to the keyfile to be used for the construction of
329
- # credentials for this client.
330
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
331
- # credentials for this client.
332
- # A `GRPC::Core::Channel` will be used to make calls through.
333
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
334
- # should already be composed with a `GRPC::Core::CallCredentials` object.
335
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
336
- # metadata for requests, generally, to give OAuth credentials.
337
- # @param scopes [Array<String>]
338
- # The OAuth scopes for this service. This parameter is ignored if
339
- # an updater_proc is supplied.
340
- # @param client_config [Hash]
341
- # A Hash for call options for each method. See
342
- # Google::Gax#construct_settings for the structure of
343
- # this data. Falls back to the default config if not specified
344
- # or the specified config is missing data points.
345
- # @param timeout [Numeric]
346
- # The default timeout, in seconds, for calls made through this client.
347
- # @param metadata [Hash]
348
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
349
- # @param service_address [String]
350
- # Override for the service hostname, or `nil` to leave as the default.
351
- # @param service_port [Integer]
352
- # Override for the service port, or `nil` to leave as the default.
353
- # @param exception_transformer [Proc]
354
- # An optional proc that intercepts any exceptions raised during an API call to inject
355
- # custom error handling.
356
- def self.new(*args, version: :v4beta1, **kwargs)
357
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
358
- raise "The version: #{version} is not available. The available versions " \
359
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
360
- end
361
-
362
- require "#{FILE_DIR}/#{version.to_s.downcase}"
363
- version_module = Google::Cloud::Talent
364
- .constants
365
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
366
- .first
367
- Google::Cloud::Talent.const_get(version_module)::JobService.new(*args, **kwargs)
368
- end
137
+ ##
138
+ # Create a new client object for JobService.
139
+ #
140
+ # By default, this returns an instance of
141
+ # [Google::Cloud::Talent::V4::JobService::Client](https://googleapis.dev/ruby/google-cloud-talent-v4/latest/Google/Cloud/Talent/V4/JobService/Client.html)
142
+ # for version V4 of the API.
143
+ # However, you can specify specify a different API version by passing it in the
144
+ # `version` parameter. If the JobService service is
145
+ # supported by that API version, and the corresponding gem is available, the
146
+ # appropriate versioned client will be returned.
147
+ #
148
+ # ## About JobService
149
+ #
150
+ # A service handles job management, including job CRUD, enumeration and search.
151
+ #
152
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
153
+ # Defaults to `:v4`.
154
+ # @return [JobService::Client] A client object for the specified version.
155
+ #
156
+ def self.job_service version: :v4, &block
157
+ require "google/cloud/talent/#{version.to_s.downcase}"
158
+
159
+ package_name = Google::Cloud::Talent
160
+ .constants
161
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
162
+ .first
163
+ package_module = Google::Cloud::Talent.const_get package_name
164
+ package_module.const_get(:JobService).const_get(:Client).new(&block)
369
165
  end
370
166
 
371
- module ProfileService
372
- ##
373
- # A service that handles profile management, including profile CRUD,
374
- # enumeration and search.
375
- #
376
- # @param version [Symbol, String]
377
- # The major version of the service to be used. By default :v4beta1
378
- # is used.
379
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
380
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
381
- # Provides the means for authenticating requests made by the client. This parameter can
382
- # be many types.
383
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
384
- # authenticating requests made by this client.
385
- # A `String` will be treated as the path to the keyfile to be used for the construction of
386
- # credentials for this client.
387
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
388
- # credentials for this client.
389
- # A `GRPC::Core::Channel` will be used to make calls through.
390
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
391
- # should already be composed with a `GRPC::Core::CallCredentials` object.
392
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
393
- # metadata for requests, generally, to give OAuth credentials.
394
- # @param scopes [Array<String>]
395
- # The OAuth scopes for this service. This parameter is ignored if
396
- # an updater_proc is supplied.
397
- # @param client_config [Hash]
398
- # A Hash for call options for each method. See
399
- # Google::Gax#construct_settings for the structure of
400
- # this data. Falls back to the default config if not specified
401
- # or the specified config is missing data points.
402
- # @param timeout [Numeric]
403
- # The default timeout, in seconds, for calls made through this client.
404
- # @param metadata [Hash]
405
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
406
- # @param service_address [String]
407
- # Override for the service hostname, or `nil` to leave as the default.
408
- # @param service_port [Integer]
409
- # Override for the service port, or `nil` to leave as the default.
410
- # @param exception_transformer [Proc]
411
- # An optional proc that intercepts any exceptions raised during an API call to inject
412
- # custom error handling.
413
- def self.new(*args, version: :v4beta1, **kwargs)
414
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
415
- raise "The version: #{version} is not available. The available versions " \
416
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
417
- end
418
-
419
- require "#{FILE_DIR}/#{version.to_s.downcase}"
420
- version_module = Google::Cloud::Talent
421
- .constants
422
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
423
- .first
424
- Google::Cloud::Talent.const_get(version_module)::ProfileService.new(*args, **kwargs)
425
- end
167
+ ##
168
+ # Create a new client object for TenantService.
169
+ #
170
+ # By default, this returns an instance of
171
+ # [Google::Cloud::Talent::V4::TenantService::Client](https://googleapis.dev/ruby/google-cloud-talent-v4/latest/Google/Cloud/Talent/V4/TenantService/Client.html)
172
+ # for version V4 of the API.
173
+ # However, you can specify specify a different API version by passing it in the
174
+ # `version` parameter. If the TenantService service is
175
+ # supported by that API version, and the corresponding gem is available, the
176
+ # appropriate versioned client will be returned.
177
+ #
178
+ # ## About TenantService
179
+ #
180
+ # A service that handles tenant management, including CRUD and enumeration.
181
+ #
182
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
183
+ # Defaults to `:v4`.
184
+ # @return [TenantService::Client] A client object for the specified version.
185
+ #
186
+ def self.tenant_service version: :v4, &block
187
+ require "google/cloud/talent/#{version.to_s.downcase}"
188
+
189
+ package_name = Google::Cloud::Talent
190
+ .constants
191
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
192
+ .first
193
+ package_module = Google::Cloud::Talent.const_get package_name
194
+ package_module.const_get(:TenantService).const_get(:Client).new(&block)
426
195
  end
427
196
 
428
- module TenantService
429
- ##
430
- # A service that handles tenant management, including CRUD and enumeration.
431
- #
432
- # @param version [Symbol, String]
433
- # The major version of the service to be used. By default :v4beta1
434
- # is used.
435
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
436
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
437
- # Provides the means for authenticating requests made by the client. This parameter can
438
- # be many types.
439
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
440
- # authenticating requests made by this client.
441
- # A `String` will be treated as the path to the keyfile to be used for the construction of
442
- # credentials for this client.
443
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
444
- # credentials for this client.
445
- # A `GRPC::Core::Channel` will be used to make calls through.
446
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
447
- # should already be composed with a `GRPC::Core::CallCredentials` object.
448
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
449
- # metadata for requests, generally, to give OAuth credentials.
450
- # @param scopes [Array<String>]
451
- # The OAuth scopes for this service. This parameter is ignored if
452
- # an updater_proc is supplied.
453
- # @param client_config [Hash]
454
- # A Hash for call options for each method. See
455
- # Google::Gax#construct_settings for the structure of
456
- # this data. Falls back to the default config if not specified
457
- # or the specified config is missing data points.
458
- # @param timeout [Numeric]
459
- # The default timeout, in seconds, for calls made through this client.
460
- # @param metadata [Hash]
461
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
462
- # @param service_address [String]
463
- # Override for the service hostname, or `nil` to leave as the default.
464
- # @param service_port [Integer]
465
- # Override for the service port, or `nil` to leave as the default.
466
- # @param exception_transformer [Proc]
467
- # An optional proc that intercepts any exceptions raised during an API call to inject
468
- # custom error handling.
469
- def self.new(*args, version: :v4beta1, **kwargs)
470
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
471
- raise "The version: #{version} is not available. The available versions " \
472
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
473
- end
474
-
475
- require "#{FILE_DIR}/#{version.to_s.downcase}"
476
- version_module = Google::Cloud::Talent
477
- .constants
478
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
479
- .first
480
- Google::Cloud::Talent.const_get(version_module)::TenantService.new(*args, **kwargs)
481
- end
197
+ ##
198
+ # Configure the google-cloud-talent library.
199
+ #
200
+ # The following configuration parameters are supported:
201
+ #
202
+ # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) -
203
+ # The path to the keyfile as a String, the contents of the keyfile as a
204
+ # Hash, or a Google::Auth::Credentials object.
205
+ # * `lib_name` (*type:* `String`) -
206
+ # The library name as recorded in instrumentation and logging.
207
+ # * `lib_version` (*type:* `String`) -
208
+ # The library version as recorded in instrumentation and logging.
209
+ # * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
210
+ # An array of interceptors that are run before calls are executed.
211
+ # * `timeout` (*type:* `Numeric`) -
212
+ # Default timeout in seconds.
213
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) -
214
+ # Additional gRPC headers to be sent with the call.
215
+ # * `retry_policy` (*type:* `Hash`) -
216
+ # The retry policy. The value is a hash with the following keys:
217
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
218
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
219
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
220
+ # * `:retry_codes` (*type:* `Array<String>`) -
221
+ # The error codes that should trigger a retry.
222
+ #
223
+ # @return [::Google::Cloud::Config] The default configuration used by this library
224
+ #
225
+ def self.configure
226
+ yield ::Google::Cloud.configure.talent if block_given?
227
+
228
+ ::Google::Cloud.configure.talent
482
229
  end
483
230
  end
484
231
  end
485
232
  end
233
+
234
+ helper_path = ::File.join __dir__, "talent", "helpers.rb"
235
+ require "google/cloud/talent/helpers" if ::File.file? helper_path