google-cloud-talent-v4beta1 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/talent/v4beta1/company_service/client.rb +16 -12
- data/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +693 -0
- data/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +382 -0
- data/lib/google/cloud/talent/v4beta1/company_service/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/company_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/completion/client.rb +4 -2
- data/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +386 -0
- data/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +114 -0
- data/lib/google/cloud/talent/v4beta1/completion/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/completion.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/event_service/client.rb +2 -2
- data/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +359 -0
- data/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +116 -0
- data/lib/google/cloud/talent/v4beta1/event_service/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/event_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/job_service/client.rb +248 -159
- data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +12 -14
- data/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +1712 -0
- data/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +793 -0
- data/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +721 -0
- data/lib/google/cloud/talent/v4beta1/job_service/rest.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/job_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +12 -8
- data/lib/google/cloud/talent/v4beta1/rest.rb +41 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +13 -10
- data/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +672 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +345 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/version.rb +1 -1
- data/lib/google/cloud/talent/v4beta1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/talent/v4beta1/common.rb +117 -56
- data/proto_docs/google/cloud/talent/v4beta1/company.rb +10 -5
- data/proto_docs/google/cloud/talent/v4beta1/company_service.rb +12 -6
- data/proto_docs/google/cloud/talent/v4beta1/completion_service.rb +21 -10
- data/proto_docs/google/cloud/talent/v4beta1/event.rb +20 -10
- data/proto_docs/google/cloud/talent/v4beta1/event_service.rb +2 -2
- data/proto_docs/google/cloud/talent/v4beta1/filters.rb +62 -38
- data/proto_docs/google/cloud/talent/v4beta1/histogram.rb +8 -3
- data/proto_docs/google/cloud/talent/v4beta1/job.rb +86 -54
- data/proto_docs/google/cloud/talent/v4beta1/job_service.rb +211 -120
- data/proto_docs/google/cloud/talent/v4beta1/tenant.rb +9 -5
- data/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb +9 -4
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +28 -8
@@ -0,0 +1,359 @@
|
|
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/event_service_pb"
|
21
|
+
require "google/cloud/talent/v4beta1/event_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Talent
|
26
|
+
module V4beta1
|
27
|
+
module EventService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the EventService service.
|
31
|
+
#
|
32
|
+
# A service handles client event report.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
include Paths
|
36
|
+
|
37
|
+
# @private
|
38
|
+
attr_reader :event_service_stub
|
39
|
+
|
40
|
+
##
|
41
|
+
# Configure the EventService Client class.
|
42
|
+
#
|
43
|
+
# See {::Google::Cloud::Talent::V4beta1::EventService::Rest::Client::Configuration}
|
44
|
+
# for a description of the configuration fields.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
#
|
48
|
+
# # Modify the configuration for all EventService clients
|
49
|
+
# ::Google::Cloud::Talent::V4beta1::EventService::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.create_client_event.timeout = 30.0
|
70
|
+
|
71
|
+
default_config
|
72
|
+
end
|
73
|
+
yield @configure if block_given?
|
74
|
+
@configure
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Configure the EventService Client instance.
|
79
|
+
#
|
80
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
81
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
82
|
+
# should be made on {Client.configure}.
|
83
|
+
#
|
84
|
+
# See {::Google::Cloud::Talent::V4beta1::EventService::Rest::Client::Configuration}
|
85
|
+
# for a description of the configuration fields.
|
86
|
+
#
|
87
|
+
# @yield [config] Configure the Client client.
|
88
|
+
# @yieldparam config [Client::Configuration]
|
89
|
+
#
|
90
|
+
# @return [Client::Configuration]
|
91
|
+
#
|
92
|
+
def configure
|
93
|
+
yield @config if block_given?
|
94
|
+
@config
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# Create a new EventService REST client object.
|
99
|
+
#
|
100
|
+
# @example
|
101
|
+
#
|
102
|
+
# # Create a client using the default configuration
|
103
|
+
# client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new
|
104
|
+
#
|
105
|
+
# # Create a client using a custom configuration
|
106
|
+
# client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config|
|
107
|
+
# config.timeout = 10.0
|
108
|
+
# end
|
109
|
+
#
|
110
|
+
# @yield [config] Configure the EventService client.
|
111
|
+
# @yieldparam config [Client::Configuration]
|
112
|
+
#
|
113
|
+
def initialize
|
114
|
+
# Create the configuration object
|
115
|
+
@config = Configuration.new Client.configure
|
116
|
+
|
117
|
+
# Yield the configuration if needed
|
118
|
+
yield @config if block_given?
|
119
|
+
|
120
|
+
# Create credentials
|
121
|
+
credentials = @config.credentials
|
122
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
123
|
+
# but only if the default endpoint does not have a region prefix.
|
124
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
125
|
+
!@config.endpoint.split(".").first.include?("-")
|
126
|
+
credentials ||= Credentials.default scope: @config.scope,
|
127
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
128
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
129
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
130
|
+
end
|
131
|
+
|
132
|
+
@quota_project_id = @config.quota_project
|
133
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
134
|
+
|
135
|
+
@event_service_stub = ::Google::Cloud::Talent::V4beta1::EventService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
136
|
+
end
|
137
|
+
|
138
|
+
# Service calls
|
139
|
+
|
140
|
+
##
|
141
|
+
# Report events issued when end user interacts with customer's application
|
142
|
+
# that uses Cloud Talent Solution. You may inspect the created events in
|
143
|
+
# [self service
|
144
|
+
# tools](https://console.cloud.google.com/talent-solution/overview).
|
145
|
+
# [Learn
|
146
|
+
# more](https://cloud.google.com/talent-solution/docs/management-tools)
|
147
|
+
# about self service tools.
|
148
|
+
#
|
149
|
+
# @overload create_client_event(request, options = nil)
|
150
|
+
# Pass arguments to `create_client_event` via a request object, either of type
|
151
|
+
# {::Google::Cloud::Talent::V4beta1::CreateClientEventRequest} or an equivalent Hash.
|
152
|
+
#
|
153
|
+
# @param request [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Hash]
|
154
|
+
# A request object representing the call parameters. Required. To specify no
|
155
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
156
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
157
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
158
|
+
#
|
159
|
+
# @overload create_client_event(parent: nil, client_event: nil)
|
160
|
+
# Pass arguments to `create_client_event` via keyword arguments. Note that at
|
161
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
162
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
163
|
+
#
|
164
|
+
# @param parent [::String]
|
165
|
+
# Required. Resource name of the tenant under which the event is created.
|
166
|
+
#
|
167
|
+
# The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
|
168
|
+
# "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
|
169
|
+
# is created, for example, "projects/foo".
|
170
|
+
# @param client_event [::Google::Cloud::Talent::V4beta1::ClientEvent, ::Hash]
|
171
|
+
# Required. Events issued when end user interacts with customer's application
|
172
|
+
# that uses Cloud Talent Solution.
|
173
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
174
|
+
# @yieldparam result [::Google::Cloud::Talent::V4beta1::ClientEvent]
|
175
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
176
|
+
#
|
177
|
+
# @return [::Google::Cloud::Talent::V4beta1::ClientEvent]
|
178
|
+
#
|
179
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
180
|
+
def create_client_event request, options = nil
|
181
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
182
|
+
|
183
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest
|
184
|
+
|
185
|
+
# Converts hash and nil to an options object
|
186
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
187
|
+
|
188
|
+
# Customize the options with defaults
|
189
|
+
call_metadata = @config.rpcs.create_client_event.metadata.to_h
|
190
|
+
|
191
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
192
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
193
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
194
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
|
195
|
+
transports_version_send: [:rest]
|
196
|
+
|
197
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
198
|
+
|
199
|
+
options.apply_defaults timeout: @config.rpcs.create_client_event.timeout,
|
200
|
+
metadata: call_metadata,
|
201
|
+
retry_policy: @config.rpcs.create_client_event.retry_policy
|
202
|
+
|
203
|
+
options.apply_defaults timeout: @config.timeout,
|
204
|
+
metadata: @config.metadata,
|
205
|
+
retry_policy: @config.retry_policy
|
206
|
+
|
207
|
+
@event_service_stub.create_client_event request, options do |result, operation|
|
208
|
+
yield result, operation if block_given?
|
209
|
+
return result
|
210
|
+
end
|
211
|
+
rescue ::Gapic::Rest::Error => e
|
212
|
+
raise ::Google::Cloud::Error.from_error(e)
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# Configuration class for the EventService REST API.
|
217
|
+
#
|
218
|
+
# This class represents the configuration for EventService REST,
|
219
|
+
# providing control over timeouts, retry behavior, logging, transport
|
220
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
221
|
+
# applied individually to specific RPCs. See
|
222
|
+
# {::Google::Cloud::Talent::V4beta1::EventService::Rest::Client::Configuration::Rpcs}
|
223
|
+
# for a list of RPCs that can be configured independently.
|
224
|
+
#
|
225
|
+
# Configuration can be applied globally to all clients, or to a single client
|
226
|
+
# on construction.
|
227
|
+
#
|
228
|
+
# @example
|
229
|
+
#
|
230
|
+
# # Modify the global config, setting the timeout for
|
231
|
+
# # create_client_event to 20 seconds,
|
232
|
+
# # and all remaining timeouts to 10 seconds.
|
233
|
+
# ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.configure do |config|
|
234
|
+
# config.timeout = 10.0
|
235
|
+
# config.rpcs.create_client_event.timeout = 20.0
|
236
|
+
# end
|
237
|
+
#
|
238
|
+
# # Apply the above configuration only to a new client.
|
239
|
+
# client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config|
|
240
|
+
# config.timeout = 10.0
|
241
|
+
# config.rpcs.create_client_event.timeout = 20.0
|
242
|
+
# end
|
243
|
+
#
|
244
|
+
# @!attribute [rw] endpoint
|
245
|
+
# The hostname or hostname:port of the service endpoint.
|
246
|
+
# Defaults to `"jobs.googleapis.com"`.
|
247
|
+
# @return [::String]
|
248
|
+
# @!attribute [rw] credentials
|
249
|
+
# Credentials to send with calls. You may provide any of the following types:
|
250
|
+
# * (`String`) The path to a service account key file in JSON format
|
251
|
+
# * (`Hash`) A service account key as a Hash
|
252
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
253
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
254
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
255
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
256
|
+
# * (`nil`) indicating no credentials
|
257
|
+
# @return [::Object]
|
258
|
+
# @!attribute [rw] scope
|
259
|
+
# The OAuth scopes
|
260
|
+
# @return [::Array<::String>]
|
261
|
+
# @!attribute [rw] lib_name
|
262
|
+
# The library name as recorded in instrumentation and logging
|
263
|
+
# @return [::String]
|
264
|
+
# @!attribute [rw] lib_version
|
265
|
+
# The library version as recorded in instrumentation and logging
|
266
|
+
# @return [::String]
|
267
|
+
# @!attribute [rw] timeout
|
268
|
+
# The call timeout in seconds.
|
269
|
+
# @return [::Numeric]
|
270
|
+
# @!attribute [rw] metadata
|
271
|
+
# Additional headers to be sent with the call.
|
272
|
+
# @return [::Hash{::Symbol=>::String}]
|
273
|
+
# @!attribute [rw] retry_policy
|
274
|
+
# The retry policy. The value is a hash with the following keys:
|
275
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
276
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
277
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
278
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
279
|
+
# trigger a retry.
|
280
|
+
# @return [::Hash]
|
281
|
+
# @!attribute [rw] quota_project
|
282
|
+
# A separate project against which to charge quota.
|
283
|
+
# @return [::String]
|
284
|
+
#
|
285
|
+
class Configuration
|
286
|
+
extend ::Gapic::Config
|
287
|
+
|
288
|
+
config_attr :endpoint, "jobs.googleapis.com", ::String
|
289
|
+
config_attr :credentials, nil do |value|
|
290
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
291
|
+
allowed.any? { |klass| klass === value }
|
292
|
+
end
|
293
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
294
|
+
config_attr :lib_name, nil, ::String, nil
|
295
|
+
config_attr :lib_version, nil, ::String, nil
|
296
|
+
config_attr :timeout, nil, ::Numeric, nil
|
297
|
+
config_attr :metadata, nil, ::Hash, nil
|
298
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
299
|
+
config_attr :quota_project, nil, ::String, nil
|
300
|
+
|
301
|
+
# @private
|
302
|
+
def initialize parent_config = nil
|
303
|
+
@parent_config = parent_config unless parent_config.nil?
|
304
|
+
|
305
|
+
yield self if block_given?
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# Configurations for individual RPCs
|
310
|
+
# @return [Rpcs]
|
311
|
+
#
|
312
|
+
def rpcs
|
313
|
+
@rpcs ||= begin
|
314
|
+
parent_rpcs = nil
|
315
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
316
|
+
Rpcs.new parent_rpcs
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# Configuration RPC class for the EventService API.
|
322
|
+
#
|
323
|
+
# Includes fields providing the configuration for each RPC in this service.
|
324
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
325
|
+
# the following configuration fields:
|
326
|
+
#
|
327
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
328
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
329
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
330
|
+
# include the following keys:
|
331
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
332
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
333
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
334
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
335
|
+
# trigger a retry.
|
336
|
+
#
|
337
|
+
class Rpcs
|
338
|
+
##
|
339
|
+
# RPC-specific configuration for `create_client_event`
|
340
|
+
# @return [::Gapic::Config::Method]
|
341
|
+
#
|
342
|
+
attr_reader :create_client_event
|
343
|
+
|
344
|
+
# @private
|
345
|
+
def initialize parent_rpcs = nil
|
346
|
+
create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event
|
347
|
+
@create_client_event = ::Gapic::Config::Method.new create_client_event_config
|
348
|
+
|
349
|
+
yield self if block_given?
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
end
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
@@ -0,0 +1,116 @@
|
|
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/event_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Talent
|
24
|
+
module V4beta1
|
25
|
+
module EventService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the EventService 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 create_client_event REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest]
|
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::ClientEvent]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::Talent::V4beta1::ClientEvent]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def create_client_event 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_create_client_event_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::ClientEvent.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 create_client_event REST call
|
85
|
+
#
|
86
|
+
# @param request_pb [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest]
|
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_create_client_event_request request_pb
|
91
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
92
|
+
.with_bindings(
|
93
|
+
uri_method: :post,
|
94
|
+
uri_template: "/v4beta1/{parent}/clientEvents",
|
95
|
+
body: "*",
|
96
|
+
matches: [
|
97
|
+
["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false]
|
98
|
+
]
|
99
|
+
)
|
100
|
+
.with_bindings(
|
101
|
+
uri_method: :post,
|
102
|
+
uri_template: "/v4beta1/{parent}/clientEvents",
|
103
|
+
body: "*",
|
104
|
+
matches: [
|
105
|
+
["parent", %r{^projects/[^/]+/?$}, false]
|
106
|
+
]
|
107
|
+
)
|
108
|
+
transcoder.transcode request_pb
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
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/event_service/credentials"
|
26
|
+
require "google/cloud/talent/v4beta1/event_service/paths"
|
27
|
+
require "google/cloud/talent/v4beta1/event_service/rest/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Talent
|
32
|
+
module V4beta1
|
33
|
+
##
|
34
|
+
# A service handles client event report.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a REST client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/talent/v4beta1/event_service/rest"
|
39
|
+
# client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new
|
40
|
+
#
|
41
|
+
module EventService
|
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/event_service/rest/helpers" if ::File.file? helper_path
|
@@ -25,6 +25,7 @@ require "google/cloud/talent/v4beta1/version"
|
|
25
25
|
require "google/cloud/talent/v4beta1/event_service/credentials"
|
26
26
|
require "google/cloud/talent/v4beta1/event_service/paths"
|
27
27
|
require "google/cloud/talent/v4beta1/event_service/client"
|
28
|
+
require "google/cloud/talent/v4beta1/event_service/rest"
|
28
29
|
|
29
30
|
module Google
|
30
31
|
module Cloud
|
@@ -33,11 +34,16 @@ module Google
|
|
33
34
|
##
|
34
35
|
# A service handles client event report.
|
35
36
|
#
|
36
|
-
#
|
37
|
+
# @example Load this service and instantiate a gRPC client
|
37
38
|
#
|
38
39
|
# require "google/cloud/talent/v4beta1/event_service"
|
39
40
|
# client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new
|
40
41
|
#
|
42
|
+
# @example Load this service and instantiate a REST client
|
43
|
+
#
|
44
|
+
# require "google/cloud/talent/v4beta1/event_service/rest"
|
45
|
+
# client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new
|
46
|
+
#
|
41
47
|
module EventService
|
42
48
|
end
|
43
49
|
end
|