google-cloud-talent-v4beta1 0.6.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/google/cloud/talent/v4beta1/batch_pb.rb +25 -2
  4. data/lib/google/cloud/talent/v4beta1/common_pb.rb +29 -230
  5. data/lib/google/cloud/talent/v4beta1/company_pb.rb +25 -19
  6. data/lib/google/cloud/talent/v4beta1/company_service/client.rb +18 -14
  7. data/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +693 -0
  8. data/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +382 -0
  9. data/lib/google/cloud/talent/v4beta1/company_service/rest.rb +52 -0
  10. data/lib/google/cloud/talent/v4beta1/company_service.rb +7 -1
  11. data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +27 -26
  12. data/lib/google/cloud/talent/v4beta1/completion/client.rb +6 -4
  13. data/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +386 -0
  14. data/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +114 -0
  15. data/lib/google/cloud/talent/v4beta1/completion/rest.rb +52 -0
  16. data/lib/google/cloud/talent/v4beta1/completion.rb +7 -1
  17. data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +25 -30
  18. data/lib/google/cloud/talent/v4beta1/event_pb.rb +25 -33
  19. data/lib/google/cloud/talent/v4beta1/event_service/client.rb +4 -4
  20. data/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +359 -0
  21. data/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +116 -0
  22. data/lib/google/cloud/talent/v4beta1/event_service/rest.rb +52 -0
  23. data/lib/google/cloud/talent/v4beta1/event_service.rb +7 -1
  24. data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +25 -5
  25. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +28 -59
  26. data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +24 -8
  27. data/lib/google/cloud/talent/v4beta1/job_pb.rb +26 -46
  28. data/lib/google/cloud/talent/v4beta1/job_service/client.rb +250 -161
  29. data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +14 -16
  30. data/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +1712 -0
  31. data/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +793 -0
  32. data/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +721 -0
  33. data/lib/google/cloud/talent/v4beta1/job_service/rest.rb +53 -0
  34. data/lib/google/cloud/talent/v4beta1/job_service.rb +7 -1
  35. data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +31 -123
  36. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +12 -8
  37. data/lib/google/cloud/talent/v4beta1/rest.rb +41 -0
  38. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +24 -12
  39. data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +15 -12
  40. data/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +672 -0
  41. data/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +345 -0
  42. data/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb +52 -0
  43. data/lib/google/cloud/talent/v4beta1/tenant_service.rb +7 -1
  44. data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +27 -25
  45. data/lib/google/cloud/talent/v4beta1/version.rb +1 -1
  46. data/lib/google/cloud/talent/v4beta1.rb +7 -2
  47. data/proto_docs/google/api/client.rb +381 -0
  48. data/proto_docs/google/api/launch_stage.rb +71 -0
  49. data/proto_docs/google/cloud/talent/v4beta1/common.rb +117 -56
  50. data/proto_docs/google/cloud/talent/v4beta1/company.rb +10 -5
  51. data/proto_docs/google/cloud/talent/v4beta1/company_service.rb +12 -6
  52. data/proto_docs/google/cloud/talent/v4beta1/completion_service.rb +21 -10
  53. data/proto_docs/google/cloud/talent/v4beta1/event.rb +20 -10
  54. data/proto_docs/google/cloud/talent/v4beta1/event_service.rb +2 -2
  55. data/proto_docs/google/cloud/talent/v4beta1/filters.rb +62 -38
  56. data/proto_docs/google/cloud/talent/v4beta1/histogram.rb +8 -3
  57. data/proto_docs/google/cloud/talent/v4beta1/job.rb +86 -54
  58. data/proto_docs/google/cloud/talent/v4beta1/job_service.rb +211 -120
  59. data/proto_docs/google/cloud/talent/v4beta1/tenant.rb +9 -5
  60. data/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb +9 -4
  61. data/proto_docs/google/protobuf/any.rb +7 -4
  62. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  63. data/proto_docs/google/rpc/status.rb +4 -2
  64. metadata +28 -8
