google-area120-tables-v1alpha1 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +1 -1
- data/lib/google/area120/tables/v1alpha1/rest.rb +37 -0
- data/lib/google/area120/tables/v1alpha1/tables_service/client.rb +12 -18
- data/lib/google/area120/tables/v1alpha1/tables_service/rest/client.rb +1220 -0
- data/lib/google/area120/tables/v1alpha1/tables_service/rest/service_stub.rb +757 -0
- data/lib/google/area120/tables/v1alpha1/tables_service/rest.rb +63 -0
- data/lib/google/area120/tables/v1alpha1/tables_service.rb +7 -1
- data/lib/google/area120/tables/v1alpha1/version.rb +1 -1
- data/lib/google/area120/tables/v1alpha1.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/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- metadata +14 -7
@@ -0,0 +1,1220 @@
|
|
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/area120/tables/v1alpha1/tables_pb"
|
21
|
+
require "google/area120/tables/v1alpha1/tables_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Area120
|
25
|
+
module Tables
|
26
|
+
module V1alpha1
|
27
|
+
module TablesService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the TablesService service.
|
31
|
+
#
|
32
|
+
# The Tables Service provides an API for reading and updating tables.
|
33
|
+
# It defines the following resource model:
|
34
|
+
#
|
35
|
+
# - The API has a collection of {::Google::Area120::Tables::V1alpha1::Table Table}
|
36
|
+
# resources, named `tables/*`
|
37
|
+
#
|
38
|
+
# - Each Table has a collection of {::Google::Area120::Tables::V1alpha1::Row Row}
|
39
|
+
# resources, named `tables/*/rows/*`
|
40
|
+
#
|
41
|
+
# - The API has a collection of
|
42
|
+
# {::Google::Area120::Tables::V1alpha1::Workspace Workspace}
|
43
|
+
# resources, named `workspaces/*`.
|
44
|
+
#
|
45
|
+
class Client
|
46
|
+
include Paths
|
47
|
+
|
48
|
+
# @private
|
49
|
+
attr_reader :tables_service_stub
|
50
|
+
|
51
|
+
##
|
52
|
+
# Configure the TablesService Client class.
|
53
|
+
#
|
54
|
+
# See {::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client::Configuration}
|
55
|
+
# for a description of the configuration fields.
|
56
|
+
#
|
57
|
+
# @example
|
58
|
+
#
|
59
|
+
# # Modify the configuration for all TablesService clients
|
60
|
+
# ::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client.configure do |config|
|
61
|
+
# config.timeout = 10.0
|
62
|
+
# end
|
63
|
+
#
|
64
|
+
# @yield [config] Configure the Client client.
|
65
|
+
# @yieldparam config [Client::Configuration]
|
66
|
+
#
|
67
|
+
# @return [Client::Configuration]
|
68
|
+
#
|
69
|
+
def self.configure
|
70
|
+
@configure ||= begin
|
71
|
+
namespace = ["Google", "Area120", "Tables", "V1alpha1"]
|
72
|
+
parent_config = while namespace.any?
|
73
|
+
parent_name = namespace.join "::"
|
74
|
+
parent_const = const_get parent_name
|
75
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
76
|
+
namespace.pop
|
77
|
+
end
|
78
|
+
default_config = Client::Configuration.new parent_config
|
79
|
+
|
80
|
+
default_config.timeout = 60.0
|
81
|
+
default_config.retry_policy = {
|
82
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
83
|
+
}
|
84
|
+
|
85
|
+
default_config.rpcs.get_table.timeout = 60.0
|
86
|
+
|
87
|
+
default_config.rpcs.list_tables.timeout = 60.0
|
88
|
+
|
89
|
+
default_config.rpcs.get_workspace.timeout = 60.0
|
90
|
+
|
91
|
+
default_config.rpcs.list_workspaces.timeout = 60.0
|
92
|
+
|
93
|
+
default_config.rpcs.get_row.timeout = 60.0
|
94
|
+
|
95
|
+
default_config.rpcs.list_rows.timeout = 60.0
|
96
|
+
|
97
|
+
default_config.rpcs.create_row.timeout = 60.0
|
98
|
+
|
99
|
+
default_config.rpcs.batch_create_rows.timeout = 60.0
|
100
|
+
|
101
|
+
default_config.rpcs.update_row.timeout = 60.0
|
102
|
+
|
103
|
+
default_config.rpcs.batch_update_rows.timeout = 60.0
|
104
|
+
|
105
|
+
default_config.rpcs.delete_row.timeout = 60.0
|
106
|
+
|
107
|
+
default_config.rpcs.batch_delete_rows.timeout = 60.0
|
108
|
+
|
109
|
+
default_config
|
110
|
+
end
|
111
|
+
yield @configure if block_given?
|
112
|
+
@configure
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# Configure the TablesService Client instance.
|
117
|
+
#
|
118
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
119
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
120
|
+
# should be made on {Client.configure}.
|
121
|
+
#
|
122
|
+
# See {::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client::Configuration}
|
123
|
+
# for a description of the configuration fields.
|
124
|
+
#
|
125
|
+
# @yield [config] Configure the Client client.
|
126
|
+
# @yieldparam config [Client::Configuration]
|
127
|
+
#
|
128
|
+
# @return [Client::Configuration]
|
129
|
+
#
|
130
|
+
def configure
|
131
|
+
yield @config if block_given?
|
132
|
+
@config
|
133
|
+
end
|
134
|
+
|
135
|
+
##
|
136
|
+
# Create a new TablesService REST client object.
|
137
|
+
#
|
138
|
+
# @example
|
139
|
+
#
|
140
|
+
# # Create a client using the default configuration
|
141
|
+
# client = ::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client.new
|
142
|
+
#
|
143
|
+
# # Create a client using a custom configuration
|
144
|
+
# client = ::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client.new do |config|
|
145
|
+
# config.timeout = 10.0
|
146
|
+
# end
|
147
|
+
#
|
148
|
+
# @yield [config] Configure the TablesService client.
|
149
|
+
# @yieldparam config [Client::Configuration]
|
150
|
+
#
|
151
|
+
def initialize
|
152
|
+
# Create the configuration object
|
153
|
+
@config = Configuration.new Client.configure
|
154
|
+
|
155
|
+
# Yield the configuration if needed
|
156
|
+
yield @config if block_given?
|
157
|
+
|
158
|
+
# Create credentials
|
159
|
+
credentials = @config.credentials
|
160
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
161
|
+
# but only if the default endpoint does not have a region prefix.
|
162
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
163
|
+
!@config.endpoint.split(".").first.include?("-")
|
164
|
+
credentials ||= Credentials.default scope: @config.scope,
|
165
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
166
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
167
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
168
|
+
end
|
169
|
+
|
170
|
+
@quota_project_id = @config.quota_project
|
171
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
172
|
+
|
173
|
+
@tables_service_stub = ::Google::Area120::Tables::V1alpha1::TablesService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
174
|
+
end
|
175
|
+
|
176
|
+
# Service calls
|
177
|
+
|
178
|
+
##
|
179
|
+
# Gets a table. Returns NOT_FOUND if the table does not exist.
|
180
|
+
#
|
181
|
+
# @overload get_table(request, options = nil)
|
182
|
+
# Pass arguments to `get_table` via a request object, either of type
|
183
|
+
# {::Google::Area120::Tables::V1alpha1::GetTableRequest} or an equivalent Hash.
|
184
|
+
#
|
185
|
+
# @param request [::Google::Area120::Tables::V1alpha1::GetTableRequest, ::Hash]
|
186
|
+
# A request object representing the call parameters. Required. To specify no
|
187
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
188
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
189
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
190
|
+
#
|
191
|
+
# @overload get_table(name: nil)
|
192
|
+
# Pass arguments to `get_table` via keyword arguments. Note that at
|
193
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
194
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
195
|
+
#
|
196
|
+
# @param name [::String]
|
197
|
+
# Required. The name of the table to retrieve.
|
198
|
+
# Format: tables/\\{table}
|
199
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
200
|
+
# @yieldparam result [::Google::Area120::Tables::V1alpha1::Table]
|
201
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
202
|
+
#
|
203
|
+
# @return [::Google::Area120::Tables::V1alpha1::Table]
|
204
|
+
#
|
205
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
206
|
+
def get_table request, options = nil
|
207
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
208
|
+
|
209
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::GetTableRequest
|
210
|
+
|
211
|
+
# Converts hash and nil to an options object
|
212
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
213
|
+
|
214
|
+
# Customize the options with defaults
|
215
|
+
call_metadata = @config.rpcs.get_table.metadata.to_h
|
216
|
+
|
217
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
218
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
219
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
220
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
221
|
+
transports_version_send: [:rest]
|
222
|
+
|
223
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
224
|
+
|
225
|
+
options.apply_defaults timeout: @config.rpcs.get_table.timeout,
|
226
|
+
metadata: call_metadata,
|
227
|
+
retry_policy: @config.rpcs.get_table.retry_policy
|
228
|
+
|
229
|
+
options.apply_defaults timeout: @config.timeout,
|
230
|
+
metadata: @config.metadata,
|
231
|
+
retry_policy: @config.retry_policy
|
232
|
+
|
233
|
+
@tables_service_stub.get_table request, options do |result, operation|
|
234
|
+
yield result, operation if block_given?
|
235
|
+
return result
|
236
|
+
end
|
237
|
+
rescue ::Gapic::Rest::Error => e
|
238
|
+
raise ::Google::Cloud::Error.from_error(e)
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# Lists tables for the user.
|
243
|
+
#
|
244
|
+
# @overload list_tables(request, options = nil)
|
245
|
+
# Pass arguments to `list_tables` via a request object, either of type
|
246
|
+
# {::Google::Area120::Tables::V1alpha1::ListTablesRequest} or an equivalent Hash.
|
247
|
+
#
|
248
|
+
# @param request [::Google::Area120::Tables::V1alpha1::ListTablesRequest, ::Hash]
|
249
|
+
# A request object representing the call parameters. Required. To specify no
|
250
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
251
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
252
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
253
|
+
#
|
254
|
+
# @overload list_tables(page_size: nil, page_token: nil)
|
255
|
+
# Pass arguments to `list_tables` via keyword arguments. Note that at
|
256
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
257
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
258
|
+
#
|
259
|
+
# @param page_size [::Integer]
|
260
|
+
# The maximum number of tables to return. The service may return fewer than
|
261
|
+
# this value.
|
262
|
+
#
|
263
|
+
# If unspecified, at most 20 tables are returned. The maximum value is 100;
|
264
|
+
# values above 100 are coerced to 100.
|
265
|
+
# @param page_token [::String]
|
266
|
+
# A page token, received from a previous `ListTables` call.
|
267
|
+
# Provide this to retrieve the subsequent page.
|
268
|
+
#
|
269
|
+
# When paginating, all other parameters provided to `ListTables` must match
|
270
|
+
# the call that provided the page token.
|
271
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
272
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Table>]
|
273
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
274
|
+
#
|
275
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Table>]
|
276
|
+
#
|
277
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
278
|
+
def list_tables request, options = nil
|
279
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
280
|
+
|
281
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::ListTablesRequest
|
282
|
+
|
283
|
+
# Converts hash and nil to an options object
|
284
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
285
|
+
|
286
|
+
# Customize the options with defaults
|
287
|
+
call_metadata = @config.rpcs.list_tables.metadata.to_h
|
288
|
+
|
289
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
290
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
291
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
292
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
293
|
+
transports_version_send: [:rest]
|
294
|
+
|
295
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
296
|
+
|
297
|
+
options.apply_defaults timeout: @config.rpcs.list_tables.timeout,
|
298
|
+
metadata: call_metadata,
|
299
|
+
retry_policy: @config.rpcs.list_tables.retry_policy
|
300
|
+
|
301
|
+
options.apply_defaults timeout: @config.timeout,
|
302
|
+
metadata: @config.metadata,
|
303
|
+
retry_policy: @config.retry_policy
|
304
|
+
|
305
|
+
@tables_service_stub.list_tables request, options do |result, operation|
|
306
|
+
result = ::Gapic::Rest::PagedEnumerable.new @tables_service_stub, :list_tables, "tables", request, result, options
|
307
|
+
yield result, operation if block_given?
|
308
|
+
return result
|
309
|
+
end
|
310
|
+
rescue ::Gapic::Rest::Error => e
|
311
|
+
raise ::Google::Cloud::Error.from_error(e)
|
312
|
+
end
|
313
|
+
|
314
|
+
##
|
315
|
+
# Gets a workspace. Returns NOT_FOUND if the workspace does not exist.
|
316
|
+
#
|
317
|
+
# @overload get_workspace(request, options = nil)
|
318
|
+
# Pass arguments to `get_workspace` via a request object, either of type
|
319
|
+
# {::Google::Area120::Tables::V1alpha1::GetWorkspaceRequest} or an equivalent Hash.
|
320
|
+
#
|
321
|
+
# @param request [::Google::Area120::Tables::V1alpha1::GetWorkspaceRequest, ::Hash]
|
322
|
+
# A request object representing the call parameters. Required. To specify no
|
323
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
324
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
325
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
326
|
+
#
|
327
|
+
# @overload get_workspace(name: nil)
|
328
|
+
# Pass arguments to `get_workspace` via keyword arguments. Note that at
|
329
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
330
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
331
|
+
#
|
332
|
+
# @param name [::String]
|
333
|
+
# Required. The name of the workspace to retrieve.
|
334
|
+
# Format: workspaces/\\{workspace}
|
335
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
336
|
+
# @yieldparam result [::Google::Area120::Tables::V1alpha1::Workspace]
|
337
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
338
|
+
#
|
339
|
+
# @return [::Google::Area120::Tables::V1alpha1::Workspace]
|
340
|
+
#
|
341
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
342
|
+
def get_workspace request, options = nil
|
343
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
344
|
+
|
345
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::GetWorkspaceRequest
|
346
|
+
|
347
|
+
# Converts hash and nil to an options object
|
348
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
349
|
+
|
350
|
+
# Customize the options with defaults
|
351
|
+
call_metadata = @config.rpcs.get_workspace.metadata.to_h
|
352
|
+
|
353
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
354
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
355
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
356
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
357
|
+
transports_version_send: [:rest]
|
358
|
+
|
359
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
360
|
+
|
361
|
+
options.apply_defaults timeout: @config.rpcs.get_workspace.timeout,
|
362
|
+
metadata: call_metadata,
|
363
|
+
retry_policy: @config.rpcs.get_workspace.retry_policy
|
364
|
+
|
365
|
+
options.apply_defaults timeout: @config.timeout,
|
366
|
+
metadata: @config.metadata,
|
367
|
+
retry_policy: @config.retry_policy
|
368
|
+
|
369
|
+
@tables_service_stub.get_workspace request, options do |result, operation|
|
370
|
+
yield result, operation if block_given?
|
371
|
+
return result
|
372
|
+
end
|
373
|
+
rescue ::Gapic::Rest::Error => e
|
374
|
+
raise ::Google::Cloud::Error.from_error(e)
|
375
|
+
end
|
376
|
+
|
377
|
+
##
|
378
|
+
# Lists workspaces for the user.
|
379
|
+
#
|
380
|
+
# @overload list_workspaces(request, options = nil)
|
381
|
+
# Pass arguments to `list_workspaces` via a request object, either of type
|
382
|
+
# {::Google::Area120::Tables::V1alpha1::ListWorkspacesRequest} or an equivalent Hash.
|
383
|
+
#
|
384
|
+
# @param request [::Google::Area120::Tables::V1alpha1::ListWorkspacesRequest, ::Hash]
|
385
|
+
# A request object representing the call parameters. Required. To specify no
|
386
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
387
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
388
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
389
|
+
#
|
390
|
+
# @overload list_workspaces(page_size: nil, page_token: nil)
|
391
|
+
# Pass arguments to `list_workspaces` via keyword arguments. Note that at
|
392
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
393
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
394
|
+
#
|
395
|
+
# @param page_size [::Integer]
|
396
|
+
# The maximum number of workspaces to return. The service may return fewer
|
397
|
+
# than this value.
|
398
|
+
#
|
399
|
+
# If unspecified, at most 10 workspaces are returned. The maximum value is
|
400
|
+
# 25; values above 25 are coerced to 25.
|
401
|
+
# @param page_token [::String]
|
402
|
+
# A page token, received from a previous `ListWorkspaces` call.
|
403
|
+
# Provide this to retrieve the subsequent page.
|
404
|
+
#
|
405
|
+
# When paginating, all other parameters provided to `ListWorkspaces` must
|
406
|
+
# match the call that provided the page token.
|
407
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
408
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Workspace>]
|
409
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
410
|
+
#
|
411
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Workspace>]
|
412
|
+
#
|
413
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
414
|
+
def list_workspaces request, options = nil
|
415
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
416
|
+
|
417
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::ListWorkspacesRequest
|
418
|
+
|
419
|
+
# Converts hash and nil to an options object
|
420
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
421
|
+
|
422
|
+
# Customize the options with defaults
|
423
|
+
call_metadata = @config.rpcs.list_workspaces.metadata.to_h
|
424
|
+
|
425
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
426
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
427
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
428
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
429
|
+
transports_version_send: [:rest]
|
430
|
+
|
431
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
432
|
+
|
433
|
+
options.apply_defaults timeout: @config.rpcs.list_workspaces.timeout,
|
434
|
+
metadata: call_metadata,
|
435
|
+
retry_policy: @config.rpcs.list_workspaces.retry_policy
|
436
|
+
|
437
|
+
options.apply_defaults timeout: @config.timeout,
|
438
|
+
metadata: @config.metadata,
|
439
|
+
retry_policy: @config.retry_policy
|
440
|
+
|
441
|
+
@tables_service_stub.list_workspaces request, options do |result, operation|
|
442
|
+
result = ::Gapic::Rest::PagedEnumerable.new @tables_service_stub, :list_workspaces, "workspaces", request, result, options
|
443
|
+
yield result, operation if block_given?
|
444
|
+
return result
|
445
|
+
end
|
446
|
+
rescue ::Gapic::Rest::Error => e
|
447
|
+
raise ::Google::Cloud::Error.from_error(e)
|
448
|
+
end
|
449
|
+
|
450
|
+
##
|
451
|
+
# Gets a row. Returns NOT_FOUND if the row does not exist in the table.
|
452
|
+
#
|
453
|
+
# @overload get_row(request, options = nil)
|
454
|
+
# Pass arguments to `get_row` via a request object, either of type
|
455
|
+
# {::Google::Area120::Tables::V1alpha1::GetRowRequest} or an equivalent Hash.
|
456
|
+
#
|
457
|
+
# @param request [::Google::Area120::Tables::V1alpha1::GetRowRequest, ::Hash]
|
458
|
+
# A request object representing the call parameters. Required. To specify no
|
459
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
460
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
461
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
462
|
+
#
|
463
|
+
# @overload get_row(name: nil, view: nil)
|
464
|
+
# Pass arguments to `get_row` via keyword arguments. Note that at
|
465
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
466
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
467
|
+
#
|
468
|
+
# @param name [::String]
|
469
|
+
# Required. The name of the row to retrieve.
|
470
|
+
# Format: tables/\\{table}/rows/\\{row}
|
471
|
+
# @param view [::Google::Area120::Tables::V1alpha1::View]
|
472
|
+
# Optional. Column key to use for values in the row.
|
473
|
+
# Defaults to user entered name.
|
474
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
475
|
+
# @yieldparam result [::Google::Area120::Tables::V1alpha1::Row]
|
476
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
477
|
+
#
|
478
|
+
# @return [::Google::Area120::Tables::V1alpha1::Row]
|
479
|
+
#
|
480
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
481
|
+
def get_row request, options = nil
|
482
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
483
|
+
|
484
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::GetRowRequest
|
485
|
+
|
486
|
+
# Converts hash and nil to an options object
|
487
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
488
|
+
|
489
|
+
# Customize the options with defaults
|
490
|
+
call_metadata = @config.rpcs.get_row.metadata.to_h
|
491
|
+
|
492
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
493
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
494
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
495
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
496
|
+
transports_version_send: [:rest]
|
497
|
+
|
498
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
499
|
+
|
500
|
+
options.apply_defaults timeout: @config.rpcs.get_row.timeout,
|
501
|
+
metadata: call_metadata,
|
502
|
+
retry_policy: @config.rpcs.get_row.retry_policy
|
503
|
+
|
504
|
+
options.apply_defaults timeout: @config.timeout,
|
505
|
+
metadata: @config.metadata,
|
506
|
+
retry_policy: @config.retry_policy
|
507
|
+
|
508
|
+
@tables_service_stub.get_row request, options do |result, operation|
|
509
|
+
yield result, operation if block_given?
|
510
|
+
return result
|
511
|
+
end
|
512
|
+
rescue ::Gapic::Rest::Error => e
|
513
|
+
raise ::Google::Cloud::Error.from_error(e)
|
514
|
+
end
|
515
|
+
|
516
|
+
##
|
517
|
+
# Lists rows in a table. Returns NOT_FOUND if the table does not exist.
|
518
|
+
#
|
519
|
+
# @overload list_rows(request, options = nil)
|
520
|
+
# Pass arguments to `list_rows` via a request object, either of type
|
521
|
+
# {::Google::Area120::Tables::V1alpha1::ListRowsRequest} or an equivalent Hash.
|
522
|
+
#
|
523
|
+
# @param request [::Google::Area120::Tables::V1alpha1::ListRowsRequest, ::Hash]
|
524
|
+
# A request object representing the call parameters. Required. To specify no
|
525
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
526
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
527
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
528
|
+
#
|
529
|
+
# @overload list_rows(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil)
|
530
|
+
# Pass arguments to `list_rows` via keyword arguments. Note that at
|
531
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
532
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
533
|
+
#
|
534
|
+
# @param parent [::String]
|
535
|
+
# Required. The parent table.
|
536
|
+
# Format: tables/\\{table}
|
537
|
+
# @param page_size [::Integer]
|
538
|
+
# The maximum number of rows to return. The service may return fewer than
|
539
|
+
# this value.
|
540
|
+
#
|
541
|
+
# If unspecified, at most 50 rows are returned. The maximum value is 1,000;
|
542
|
+
# values above 1,000 are coerced to 1,000.
|
543
|
+
# @param page_token [::String]
|
544
|
+
# A page token, received from a previous `ListRows` call.
|
545
|
+
# Provide this to retrieve the subsequent page.
|
546
|
+
#
|
547
|
+
# When paginating, all other parameters provided to `ListRows` must match
|
548
|
+
# the call that provided the page token.
|
549
|
+
# @param view [::Google::Area120::Tables::V1alpha1::View]
|
550
|
+
# Optional. Column key to use for values in the row.
|
551
|
+
# Defaults to user entered name.
|
552
|
+
# @param filter [::String]
|
553
|
+
# Optional. Raw text query to search for in rows of the table.
|
554
|
+
# Special characters must be escaped. Logical operators and field specific
|
555
|
+
# filtering not supported.
|
556
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
557
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Row>]
|
558
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
559
|
+
#
|
560
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Area120::Tables::V1alpha1::Row>]
|
561
|
+
#
|
562
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
563
|
+
def list_rows request, options = nil
|
564
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
565
|
+
|
566
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::ListRowsRequest
|
567
|
+
|
568
|
+
# Converts hash and nil to an options object
|
569
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
570
|
+
|
571
|
+
# Customize the options with defaults
|
572
|
+
call_metadata = @config.rpcs.list_rows.metadata.to_h
|
573
|
+
|
574
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
575
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
576
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
577
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
578
|
+
transports_version_send: [:rest]
|
579
|
+
|
580
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
581
|
+
|
582
|
+
options.apply_defaults timeout: @config.rpcs.list_rows.timeout,
|
583
|
+
metadata: call_metadata,
|
584
|
+
retry_policy: @config.rpcs.list_rows.retry_policy
|
585
|
+
|
586
|
+
options.apply_defaults timeout: @config.timeout,
|
587
|
+
metadata: @config.metadata,
|
588
|
+
retry_policy: @config.retry_policy
|
589
|
+
|
590
|
+
@tables_service_stub.list_rows request, options do |result, operation|
|
591
|
+
result = ::Gapic::Rest::PagedEnumerable.new @tables_service_stub, :list_rows, "rows", request, result, options
|
592
|
+
yield result, operation if block_given?
|
593
|
+
return result
|
594
|
+
end
|
595
|
+
rescue ::Gapic::Rest::Error => e
|
596
|
+
raise ::Google::Cloud::Error.from_error(e)
|
597
|
+
end
|
598
|
+
|
599
|
+
##
|
600
|
+
# Creates a row.
|
601
|
+
#
|
602
|
+
# @overload create_row(request, options = nil)
|
603
|
+
# Pass arguments to `create_row` via a request object, either of type
|
604
|
+
# {::Google::Area120::Tables::V1alpha1::CreateRowRequest} or an equivalent Hash.
|
605
|
+
#
|
606
|
+
# @param request [::Google::Area120::Tables::V1alpha1::CreateRowRequest, ::Hash]
|
607
|
+
# A request object representing the call parameters. Required. To specify no
|
608
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
609
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
610
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
611
|
+
#
|
612
|
+
# @overload create_row(parent: nil, row: nil, view: nil)
|
613
|
+
# Pass arguments to `create_row` via keyword arguments. Note that at
|
614
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
615
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
616
|
+
#
|
617
|
+
# @param parent [::String]
|
618
|
+
# Required. The parent table where this row will be created.
|
619
|
+
# Format: tables/\\{table}
|
620
|
+
# @param row [::Google::Area120::Tables::V1alpha1::Row, ::Hash]
|
621
|
+
# Required. The row to create.
|
622
|
+
# @param view [::Google::Area120::Tables::V1alpha1::View]
|
623
|
+
# Optional. Column key to use for values in the row.
|
624
|
+
# Defaults to user entered name.
|
625
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
626
|
+
# @yieldparam result [::Google::Area120::Tables::V1alpha1::Row]
|
627
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
628
|
+
#
|
629
|
+
# @return [::Google::Area120::Tables::V1alpha1::Row]
|
630
|
+
#
|
631
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
632
|
+
def create_row request, options = nil
|
633
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
634
|
+
|
635
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::CreateRowRequest
|
636
|
+
|
637
|
+
# Converts hash and nil to an options object
|
638
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
639
|
+
|
640
|
+
# Customize the options with defaults
|
641
|
+
call_metadata = @config.rpcs.create_row.metadata.to_h
|
642
|
+
|
643
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
644
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
645
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
646
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
647
|
+
transports_version_send: [:rest]
|
648
|
+
|
649
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
650
|
+
|
651
|
+
options.apply_defaults timeout: @config.rpcs.create_row.timeout,
|
652
|
+
metadata: call_metadata,
|
653
|
+
retry_policy: @config.rpcs.create_row.retry_policy
|
654
|
+
|
655
|
+
options.apply_defaults timeout: @config.timeout,
|
656
|
+
metadata: @config.metadata,
|
657
|
+
retry_policy: @config.retry_policy
|
658
|
+
|
659
|
+
@tables_service_stub.create_row request, options do |result, operation|
|
660
|
+
yield result, operation if block_given?
|
661
|
+
return result
|
662
|
+
end
|
663
|
+
rescue ::Gapic::Rest::Error => e
|
664
|
+
raise ::Google::Cloud::Error.from_error(e)
|
665
|
+
end
|
666
|
+
|
667
|
+
##
|
668
|
+
# Creates multiple rows.
|
669
|
+
#
|
670
|
+
# @overload batch_create_rows(request, options = nil)
|
671
|
+
# Pass arguments to `batch_create_rows` via a request object, either of type
|
672
|
+
# {::Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest} or an equivalent Hash.
|
673
|
+
#
|
674
|
+
# @param request [::Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest, ::Hash]
|
675
|
+
# A request object representing the call parameters. Required. To specify no
|
676
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
677
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
678
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
679
|
+
#
|
680
|
+
# @overload batch_create_rows(parent: nil, requests: nil)
|
681
|
+
# Pass arguments to `batch_create_rows` via keyword arguments. Note that at
|
682
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
683
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
684
|
+
#
|
685
|
+
# @param parent [::String]
|
686
|
+
# Required. The parent table where the rows will be created.
|
687
|
+
# Format: tables/\\{table}
|
688
|
+
# @param requests [::Array<::Google::Area120::Tables::V1alpha1::CreateRowRequest, ::Hash>]
|
689
|
+
# Required. The request message specifying the rows to create.
|
690
|
+
#
|
691
|
+
# A maximum of 500 rows can be created in a single batch.
|
692
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
693
|
+
# @yieldparam result [::Google::Area120::Tables::V1alpha1::BatchCreateRowsResponse]
|
694
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
695
|
+
#
|
696
|
+
# @return [::Google::Area120::Tables::V1alpha1::BatchCreateRowsResponse]
|
697
|
+
#
|
698
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
699
|
+
def batch_create_rows request, options = nil
|
700
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
701
|
+
|
702
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest
|
703
|
+
|
704
|
+
# Converts hash and nil to an options object
|
705
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
706
|
+
|
707
|
+
# Customize the options with defaults
|
708
|
+
call_metadata = @config.rpcs.batch_create_rows.metadata.to_h
|
709
|
+
|
710
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
711
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
712
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
713
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
714
|
+
transports_version_send: [:rest]
|
715
|
+
|
716
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
717
|
+
|
718
|
+
options.apply_defaults timeout: @config.rpcs.batch_create_rows.timeout,
|
719
|
+
metadata: call_metadata,
|
720
|
+
retry_policy: @config.rpcs.batch_create_rows.retry_policy
|
721
|
+
|
722
|
+
options.apply_defaults timeout: @config.timeout,
|
723
|
+
metadata: @config.metadata,
|
724
|
+
retry_policy: @config.retry_policy
|
725
|
+
|
726
|
+
@tables_service_stub.batch_create_rows request, options do |result, operation|
|
727
|
+
yield result, operation if block_given?
|
728
|
+
return result
|
729
|
+
end
|
730
|
+
rescue ::Gapic::Rest::Error => e
|
731
|
+
raise ::Google::Cloud::Error.from_error(e)
|
732
|
+
end
|
733
|
+
|
734
|
+
##
|
735
|
+
# Updates a row.
|
736
|
+
#
|
737
|
+
# @overload update_row(request, options = nil)
|
738
|
+
# Pass arguments to `update_row` via a request object, either of type
|
739
|
+
# {::Google::Area120::Tables::V1alpha1::UpdateRowRequest} or an equivalent Hash.
|
740
|
+
#
|
741
|
+
# @param request [::Google::Area120::Tables::V1alpha1::UpdateRowRequest, ::Hash]
|
742
|
+
# A request object representing the call parameters. Required. To specify no
|
743
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
744
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
745
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
746
|
+
#
|
747
|
+
# @overload update_row(row: nil, update_mask: nil, view: nil)
|
748
|
+
# Pass arguments to `update_row` via keyword arguments. Note that at
|
749
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
750
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
751
|
+
#
|
752
|
+
# @param row [::Google::Area120::Tables::V1alpha1::Row, ::Hash]
|
753
|
+
# Required. The row to update.
|
754
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
755
|
+
# The list of fields to update.
|
756
|
+
# @param view [::Google::Area120::Tables::V1alpha1::View]
|
757
|
+
# Optional. Column key to use for values in the row.
|
758
|
+
# Defaults to user entered name.
|
759
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
760
|
+
# @yieldparam result [::Google::Area120::Tables::V1alpha1::Row]
|
761
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
762
|
+
#
|
763
|
+
# @return [::Google::Area120::Tables::V1alpha1::Row]
|
764
|
+
#
|
765
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
766
|
+
def update_row request, options = nil
|
767
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
768
|
+
|
769
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::UpdateRowRequest
|
770
|
+
|
771
|
+
# Converts hash and nil to an options object
|
772
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
773
|
+
|
774
|
+
# Customize the options with defaults
|
775
|
+
call_metadata = @config.rpcs.update_row.metadata.to_h
|
776
|
+
|
777
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
778
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
779
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
780
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
781
|
+
transports_version_send: [:rest]
|
782
|
+
|
783
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
784
|
+
|
785
|
+
options.apply_defaults timeout: @config.rpcs.update_row.timeout,
|
786
|
+
metadata: call_metadata,
|
787
|
+
retry_policy: @config.rpcs.update_row.retry_policy
|
788
|
+
|
789
|
+
options.apply_defaults timeout: @config.timeout,
|
790
|
+
metadata: @config.metadata,
|
791
|
+
retry_policy: @config.retry_policy
|
792
|
+
|
793
|
+
@tables_service_stub.update_row request, options do |result, operation|
|
794
|
+
yield result, operation if block_given?
|
795
|
+
return result
|
796
|
+
end
|
797
|
+
rescue ::Gapic::Rest::Error => e
|
798
|
+
raise ::Google::Cloud::Error.from_error(e)
|
799
|
+
end
|
800
|
+
|
801
|
+
##
|
802
|
+
# Updates multiple rows.
|
803
|
+
#
|
804
|
+
# @overload batch_update_rows(request, options = nil)
|
805
|
+
# Pass arguments to `batch_update_rows` via a request object, either of type
|
806
|
+
# {::Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest} or an equivalent Hash.
|
807
|
+
#
|
808
|
+
# @param request [::Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest, ::Hash]
|
809
|
+
# A request object representing the call parameters. Required. To specify no
|
810
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
811
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
812
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
813
|
+
#
|
814
|
+
# @overload batch_update_rows(parent: nil, requests: nil)
|
815
|
+
# Pass arguments to `batch_update_rows` via keyword arguments. Note that at
|
816
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
817
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
818
|
+
#
|
819
|
+
# @param parent [::String]
|
820
|
+
# Required. The parent table shared by all rows being updated.
|
821
|
+
# Format: tables/\\{table}
|
822
|
+
# @param requests [::Array<::Google::Area120::Tables::V1alpha1::UpdateRowRequest, ::Hash>]
|
823
|
+
# Required. The request messages specifying the rows to update.
|
824
|
+
#
|
825
|
+
# A maximum of 500 rows can be modified in a single batch.
|
826
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
827
|
+
# @yieldparam result [::Google::Area120::Tables::V1alpha1::BatchUpdateRowsResponse]
|
828
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
829
|
+
#
|
830
|
+
# @return [::Google::Area120::Tables::V1alpha1::BatchUpdateRowsResponse]
|
831
|
+
#
|
832
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
833
|
+
def batch_update_rows request, options = nil
|
834
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
835
|
+
|
836
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest
|
837
|
+
|
838
|
+
# Converts hash and nil to an options object
|
839
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
840
|
+
|
841
|
+
# Customize the options with defaults
|
842
|
+
call_metadata = @config.rpcs.batch_update_rows.metadata.to_h
|
843
|
+
|
844
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
845
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
846
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
847
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
848
|
+
transports_version_send: [:rest]
|
849
|
+
|
850
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
851
|
+
|
852
|
+
options.apply_defaults timeout: @config.rpcs.batch_update_rows.timeout,
|
853
|
+
metadata: call_metadata,
|
854
|
+
retry_policy: @config.rpcs.batch_update_rows.retry_policy
|
855
|
+
|
856
|
+
options.apply_defaults timeout: @config.timeout,
|
857
|
+
metadata: @config.metadata,
|
858
|
+
retry_policy: @config.retry_policy
|
859
|
+
|
860
|
+
@tables_service_stub.batch_update_rows request, options do |result, operation|
|
861
|
+
yield result, operation if block_given?
|
862
|
+
return result
|
863
|
+
end
|
864
|
+
rescue ::Gapic::Rest::Error => e
|
865
|
+
raise ::Google::Cloud::Error.from_error(e)
|
866
|
+
end
|
867
|
+
|
868
|
+
##
|
869
|
+
# Deletes a row.
|
870
|
+
#
|
871
|
+
# @overload delete_row(request, options = nil)
|
872
|
+
# Pass arguments to `delete_row` via a request object, either of type
|
873
|
+
# {::Google::Area120::Tables::V1alpha1::DeleteRowRequest} or an equivalent Hash.
|
874
|
+
#
|
875
|
+
# @param request [::Google::Area120::Tables::V1alpha1::DeleteRowRequest, ::Hash]
|
876
|
+
# A request object representing the call parameters. Required. To specify no
|
877
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
878
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
879
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
880
|
+
#
|
881
|
+
# @overload delete_row(name: nil)
|
882
|
+
# Pass arguments to `delete_row` via keyword arguments. Note that at
|
883
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
884
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
885
|
+
#
|
886
|
+
# @param name [::String]
|
887
|
+
# Required. The name of the row to delete.
|
888
|
+
# Format: tables/\\{table}/rows/\\{row}
|
889
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
890
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
891
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
892
|
+
#
|
893
|
+
# @return [::Google::Protobuf::Empty]
|
894
|
+
#
|
895
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
896
|
+
def delete_row request, options = nil
|
897
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
898
|
+
|
899
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::DeleteRowRequest
|
900
|
+
|
901
|
+
# Converts hash and nil to an options object
|
902
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
903
|
+
|
904
|
+
# Customize the options with defaults
|
905
|
+
call_metadata = @config.rpcs.delete_row.metadata.to_h
|
906
|
+
|
907
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
908
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
909
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
910
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
911
|
+
transports_version_send: [:rest]
|
912
|
+
|
913
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
914
|
+
|
915
|
+
options.apply_defaults timeout: @config.rpcs.delete_row.timeout,
|
916
|
+
metadata: call_metadata,
|
917
|
+
retry_policy: @config.rpcs.delete_row.retry_policy
|
918
|
+
|
919
|
+
options.apply_defaults timeout: @config.timeout,
|
920
|
+
metadata: @config.metadata,
|
921
|
+
retry_policy: @config.retry_policy
|
922
|
+
|
923
|
+
@tables_service_stub.delete_row request, options do |result, operation|
|
924
|
+
yield result, operation if block_given?
|
925
|
+
return result
|
926
|
+
end
|
927
|
+
rescue ::Gapic::Rest::Error => e
|
928
|
+
raise ::Google::Cloud::Error.from_error(e)
|
929
|
+
end
|
930
|
+
|
931
|
+
##
|
932
|
+
# Deletes multiple rows.
|
933
|
+
#
|
934
|
+
# @overload batch_delete_rows(request, options = nil)
|
935
|
+
# Pass arguments to `batch_delete_rows` via a request object, either of type
|
936
|
+
# {::Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest} or an equivalent Hash.
|
937
|
+
#
|
938
|
+
# @param request [::Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest, ::Hash]
|
939
|
+
# A request object representing the call parameters. Required. To specify no
|
940
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
941
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
942
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
943
|
+
#
|
944
|
+
# @overload batch_delete_rows(parent: nil, names: nil)
|
945
|
+
# Pass arguments to `batch_delete_rows` via keyword arguments. Note that at
|
946
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
947
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
948
|
+
#
|
949
|
+
# @param parent [::String]
|
950
|
+
# Required. The parent table shared by all rows being deleted.
|
951
|
+
# Format: tables/\\{table}
|
952
|
+
# @param names [::Array<::String>]
|
953
|
+
# Required. The names of the rows to delete. All rows must belong to the parent table
|
954
|
+
# or else the entire batch will fail. A maximum of 500 rows can be deleted
|
955
|
+
# in a batch.
|
956
|
+
# Format: tables/\\{table}/rows/\\{row}
|
957
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
958
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
959
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
960
|
+
#
|
961
|
+
# @return [::Google::Protobuf::Empty]
|
962
|
+
#
|
963
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
964
|
+
def batch_delete_rows request, options = nil
|
965
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
966
|
+
|
967
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest
|
968
|
+
|
969
|
+
# Converts hash and nil to an options object
|
970
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
971
|
+
|
972
|
+
# Customize the options with defaults
|
973
|
+
call_metadata = @config.rpcs.batch_delete_rows.metadata.to_h
|
974
|
+
|
975
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
976
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
977
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
978
|
+
gapic_version: ::Google::Area120::Tables::V1alpha1::VERSION,
|
979
|
+
transports_version_send: [:rest]
|
980
|
+
|
981
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
982
|
+
|
983
|
+
options.apply_defaults timeout: @config.rpcs.batch_delete_rows.timeout,
|
984
|
+
metadata: call_metadata,
|
985
|
+
retry_policy: @config.rpcs.batch_delete_rows.retry_policy
|
986
|
+
|
987
|
+
options.apply_defaults timeout: @config.timeout,
|
988
|
+
metadata: @config.metadata,
|
989
|
+
retry_policy: @config.retry_policy
|
990
|
+
|
991
|
+
@tables_service_stub.batch_delete_rows request, options do |result, operation|
|
992
|
+
yield result, operation if block_given?
|
993
|
+
return result
|
994
|
+
end
|
995
|
+
rescue ::Gapic::Rest::Error => e
|
996
|
+
raise ::Google::Cloud::Error.from_error(e)
|
997
|
+
end
|
998
|
+
|
999
|
+
##
|
1000
|
+
# Configuration class for the TablesService REST API.
|
1001
|
+
#
|
1002
|
+
# This class represents the configuration for TablesService REST,
|
1003
|
+
# providing control over timeouts, retry behavior, logging, transport
|
1004
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
1005
|
+
# applied individually to specific RPCs. See
|
1006
|
+
# {::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client::Configuration::Rpcs}
|
1007
|
+
# for a list of RPCs that can be configured independently.
|
1008
|
+
#
|
1009
|
+
# Configuration can be applied globally to all clients, or to a single client
|
1010
|
+
# on construction.
|
1011
|
+
#
|
1012
|
+
# @example
|
1013
|
+
#
|
1014
|
+
# # Modify the global config, setting the timeout for
|
1015
|
+
# # get_table to 20 seconds,
|
1016
|
+
# # and all remaining timeouts to 10 seconds.
|
1017
|
+
# ::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client.configure do |config|
|
1018
|
+
# config.timeout = 10.0
|
1019
|
+
# config.rpcs.get_table.timeout = 20.0
|
1020
|
+
# end
|
1021
|
+
#
|
1022
|
+
# # Apply the above configuration only to a new client.
|
1023
|
+
# client = ::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client.new do |config|
|
1024
|
+
# config.timeout = 10.0
|
1025
|
+
# config.rpcs.get_table.timeout = 20.0
|
1026
|
+
# end
|
1027
|
+
#
|
1028
|
+
# @!attribute [rw] endpoint
|
1029
|
+
# The hostname or hostname:port of the service endpoint.
|
1030
|
+
# Defaults to `"area120tables.googleapis.com"`.
|
1031
|
+
# @return [::String]
|
1032
|
+
# @!attribute [rw] credentials
|
1033
|
+
# Credentials to send with calls. You may provide any of the following types:
|
1034
|
+
# * (`String`) The path to a service account key file in JSON format
|
1035
|
+
# * (`Hash`) A service account key as a Hash
|
1036
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1037
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
1038
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1039
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
1040
|
+
# * (`nil`) indicating no credentials
|
1041
|
+
# @return [::Object]
|
1042
|
+
# @!attribute [rw] scope
|
1043
|
+
# The OAuth scopes
|
1044
|
+
# @return [::Array<::String>]
|
1045
|
+
# @!attribute [rw] lib_name
|
1046
|
+
# The library name as recorded in instrumentation and logging
|
1047
|
+
# @return [::String]
|
1048
|
+
# @!attribute [rw] lib_version
|
1049
|
+
# The library version as recorded in instrumentation and logging
|
1050
|
+
# @return [::String]
|
1051
|
+
# @!attribute [rw] timeout
|
1052
|
+
# The call timeout in seconds.
|
1053
|
+
# @return [::Numeric]
|
1054
|
+
# @!attribute [rw] metadata
|
1055
|
+
# Additional headers to be sent with the call.
|
1056
|
+
# @return [::Hash{::Symbol=>::String}]
|
1057
|
+
# @!attribute [rw] retry_policy
|
1058
|
+
# The retry policy. The value is a hash with the following keys:
|
1059
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1060
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1061
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1062
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1063
|
+
# trigger a retry.
|
1064
|
+
# @return [::Hash]
|
1065
|
+
# @!attribute [rw] quota_project
|
1066
|
+
# A separate project against which to charge quota.
|
1067
|
+
# @return [::String]
|
1068
|
+
#
|
1069
|
+
class Configuration
|
1070
|
+
extend ::Gapic::Config
|
1071
|
+
|
1072
|
+
config_attr :endpoint, "area120tables.googleapis.com", ::String
|
1073
|
+
config_attr :credentials, nil do |value|
|
1074
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1075
|
+
allowed.any? { |klass| klass === value }
|
1076
|
+
end
|
1077
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1078
|
+
config_attr :lib_name, nil, ::String, nil
|
1079
|
+
config_attr :lib_version, nil, ::String, nil
|
1080
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1081
|
+
config_attr :metadata, nil, ::Hash, nil
|
1082
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1083
|
+
config_attr :quota_project, nil, ::String, nil
|
1084
|
+
|
1085
|
+
# @private
|
1086
|
+
def initialize parent_config = nil
|
1087
|
+
@parent_config = parent_config unless parent_config.nil?
|
1088
|
+
|
1089
|
+
yield self if block_given?
|
1090
|
+
end
|
1091
|
+
|
1092
|
+
##
|
1093
|
+
# Configurations for individual RPCs
|
1094
|
+
# @return [Rpcs]
|
1095
|
+
#
|
1096
|
+
def rpcs
|
1097
|
+
@rpcs ||= begin
|
1098
|
+
parent_rpcs = nil
|
1099
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1100
|
+
Rpcs.new parent_rpcs
|
1101
|
+
end
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
##
|
1105
|
+
# Configuration RPC class for the TablesService API.
|
1106
|
+
#
|
1107
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1108
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1109
|
+
# the following configuration fields:
|
1110
|
+
#
|
1111
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1112
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
1113
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1114
|
+
# include the following keys:
|
1115
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1116
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1117
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1118
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1119
|
+
# trigger a retry.
|
1120
|
+
#
|
1121
|
+
class Rpcs
|
1122
|
+
##
|
1123
|
+
# RPC-specific configuration for `get_table`
|
1124
|
+
# @return [::Gapic::Config::Method]
|
1125
|
+
#
|
1126
|
+
attr_reader :get_table
|
1127
|
+
##
|
1128
|
+
# RPC-specific configuration for `list_tables`
|
1129
|
+
# @return [::Gapic::Config::Method]
|
1130
|
+
#
|
1131
|
+
attr_reader :list_tables
|
1132
|
+
##
|
1133
|
+
# RPC-specific configuration for `get_workspace`
|
1134
|
+
# @return [::Gapic::Config::Method]
|
1135
|
+
#
|
1136
|
+
attr_reader :get_workspace
|
1137
|
+
##
|
1138
|
+
# RPC-specific configuration for `list_workspaces`
|
1139
|
+
# @return [::Gapic::Config::Method]
|
1140
|
+
#
|
1141
|
+
attr_reader :list_workspaces
|
1142
|
+
##
|
1143
|
+
# RPC-specific configuration for `get_row`
|
1144
|
+
# @return [::Gapic::Config::Method]
|
1145
|
+
#
|
1146
|
+
attr_reader :get_row
|
1147
|
+
##
|
1148
|
+
# RPC-specific configuration for `list_rows`
|
1149
|
+
# @return [::Gapic::Config::Method]
|
1150
|
+
#
|
1151
|
+
attr_reader :list_rows
|
1152
|
+
##
|
1153
|
+
# RPC-specific configuration for `create_row`
|
1154
|
+
# @return [::Gapic::Config::Method]
|
1155
|
+
#
|
1156
|
+
attr_reader :create_row
|
1157
|
+
##
|
1158
|
+
# RPC-specific configuration for `batch_create_rows`
|
1159
|
+
# @return [::Gapic::Config::Method]
|
1160
|
+
#
|
1161
|
+
attr_reader :batch_create_rows
|
1162
|
+
##
|
1163
|
+
# RPC-specific configuration for `update_row`
|
1164
|
+
# @return [::Gapic::Config::Method]
|
1165
|
+
#
|
1166
|
+
attr_reader :update_row
|
1167
|
+
##
|
1168
|
+
# RPC-specific configuration for `batch_update_rows`
|
1169
|
+
# @return [::Gapic::Config::Method]
|
1170
|
+
#
|
1171
|
+
attr_reader :batch_update_rows
|
1172
|
+
##
|
1173
|
+
# RPC-specific configuration for `delete_row`
|
1174
|
+
# @return [::Gapic::Config::Method]
|
1175
|
+
#
|
1176
|
+
attr_reader :delete_row
|
1177
|
+
##
|
1178
|
+
# RPC-specific configuration for `batch_delete_rows`
|
1179
|
+
# @return [::Gapic::Config::Method]
|
1180
|
+
#
|
1181
|
+
attr_reader :batch_delete_rows
|
1182
|
+
|
1183
|
+
# @private
|
1184
|
+
def initialize parent_rpcs = nil
|
1185
|
+
get_table_config = parent_rpcs.get_table if parent_rpcs.respond_to? :get_table
|
1186
|
+
@get_table = ::Gapic::Config::Method.new get_table_config
|
1187
|
+
list_tables_config = parent_rpcs.list_tables if parent_rpcs.respond_to? :list_tables
|
1188
|
+
@list_tables = ::Gapic::Config::Method.new list_tables_config
|
1189
|
+
get_workspace_config = parent_rpcs.get_workspace if parent_rpcs.respond_to? :get_workspace
|
1190
|
+
@get_workspace = ::Gapic::Config::Method.new get_workspace_config
|
1191
|
+
list_workspaces_config = parent_rpcs.list_workspaces if parent_rpcs.respond_to? :list_workspaces
|
1192
|
+
@list_workspaces = ::Gapic::Config::Method.new list_workspaces_config
|
1193
|
+
get_row_config = parent_rpcs.get_row if parent_rpcs.respond_to? :get_row
|
1194
|
+
@get_row = ::Gapic::Config::Method.new get_row_config
|
1195
|
+
list_rows_config = parent_rpcs.list_rows if parent_rpcs.respond_to? :list_rows
|
1196
|
+
@list_rows = ::Gapic::Config::Method.new list_rows_config
|
1197
|
+
create_row_config = parent_rpcs.create_row if parent_rpcs.respond_to? :create_row
|
1198
|
+
@create_row = ::Gapic::Config::Method.new create_row_config
|
1199
|
+
batch_create_rows_config = parent_rpcs.batch_create_rows if parent_rpcs.respond_to? :batch_create_rows
|
1200
|
+
@batch_create_rows = ::Gapic::Config::Method.new batch_create_rows_config
|
1201
|
+
update_row_config = parent_rpcs.update_row if parent_rpcs.respond_to? :update_row
|
1202
|
+
@update_row = ::Gapic::Config::Method.new update_row_config
|
1203
|
+
batch_update_rows_config = parent_rpcs.batch_update_rows if parent_rpcs.respond_to? :batch_update_rows
|
1204
|
+
@batch_update_rows = ::Gapic::Config::Method.new batch_update_rows_config
|
1205
|
+
delete_row_config = parent_rpcs.delete_row if parent_rpcs.respond_to? :delete_row
|
1206
|
+
@delete_row = ::Gapic::Config::Method.new delete_row_config
|
1207
|
+
batch_delete_rows_config = parent_rpcs.batch_delete_rows if parent_rpcs.respond_to? :batch_delete_rows
|
1208
|
+
@batch_delete_rows = ::Gapic::Config::Method.new batch_delete_rows_config
|
1209
|
+
|
1210
|
+
yield self if block_given?
|
1211
|
+
end
|
1212
|
+
end
|
1213
|
+
end
|
1214
|
+
end
|
1215
|
+
end
|
1216
|
+
end
|
1217
|
+
end
|
1218
|
+
end
|
1219
|
+
end
|
1220
|
+
end
|