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
@@ -1,51 +0,0 @@
1
- {
2
- "interfaces": {
3
- "google.cloud.talent.v4beta1.CompanyService": {
4
- "retry_codes": {
5
- "idempotent": [
6
- "DEADLINE_EXCEEDED",
7
- "UNAVAILABLE"
8
- ],
9
- "non_idempotent": []
10
- },
11
- "retry_params": {
12
- "default": {
13
- "initial_retry_delay_millis": 100,
14
- "retry_delay_multiplier": 1.3,
15
- "max_retry_delay_millis": 60000,
16
- "initial_rpc_timeout_millis": 20000,
17
- "rpc_timeout_multiplier": 1.0,
18
- "max_rpc_timeout_millis": 20000,
19
- "total_timeout_millis": 600000
20
- }
21
- },
22
- "methods": {
23
- "CreateCompany": {
24
- "timeout_millis": 30000,
25
- "retry_codes_name": "non_idempotent",
26
- "retry_params_name": "default"
27
- },
28
- "GetCompany": {
29
- "timeout_millis": 30000,
30
- "retry_codes_name": "idempotent",
31
- "retry_params_name": "default"
32
- },
33
- "UpdateCompany": {
34
- "timeout_millis": 30000,
35
- "retry_codes_name": "non_idempotent",
36
- "retry_params_name": "default"
37
- },
38
- "DeleteCompany": {
39
- "timeout_millis": 30000,
40
- "retry_codes_name": "idempotent",
41
- "retry_params_name": "default"
42
- },
43
- "ListCompanies": {
44
- "timeout_millis": 30000,
45
- "retry_codes_name": "idempotent",
46
- "retry_params_name": "default"
47
- }
48
- }
49
- }
50
- }
51
- }
@@ -1,56 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/talent/v4beta1/company_service.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/api/resource_pb'
11
- require 'google/cloud/talent/v4beta1/common_pb'
12
- require 'google/cloud/talent/v4beta1/company_pb'
13
- require 'google/protobuf/empty_pb'
14
- require 'google/protobuf/field_mask_pb'
15
- Google::Protobuf::DescriptorPool.generated_pool.build do
16
- add_message "google.cloud.talent.v4beta1.CreateCompanyRequest" do
17
- optional :parent, :string, 1
18
- optional :company, :message, 2, "google.cloud.talent.v4beta1.Company"
19
- end
20
- add_message "google.cloud.talent.v4beta1.GetCompanyRequest" do
21
- optional :name, :string, 1
22
- end
23
- add_message "google.cloud.talent.v4beta1.UpdateCompanyRequest" do
24
- optional :company, :message, 1, "google.cloud.talent.v4beta1.Company"
25
- optional :update_mask, :message, 2, "google.protobuf.FieldMask"
26
- end
27
- add_message "google.cloud.talent.v4beta1.DeleteCompanyRequest" do
28
- optional :name, :string, 1
29
- end
30
- add_message "google.cloud.talent.v4beta1.ListCompaniesRequest" do
31
- optional :parent, :string, 1
32
- optional :page_token, :string, 2
33
- optional :page_size, :int32, 3
34
- optional :require_open_jobs, :bool, 4
35
- end
36
- add_message "google.cloud.talent.v4beta1.ListCompaniesResponse" do
37
- repeated :companies, :message, 1, "google.cloud.talent.v4beta1.Company"
38
- optional :next_page_token, :string, 2
39
- optional :metadata, :message, 3, "google.cloud.talent.v4beta1.ResponseMetadata"
40
- end
41
- end
42
-
43
- module Google
44
- module Cloud
45
- module Talent
46
- module V4beta1
47
- CreateCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateCompanyRequest").msgclass
48
- GetCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetCompanyRequest").msgclass
49
- UpdateCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateCompanyRequest").msgclass
50
- DeleteCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteCompanyRequest").msgclass
51
- ListCompaniesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesRequest").msgclass
52
- ListCompaniesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesResponse").msgclass
53
- end
54
- end
55
- end
56
- end
@@ -1,56 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/cloud/talent/v4beta1/company_service.proto for package 'google.cloud.talent.v4beta1'
3
- # Original file comments:
4
- # Copyright 2019 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/cloud/talent/v4beta1/company_service_pb'
23
-
24
- module Google
25
- module Cloud
26
- module Talent
27
- module V4beta1
28
- module CompanyService
29
- # A service that handles company management, including CRUD and enumeration.
30
- class Service
31
-
32
- include GRPC::GenericService
33
-
34
- self.marshal_class_method = :encode
35
- self.unmarshal_class_method = :decode
36
- self.service_name = 'google.cloud.talent.v4beta1.CompanyService'
37
-
38
- # Creates a new company entity.
39
- rpc :CreateCompany, CreateCompanyRequest, Company
40
- # Retrieves specified company.
41
- rpc :GetCompany, GetCompanyRequest, Company
42
- # Updates specified company.
43
- rpc :UpdateCompany, UpdateCompanyRequest, Company
44
- # Deletes specified company.
45
- # Prerequisite: The company has no jobs associated with it.
46
- rpc :DeleteCompany, DeleteCompanyRequest, Google::Protobuf::Empty
47
- # Lists all companies associated with the project.
48
- rpc :ListCompanies, ListCompaniesRequest, ListCompaniesResponse
49
- end
50
-
51
- Stub = Service.rpc_stub_class
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,337 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/cloud/talent/v4beta1/completion_service.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/cloud/talent/v4beta1/completion_service_pb"
29
- require "google/cloud/talent/v4beta1/credentials"
30
- require "google/cloud/talent/version"
31
-
32
- module Google
33
- module Cloud
34
- module Talent
35
- module V4beta1
36
- # A service handles auto completion.
37
- #
38
- # @!attribute [r] completion_stub
39
- # @return [Google::Cloud::Talent::V4beta1::Completion::Stub]
40
- class CompletionClient
41
- # @private
42
- attr_reader :completion_stub
43
-
44
- # The default address of the service.
45
- SERVICE_ADDRESS = "jobs.googleapis.com".freeze
46
-
47
- # The default port of the service.
48
- DEFAULT_SERVICE_PORT = 443
49
-
50
- # The default set of gRPC interceptors.
51
- GRPC_INTERCEPTORS = []
52
-
53
- DEFAULT_TIMEOUT = 30
54
-
55
- # The scopes needed to make gRPC calls to all of the methods defined in
56
- # this service.
57
- ALL_SCOPES = [
58
- "https://www.googleapis.com/auth/cloud-platform",
59
- "https://www.googleapis.com/auth/jobs"
60
- ].freeze
61
-
62
-
63
- COMPANY_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
64
- "projects/{project}/tenants/{tenant}/companies/{company}"
65
- )
66
-
67
- private_constant :COMPANY_PATH_TEMPLATE
68
-
69
- COMPANY_WITHOUT_TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
70
- "projects/{project}/companies/{company}"
71
- )
72
-
73
- private_constant :COMPANY_WITHOUT_TENANT_PATH_TEMPLATE
74
-
75
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
76
- "projects/{project}"
77
- )
78
-
79
- private_constant :PROJECT_PATH_TEMPLATE
80
-
81
- TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
82
- "projects/{project}/tenants/{tenant}"
83
- )
84
-
85
- private_constant :TENANT_PATH_TEMPLATE
86
-
87
- # Returns a fully-qualified company resource name string.
88
- # @param project [String]
89
- # @param tenant [String]
90
- # @param company [String]
91
- # @return [String]
92
- def self.company_path project, tenant, company
93
- COMPANY_PATH_TEMPLATE.render(
94
- :"project" => project,
95
- :"tenant" => tenant,
96
- :"company" => company
97
- )
98
- end
99
-
100
- # Returns a fully-qualified company_without_tenant resource name string.
101
- # @param project [String]
102
- # @param company [String]
103
- # @return [String]
104
- def self.company_without_tenant_path project, company
105
- COMPANY_WITHOUT_TENANT_PATH_TEMPLATE.render(
106
- :"project" => project,
107
- :"company" => company
108
- )
109
- end
110
-
111
- # Returns a fully-qualified project resource name string.
112
- # @param project [String]
113
- # @return [String]
114
- def self.project_path project
115
- PROJECT_PATH_TEMPLATE.render(
116
- :"project" => project
117
- )
118
- end
119
-
120
- # Returns a fully-qualified tenant resource name string.
121
- # @param project [String]
122
- # @param tenant [String]
123
- # @return [String]
124
- def self.tenant_path project, tenant
125
- TENANT_PATH_TEMPLATE.render(
126
- :"project" => project,
127
- :"tenant" => tenant
128
- )
129
- end
130
-
131
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
132
- # Provides the means for authenticating requests made by the client. This parameter can
133
- # be many types.
134
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
135
- # authenticating requests made by this client.
136
- # A `String` will be treated as the path to the keyfile to be used for the construction of
137
- # credentials for this client.
138
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
139
- # credentials for this client.
140
- # A `GRPC::Core::Channel` will be used to make calls through.
141
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
142
- # should already be composed with a `GRPC::Core::CallCredentials` object.
143
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
144
- # metadata for requests, generally, to give OAuth credentials.
145
- # @param scopes [Array<String>]
146
- # The OAuth scopes for this service. This parameter is ignored if
147
- # an updater_proc is supplied.
148
- # @param client_config [Hash]
149
- # A Hash for call options for each method. See
150
- # Google::Gax#construct_settings for the structure of
151
- # this data. Falls back to the default config if not specified
152
- # or the specified config is missing data points.
153
- # @param timeout [Numeric]
154
- # The default timeout, in seconds, for calls made through this client.
155
- # @param metadata [Hash]
156
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
157
- # @param service_address [String]
158
- # Override for the service hostname, or `nil` to leave as the default.
159
- # @param service_port [Integer]
160
- # Override for the service port, or `nil` to leave as the default.
161
- # @param exception_transformer [Proc]
162
- # An optional proc that intercepts any exceptions raised during an API call to inject
163
- # custom error handling.
164
- def initialize \
165
- credentials: nil,
166
- scopes: ALL_SCOPES,
167
- client_config: {},
168
- timeout: DEFAULT_TIMEOUT,
169
- metadata: nil,
170
- service_address: nil,
171
- service_port: nil,
172
- exception_transformer: nil,
173
- lib_name: nil,
174
- lib_version: ""
175
- # These require statements are intentionally placed here to initialize
176
- # the gRPC module only when it's required.
177
- # See https://github.com/googleapis/toolkit/issues/446
178
- require "google/gax/grpc"
179
- require "google/cloud/talent/v4beta1/completion_service_services_pb"
180
-
181
- credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
182
-
183
- if credentials.is_a?(String) || credentials.is_a?(Hash)
184
- updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
185
- end
186
- if credentials.is_a?(GRPC::Core::Channel)
187
- channel = credentials
188
- end
189
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
190
- chan_creds = credentials
191
- end
192
- if credentials.is_a?(Proc)
193
- updater_proc = credentials
194
- end
195
- if credentials.is_a?(Google::Auth::Credentials)
196
- updater_proc = credentials.updater_proc
197
- end
198
-
199
- package_version = Google::Cloud::Talent::VERSION
200
-
201
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
202
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
203
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
204
- google_api_client << " grpc/#{GRPC::VERSION}"
205
- google_api_client.freeze
206
-
207
- headers = { :"x-goog-api-client" => google_api_client }
208
- headers.merge!(metadata) unless metadata.nil?
209
- client_config_file = Pathname.new(__dir__).join(
210
- "completion_client_config.json"
211
- )
212
- defaults = client_config_file.open do |f|
213
- Google::Gax.construct_settings(
214
- "google.cloud.talent.v4beta1.Completion",
215
- JSON.parse(f.read),
216
- client_config,
217
- Google::Gax::Grpc::STATUS_CODE_NAMES,
218
- timeout,
219
- errors: Google::Gax::Grpc::API_ERRORS,
220
- metadata: headers
221
- )
222
- end
223
-
224
- # Allow overriding the service path/port in subclasses.
225
- service_path = service_address || self.class::SERVICE_ADDRESS
226
- port = service_port || self.class::DEFAULT_SERVICE_PORT
227
- interceptors = self.class::GRPC_INTERCEPTORS
228
- @completion_stub = Google::Gax::Grpc.create_stub(
229
- service_path,
230
- port,
231
- chan_creds: chan_creds,
232
- channel: channel,
233
- updater_proc: updater_proc,
234
- scopes: scopes,
235
- interceptors: interceptors,
236
- &Google::Cloud::Talent::V4beta1::Completion::Stub.method(:new)
237
- )
238
-
239
- @complete_query = Google::Gax.create_api_call(
240
- @completion_stub.method(:complete_query),
241
- defaults["complete_query"],
242
- exception_transformer: exception_transformer,
243
- params_extractor: proc do |request|
244
- {'parent' => request.parent}
245
- end
246
- )
247
- end
248
-
249
- # Service calls
250
-
251
- # Completes the specified prefix with keyword suggestions.
252
- # Intended for use by a job search auto-complete search box.
253
- #
254
- # @param parent [String]
255
- # Required. Resource name of tenant the completion is performed within.
256
- #
257
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
258
- # "projects/foo/tenant/bar".
259
- #
260
- # If tenant id is unspecified, the default tenant is used, for
261
- # example, "projects/foo".
262
- # @param query [String]
263
- # Required. The query used to generate suggestions.
264
- #
265
- # The maximum number of allowed characters is 255.
266
- # @param page_size [Integer]
267
- # Required. Completion result count.
268
- #
269
- # The maximum allowed page size is 10.
270
- # @param language_codes [Array<String>]
271
- # The list of languages of the query. This is
272
- # the BCP-47 language code, such as "en-US" or "sr-Latn".
273
- # For more information, see
274
- # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47).
275
- #
276
- # The maximum number of allowed characters is 255.
277
- # @param company [String]
278
- # If provided, restricts completion to specified company.
279
- #
280
- # The format is
281
- # "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
282
- # example, "projects/foo/tenants/bar/companies/baz".
283
- #
284
- # If tenant id is unspecified, the default tenant is used, for
285
- # example, "projects/foo".
286
- # @param scope [Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope]
287
- # The scope of the completion. The defaults is {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope::PUBLIC}.
288
- # @param type [Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType]
289
- # The completion topic. The default is {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType::COMBINED}.
290
- # @param options [Google::Gax::CallOptions]
291
- # Overrides the default settings for this call, e.g, timeout,
292
- # retries, etc.
293
- # @yield [result, operation] Access the result along with the RPC operation
294
- # @yieldparam result [Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
295
- # @yieldparam operation [GRPC::ActiveCall::Operation]
296
- # @return [Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
297
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
298
- # @example
299
- # require "google/cloud/talent"
300
- #
301
- # completion_client = Google::Cloud::Talent::Completion.new(version: :v4beta1)
302
- # formatted_parent = Google::Cloud::Talent::V4beta1::CompletionClient.tenant_path("[PROJECT]", "[TENANT]")
303
- #
304
- # # TODO: Initialize `query`:
305
- # query = ''
306
- #
307
- # # TODO: Initialize `page_size`:
308
- # page_size = 0
309
- # response = completion_client.complete_query(formatted_parent, query, page_size)
310
-
311
- def complete_query \
312
- parent,
313
- query,
314
- page_size,
315
- language_codes: nil,
316
- company: nil,
317
- scope: nil,
318
- type: nil,
319
- options: nil,
320
- &block
321
- req = {
322
- parent: parent,
323
- query: query,
324
- page_size: page_size,
325
- language_codes: language_codes,
326
- company: company,
327
- scope: scope,
328
- type: type
329
- }.delete_if { |_, v| v.nil? }
330
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CompleteQueryRequest)
331
- @complete_query.call(req, options, &block)
332
- end
333
- end
334
- end
335
- end
336
- end
337
- end