@@ -0,0 +1,386 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/talent/v4beta1/completion_service_pb"
21
+ require "google/cloud/talent/v4beta1/completion/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Talent
26
+ module V4beta1
27
+ module Completion
28
+ module Rest
29
+ ##
30
+ # REST client for the Completion service.
31
+ #
32
+ # A service handles auto completion.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :completion_stub
39
+
40
+ ##
41
+ # Configure the Completion Client class.
42
+ #
43
+ # See {::Google::Cloud::Talent::V4beta1::Completion::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all Completion clients
49
+ # ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Talent", "V4beta1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.complete_query.timeout = 30.0
70
+ default_config.rpcs.complete_query.retry_policy = {
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
72
+ }
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the Completion Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::Talent::V4beta1::Completion::Rest::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # Create a new Completion REST client object.
102
+ #
103
+ # @example
104
+ #
105
+ # # Create a client using the default configuration
106
+ # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new
107
+ #
108
+ # # Create a client using a custom configuration
109
+ # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config|
110
+ # config.timeout = 10.0
111
+ # end
112
+ #
113
+ # @yield [config] Configure the Completion client.
114
+ # @yieldparam config [Client::Configuration]
115
+ #
116
+ def initialize
117
+ # Create the configuration object
118
+ @config = Configuration.new Client.configure
119
+
120
+ # Yield the configuration if needed
121
+ yield @config if block_given?
122
+
123
+ # Create credentials
124
+ credentials = @config.credentials
125
+ # Use self-signed JWT if the endpoint is unchanged from default,
126
+ # but only if the default endpoint does not have a region prefix.
127
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
128
+ !@config.endpoint.split(".").first.include?("-")
129
+ credentials ||= Credentials.default scope: @config.scope,
130
+ enable_self_signed_jwt: enable_self_signed_jwt
131
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
132
+ credentials = Credentials.new credentials, scope: @config.scope
133
+ end
134
+
135
+ @quota_project_id = @config.quota_project
136
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
+
138
+ @completion_stub = ::Google::Cloud::Talent::V4beta1::Completion::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
139
+ end
140
+
141
+ # Service calls
142
+
143
+ ##
144
+ # Completes the specified prefix with keyword suggestions.
145
+ # Intended for use by a job search auto-complete search box.
146
+ #
147
+ # @overload complete_query(request, options = nil)
148
+ # Pass arguments to `complete_query` via a request object, either of type
149
+ # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest} or an equivalent Hash.
150
+ #
151
+ # @param request [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Hash]
152
+ # A request object representing the call parameters. Required. To specify no
153
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
154
+ # @param options [::Gapic::CallOptions, ::Hash]
155
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
156
+ #
157
+ # @overload complete_query(parent: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil)
158
+ # Pass arguments to `complete_query` via keyword arguments. Note that at
159
+ # least one keyword argument is required. To specify no parameters, or to keep all
160
+ # the default parameter values, pass an empty Hash as a request object (see above).
161
+ #
162
+ # @param parent [::String]
163
+ # Required. Resource name of tenant the completion is performed within.
164
+ #
165
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
166
+ # "projects/foo/tenant/bar".
167
+ #
168
+ # If tenant id is unspecified, the default tenant is used, for
169
+ # example, "projects/foo".
170
+ # @param query [::String]
171
+ # Required. The query used to generate suggestions.
172
+ #
173
+ # The maximum number of allowed characters is 255.
174
+ # @param language_codes [::Array<::String>]
175
+ # The list of languages of the query. This is
176
+ # the BCP-47 language code, such as "en-US" or "sr-Latn".
177
+ # For more information, see
178
+ # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47).
179
+ #
180
+ # The maximum number of allowed characters is 255.
181
+ # @param page_size [::Integer]
182
+ # Required. Completion result count.
183
+ #
184
+ # The maximum allowed page size is 10.
185
+ # @param company [::String]
186
+ # If provided, restricts completion to specified company.
187
+ #
188
+ # The format is
189
+ # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
190
+ # example, "projects/foo/tenants/bar/companies/baz".
191
+ #
192
+ # If tenant id is unspecified, the default tenant is used, for
193
+ # example, "projects/foo".
194
+ # @param scope [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope]
195
+ # The scope of the completion. The defaults is
196
+ # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}.
197
+ # @param type [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType]
198
+ # The completion topic. The default is
199
+ # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}.
200
+ # @yield [result, operation] Access the result along with the TransportOperation object
201
+ # @yieldparam result [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
202
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
203
+ #
204
+ # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
205
+ #
206
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
207
+ def complete_query request, options = nil
208
+ raise ::ArgumentError, "request must be provided" if request.nil?
209
+
210
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest
211
+
212
+ # Converts hash and nil to an options object
213
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
214
+
215
+ # Customize the options with defaults
216
+ call_metadata = @config.rpcs.complete_query.metadata.to_h
217
+
218
+ # Set x-goog-api-client and x-goog-user-project headers
219
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
220
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
221
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
222
+ transports_version_send: [:rest]
223
+
224
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
225
+
226
+ options.apply_defaults timeout: @config.rpcs.complete_query.timeout,
227
+ metadata: call_metadata,
228
+ retry_policy: @config.rpcs.complete_query.retry_policy
229
+
230
+ options.apply_defaults timeout: @config.timeout,
231
+ metadata: @config.metadata,
232
+ retry_policy: @config.retry_policy
233
+
234
+ @completion_stub.complete_query request, options do |result, operation|
235
+ yield result, operation if block_given?
236
+ return result
237
+ end
238
+ rescue ::Gapic::Rest::Error => e
239
+ raise ::Google::Cloud::Error.from_error(e)
240
+ end
241
+
242
+ ##
243
+ # Configuration class for the Completion REST API.
244
+ #
245
+ # This class represents the configuration for Completion REST,
246
+ # providing control over timeouts, retry behavior, logging, transport
247
+ # parameters, and other low-level controls. Certain parameters can also be
248
+ # applied individually to specific RPCs. See
249
+ # {::Google::Cloud::Talent::V4beta1::Completion::Rest::Client::Configuration::Rpcs}
250
+ # for a list of RPCs that can be configured independently.
251
+ #
252
+ # Configuration can be applied globally to all clients, or to a single client
253
+ # on construction.
254
+ #
255
+ # @example
256
+ #
257
+ # # Modify the global config, setting the timeout for
258
+ # # complete_query to 20 seconds,
259
+ # # and all remaining timeouts to 10 seconds.
260
+ # ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.configure do |config|
261
+ # config.timeout = 10.0
262
+ # config.rpcs.complete_query.timeout = 20.0
263
+ # end
264
+ #
265
+ # # Apply the above configuration only to a new client.
266
+ # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config|
267
+ # config.timeout = 10.0
268
+ # config.rpcs.complete_query.timeout = 20.0
269
+ # end
270
+ #
271
+ # @!attribute [rw] endpoint
272
+ # The hostname or hostname:port of the service endpoint.
273
+ # Defaults to `"jobs.googleapis.com"`.
274
+ # @return [::String]
275
+ # @!attribute [rw] credentials
276
+ # Credentials to send with calls. You may provide any of the following types:
277
+ # * (`String`) The path to a service account key file in JSON format
278
+ # * (`Hash`) A service account key as a Hash
279
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
280
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
281
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
282
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
283
+ # * (`nil`) indicating no credentials
284
+ # @return [::Object]
285
+ # @!attribute [rw] scope
286
+ # The OAuth scopes
287
+ # @return [::Array<::String>]
288
+ # @!attribute [rw] lib_name
289
+ # The library name as recorded in instrumentation and logging
290
+ # @return [::String]
291
+ # @!attribute [rw] lib_version
292
+ # The library version as recorded in instrumentation and logging
293
+ # @return [::String]
294
+ # @!attribute [rw] timeout
295
+ # The call timeout in seconds.
296
+ # @return [::Numeric]
297
+ # @!attribute [rw] metadata
298
+ # Additional headers to be sent with the call.
299
+ # @return [::Hash{::Symbol=>::String}]
300
+ # @!attribute [rw] retry_policy
301
+ # The retry policy. The value is a hash with the following keys:
302
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
303
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
304
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
305
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
306
+ # trigger a retry.
307
+ # @return [::Hash]
308
+ # @!attribute [rw] quota_project
309
+ # A separate project against which to charge quota.
310
+ # @return [::String]
311
+ #
312
+ class Configuration
313
+ extend ::Gapic::Config
314
+
315
+ config_attr :endpoint, "jobs.googleapis.com", ::String
316
+ config_attr :credentials, nil do |value|
317
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
318
+ allowed.any? { |klass| klass === value }
319
+ end
320
+ config_attr :scope, nil, ::String, ::Array, nil
321
+ config_attr :lib_name, nil, ::String, nil
322
+ config_attr :lib_version, nil, ::String, nil
323
+ config_attr :timeout, nil, ::Numeric, nil
324
+ config_attr :metadata, nil, ::Hash, nil
325
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
326
+ config_attr :quota_project, nil, ::String, nil
327
+
328
+ # @private
329
+ def initialize parent_config = nil
330
+ @parent_config = parent_config unless parent_config.nil?
331
+
332
+ yield self if block_given?
333
+ end
334
+
335
+ ##
336
+ # Configurations for individual RPCs
337
+ # @return [Rpcs]
338
+ #
339
+ def rpcs
340
+ @rpcs ||= begin
341
+ parent_rpcs = nil
342
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
343
+ Rpcs.new parent_rpcs
344
+ end
345
+ end
346
+
347
+ ##
348
+ # Configuration RPC class for the Completion API.
349
+ #
350
+ # Includes fields providing the configuration for each RPC in this service.
351
+ # Each configuration object is of type `Gapic::Config::Method` and includes
352
+ # the following configuration fields:
353
+ #
354
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
355
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
356
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
357
+ # include the following keys:
358
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
359
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
360
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
361
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
362
+ # trigger a retry.
363
+ #
364
+ class Rpcs
365
+ ##
366
+ # RPC-specific configuration for `complete_query`
367
+ # @return [::Gapic::Config::Method]
368
+ #
369
+ attr_reader :complete_query
370
+
371
+ # @private
372
+ def initialize parent_rpcs = nil
373
+ complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query
374
+ @complete_query = ::Gapic::Config::Method.new complete_query_config
375
+
376
+ yield self if block_given?
377
+ end
378
+ end
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end
385
+ end
386
+ end
@@ -0,0 +1,114 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/talent/v4beta1/completion_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Talent
24
+ module V4beta1
25
+ module Completion
26
+ module Rest
27
+ ##
28
+ # REST service stub for the Completion service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: true,
40
+ raise_faraday_errors: false
41
+ end
42
+
43
+ ##
44
+ # Baseline implementation for the complete_query REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
56
+ # A result object deserialized from the server's reply
57
+ def complete_query request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split("=", 2) }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
81
+ ##
82
+ # @private
83
+ #
84
+ # GRPC transcoding helper method for the complete_query REST call
85
+ #
86
+ # @param request_pb [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest]
87
+ # A request object representing the call parameters. Required.
88
+ # @return [Array(String, [String, nil], Hash{String => String})]
89
+ # Uri, Body, Query string parameters
90
+ def self.transcode_complete_query_request request_pb
91
+ transcoder = Gapic::Rest::GrpcTranscoder.new
92
+ .with_bindings(
93
+ uri_method: :get,
94
+ uri_template: "/v4beta1/{parent}:complete",
95
+ matches: [
96
+ ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false]
97
+ ]
98
+ )
99
+ .with_bindings(
100
+ uri_method: :get,
101
+ uri_template: "/v4beta1/{parent}:complete",
102
+ matches: [
103
+ ["parent", %r{^projects/[^/]+/?$}, false]
104
+ ]
105
+ )
106
+ transcoder.transcode request_pb
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/talent/v4beta1/version"
24
+
25
+ require "google/cloud/talent/v4beta1/completion/credentials"
26
+ require "google/cloud/talent/v4beta1/completion/paths"
27
+ require "google/cloud/talent/v4beta1/completion/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Talent
32
+ module V4beta1
33
+ ##
34
+ # A service handles auto completion.
35
+ #
36
+ # To load this service and instantiate a REST client:
37
+ #
38
+ # require "google/cloud/talent/v4beta1/completion/rest"
39
+ # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new
40
+ #
41
+ module Completion
42
+ # Client for the REST transport
43
+ module Rest
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
52
+ require "google/cloud/talent/v4beta1/completion/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/talent/v4beta1/version"
25
25
  require "google/cloud/talent/v4beta1/completion/credentials"
26
26
  require "google/cloud/talent/v4beta1/completion/paths"
27
27
  require "google/cloud/talent/v4beta1/completion/client"
28
+ require "google/cloud/talent/v4beta1/completion/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -33,11 +34,16 @@ module Google
33
34
  ##
34
35
  # A service handles auto completion.
35
36
  #
36
- # To load this service and instantiate a client:
37
+ # @example Load this service and instantiate a gRPC client
37
38
  #
38
39
  # require "google/cloud/talent/v4beta1/completion"
39
40
  # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new
40
41
  #
42
+ # @example Load this service and instantiate a REST client
43
+ #
44
+ # require "google/cloud/talent/v4beta1/completion/rest"
45
+ # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new
46
+ #
41
47
  module Completion
42
48
  end
43
49
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/talent/v4beta1/completion_service.proto
3
4
 
@@ -9,38 +10,32 @@ require 'google/api/field_behavior_pb'
9
10
  require 'google/api/resource_pb'
10
11
  require 'google/cloud/talent/v4beta1/common_pb'
11
12
 
12
- Google::Protobuf::DescriptorPool.generated_pool.build do
13
- add_file("google/cloud/talent/v4beta1/completion_service.proto", :syntax => :proto3) do
14
- add_message "google.cloud.talent.v4beta1.CompleteQueryRequest" do
15
- optional :parent, :string, 1
16
- optional :query, :string, 2
17
- repeated :language_codes, :string, 3
18
- optional :page_size, :int32, 4
19
- optional :company, :string, 5
20
- optional :scope, :enum, 6, "google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope"
21
- optional :type, :enum, 7, "google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType"
22
- end
23
- add_enum "google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope" do
24
- value :COMPLETION_SCOPE_UNSPECIFIED, 0
25
- value :TENANT, 1
26
- value :PUBLIC, 2
27
- end
28
- add_enum "google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType" do
29
- value :COMPLETION_TYPE_UNSPECIFIED, 0
30
- value :JOB_TITLE, 1
31
- value :COMPANY_NAME, 2
32
- value :COMBINED, 3
33
- end
34
- add_message "google.cloud.talent.v4beta1.CompleteQueryResponse" do
35
- repeated :completion_results, :message, 1, "google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult"
36
- optional :metadata, :message, 2, "google.cloud.talent.v4beta1.ResponseMetadata"
37
- end
38
- add_message "google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult" do
39
- optional :suggestion, :string, 1
40
- optional :type, :enum, 2, "google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType"
41
- optional :image_uri, :string, 3
13
+
14
+ descriptor_data = "\n4google/cloud/talent/v4beta1/completion_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\"\x93\x04\n\x14\x43ompleteQueryRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12P\n\x05scope\x18\x06 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope\x12N\n\x04type\x18\x07 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType\"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02\"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03\"\xc5\x02\n\x15\x43ompleteQueryResponse\x12_\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult\x12?\n\x08metadata\x18\x02 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x1a\x89\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12N\n\x04type\x18\x02 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xd5\x02\n\nCompletion\x12\xd8\x01\n\rCompleteQuery\x12\x31.google.cloud.talent.v4beta1.CompleteQueryRequest\x1a\x32.google.cloud.talent.v4beta1.CompleteQueryResponse\"`\x82\xd3\xe4\x93\x02Z\x12//v4beta1/{parent=projects/*/tenants/*}:completeZ\'\x12%/v4beta1/{parent=projects/*}:complete\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBz\n\x1f\x63om.google.cloud.talent.v4beta1B\x16\x43ompletionServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3"
15
+
16
+ pool = Google::Protobuf::DescriptorPool.generated_pool
17
+
18
+ begin
19
+ pool.add_serialized_file(descriptor_data)
20
+ rescue TypeError => e
21
+ # Compatibility code: will be removed in the next major version.
22
+ require 'google/protobuf/descriptor_pb'
23
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
24
+ parsed.clear_dependency
25
+ serialized = parsed.class.encode(parsed)
26
+ file = pool.add_serialized_file(serialized)
27
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
28
+ imports = [
29
+ ["google.cloud.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.proto"],
30
+ ]
31
+ imports.each do |type_name, expected_filename|
32
+ import_file = pool.lookup(type_name).file_descriptor
33
+ if import_file.name != expected_filename
34
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
42
35
  end
43
36
  end
37
+ warn "Each proto file must use a consistent fully-qualified name."
38
+ warn "This will become an error in the next major version."
44
39
  end
45
40
 
46
41
  module Google