google-apis-datastore_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,671 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module DatastoreV1
23
+ # Cloud Datastore API
24
+ #
25
+ # Accesses the schemaless NoSQL database to provide fully managed, robust,
26
+ # scalable storage for your application.
27
+ #
28
+ # @example
29
+ # require 'google/apis/datastore_v1'
30
+ #
31
+ # Datastore = Google::Apis::DatastoreV1 # Alias the module
32
+ # service = Datastore::DatastoreService.new
33
+ #
34
+ # @see https://cloud.google.com/datastore/
35
+ class DatastoreService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://datastore.googleapis.com/', '',
48
+ client_name: 'google-apis-datastore_v1',
49
+ client_version: Google::Apis::DatastoreV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Allocates IDs for the given keys, which is useful for referencing an entity
54
+ # before it is inserted.
55
+ # @param [String] project_id
56
+ # Required. The ID of the project against which to make the request.
57
+ # @param [Google::Apis::DatastoreV1::AllocateIdsRequest] allocate_ids_request_object
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::DatastoreV1::AllocateIdsResponse] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::DatastoreV1::AllocateIdsResponse]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def allocate_project_ids(project_id, allocate_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:post, 'v1/projects/{projectId}:allocateIds', options)
77
+ command.request_representation = Google::Apis::DatastoreV1::AllocateIdsRequest::Representation
78
+ command.request_object = allocate_ids_request_object
79
+ command.response_representation = Google::Apis::DatastoreV1::AllocateIdsResponse::Representation
80
+ command.response_class = Google::Apis::DatastoreV1::AllocateIdsResponse
81
+ command.params['projectId'] = project_id unless project_id.nil?
82
+ command.query['fields'] = fields unless fields.nil?
83
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
84
+ execute_or_queue_command(command, &block)
85
+ end
86
+
87
+ # Begins a new transaction.
88
+ # @param [String] project_id
89
+ # Required. The ID of the project against which to make the request.
90
+ # @param [Google::Apis::DatastoreV1::BeginTransactionRequest] begin_transaction_request_object
91
+ # @param [String] fields
92
+ # Selector specifying which fields to include in a partial response.
93
+ # @param [String] quota_user
94
+ # Available to use for quota purposes for server-side applications. Can be any
95
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
96
+ # @param [Google::Apis::RequestOptions] options
97
+ # Request-specific options
98
+ #
99
+ # @yield [result, err] Result & error if block supplied
100
+ # @yieldparam result [Google::Apis::DatastoreV1::BeginTransactionResponse] parsed result object
101
+ # @yieldparam err [StandardError] error object if request failed
102
+ #
103
+ # @return [Google::Apis::DatastoreV1::BeginTransactionResponse]
104
+ #
105
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
106
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
107
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
108
+ def begin_project_transaction(project_id, begin_transaction_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
109
+ command = make_simple_command(:post, 'v1/projects/{projectId}:beginTransaction', options)
110
+ command.request_representation = Google::Apis::DatastoreV1::BeginTransactionRequest::Representation
111
+ command.request_object = begin_transaction_request_object
112
+ command.response_representation = Google::Apis::DatastoreV1::BeginTransactionResponse::Representation
113
+ command.response_class = Google::Apis::DatastoreV1::BeginTransactionResponse
114
+ command.params['projectId'] = project_id unless project_id.nil?
115
+ command.query['fields'] = fields unless fields.nil?
116
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
117
+ execute_or_queue_command(command, &block)
118
+ end
119
+
120
+ # Commits a transaction, optionally creating, deleting or modifying some
121
+ # entities.
122
+ # @param [String] project_id
123
+ # Required. The ID of the project against which to make the request.
124
+ # @param [Google::Apis::DatastoreV1::CommitRequest] commit_request_object
125
+ # @param [String] fields
126
+ # Selector specifying which fields to include in a partial response.
127
+ # @param [String] quota_user
128
+ # Available to use for quota purposes for server-side applications. Can be any
129
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
130
+ # @param [Google::Apis::RequestOptions] options
131
+ # Request-specific options
132
+ #
133
+ # @yield [result, err] Result & error if block supplied
134
+ # @yieldparam result [Google::Apis::DatastoreV1::CommitResponse] parsed result object
135
+ # @yieldparam err [StandardError] error object if request failed
136
+ #
137
+ # @return [Google::Apis::DatastoreV1::CommitResponse]
138
+ #
139
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
140
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
141
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
142
+ def commit_project(project_id, commit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
143
+ command = make_simple_command(:post, 'v1/projects/{projectId}:commit', options)
144
+ command.request_representation = Google::Apis::DatastoreV1::CommitRequest::Representation
145
+ command.request_object = commit_request_object
146
+ command.response_representation = Google::Apis::DatastoreV1::CommitResponse::Representation
147
+ command.response_class = Google::Apis::DatastoreV1::CommitResponse
148
+ command.params['projectId'] = project_id unless project_id.nil?
149
+ command.query['fields'] = fields unless fields.nil?
150
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
151
+ execute_or_queue_command(command, &block)
152
+ end
153
+
154
+ # Exports a copy of all or a subset of entities from Google Cloud Datastore to
155
+ # another storage system, such as Google Cloud Storage. Recent updates to
156
+ # entities may not be reflected in the export. The export occurs in the
157
+ # background and its progress can be monitored and managed via the Operation
158
+ # resource that is created. The output of an export may only be used once the
159
+ # associated operation is done. If an export operation is cancelled before
160
+ # completion it may leave partial data behind in Google Cloud Storage.
161
+ # @param [String] project_id
162
+ # Required. Project ID against which to make the request.
163
+ # @param [Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ExportEntitiesRequest] google_datastore_admin_v1_export_entities_request_object
164
+ # @param [String] fields
165
+ # Selector specifying which fields to include in a partial response.
166
+ # @param [String] quota_user
167
+ # Available to use for quota purposes for server-side applications. Can be any
168
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
169
+ # @param [Google::Apis::RequestOptions] options
170
+ # Request-specific options
171
+ #
172
+ # @yield [result, err] Result & error if block supplied
173
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleLongrunningOperation] parsed result object
174
+ # @yieldparam err [StandardError] error object if request failed
175
+ #
176
+ # @return [Google::Apis::DatastoreV1::GoogleLongrunningOperation]
177
+ #
178
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
179
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
180
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
181
+ def export_project(project_id, google_datastore_admin_v1_export_entities_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
182
+ command = make_simple_command(:post, 'v1/projects/{projectId}:export', options)
183
+ command.request_representation = Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ExportEntitiesRequest::Representation
184
+ command.request_object = google_datastore_admin_v1_export_entities_request_object
185
+ command.response_representation = Google::Apis::DatastoreV1::GoogleLongrunningOperation::Representation
186
+ command.response_class = Google::Apis::DatastoreV1::GoogleLongrunningOperation
187
+ command.params['projectId'] = project_id unless project_id.nil?
188
+ command.query['fields'] = fields unless fields.nil?
189
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
190
+ execute_or_queue_command(command, &block)
191
+ end
192
+
193
+ # Imports entities into Google Cloud Datastore. Existing entities with the same
194
+ # key are overwritten. The import occurs in the background and its progress can
195
+ # be monitored and managed via the Operation resource that is created. If an
196
+ # ImportEntities operation is cancelled, it is possible that a subset of the
197
+ # data has already been imported to Cloud Datastore.
198
+ # @param [String] project_id
199
+ # Required. Project ID against which to make the request.
200
+ # @param [Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ImportEntitiesRequest] google_datastore_admin_v1_import_entities_request_object
201
+ # @param [String] fields
202
+ # Selector specifying which fields to include in a partial response.
203
+ # @param [String] quota_user
204
+ # Available to use for quota purposes for server-side applications. Can be any
205
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
206
+ # @param [Google::Apis::RequestOptions] options
207
+ # Request-specific options
208
+ #
209
+ # @yield [result, err] Result & error if block supplied
210
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleLongrunningOperation] parsed result object
211
+ # @yieldparam err [StandardError] error object if request failed
212
+ #
213
+ # @return [Google::Apis::DatastoreV1::GoogleLongrunningOperation]
214
+ #
215
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
216
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
217
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
218
+ def import_project(project_id, google_datastore_admin_v1_import_entities_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
219
+ command = make_simple_command(:post, 'v1/projects/{projectId}:import', options)
220
+ command.request_representation = Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ImportEntitiesRequest::Representation
221
+ command.request_object = google_datastore_admin_v1_import_entities_request_object
222
+ command.response_representation = Google::Apis::DatastoreV1::GoogleLongrunningOperation::Representation
223
+ command.response_class = Google::Apis::DatastoreV1::GoogleLongrunningOperation
224
+ command.params['projectId'] = project_id unless project_id.nil?
225
+ command.query['fields'] = fields unless fields.nil?
226
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
227
+ execute_or_queue_command(command, &block)
228
+ end
229
+
230
+ # Looks up entities by key.
231
+ # @param [String] project_id
232
+ # Required. The ID of the project against which to make the request.
233
+ # @param [Google::Apis::DatastoreV1::LookupRequest] lookup_request_object
234
+ # @param [String] fields
235
+ # Selector specifying which fields to include in a partial response.
236
+ # @param [String] quota_user
237
+ # Available to use for quota purposes for server-side applications. Can be any
238
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
239
+ # @param [Google::Apis::RequestOptions] options
240
+ # Request-specific options
241
+ #
242
+ # @yield [result, err] Result & error if block supplied
243
+ # @yieldparam result [Google::Apis::DatastoreV1::LookupResponse] parsed result object
244
+ # @yieldparam err [StandardError] error object if request failed
245
+ #
246
+ # @return [Google::Apis::DatastoreV1::LookupResponse]
247
+ #
248
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
249
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
250
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
251
+ def lookup_project(project_id, lookup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
252
+ command = make_simple_command(:post, 'v1/projects/{projectId}:lookup', options)
253
+ command.request_representation = Google::Apis::DatastoreV1::LookupRequest::Representation
254
+ command.request_object = lookup_request_object
255
+ command.response_representation = Google::Apis::DatastoreV1::LookupResponse::Representation
256
+ command.response_class = Google::Apis::DatastoreV1::LookupResponse
257
+ command.params['projectId'] = project_id unless project_id.nil?
258
+ command.query['fields'] = fields unless fields.nil?
259
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
260
+ execute_or_queue_command(command, &block)
261
+ end
262
+
263
+ # Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.
264
+ # @param [String] project_id
265
+ # Required. The ID of the project against which to make the request.
266
+ # @param [Google::Apis::DatastoreV1::ReserveIdsRequest] reserve_ids_request_object
267
+ # @param [String] fields
268
+ # Selector specifying which fields to include in a partial response.
269
+ # @param [String] quota_user
270
+ # Available to use for quota purposes for server-side applications. Can be any
271
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
272
+ # @param [Google::Apis::RequestOptions] options
273
+ # Request-specific options
274
+ #
275
+ # @yield [result, err] Result & error if block supplied
276
+ # @yieldparam result [Google::Apis::DatastoreV1::ReserveIdsResponse] parsed result object
277
+ # @yieldparam err [StandardError] error object if request failed
278
+ #
279
+ # @return [Google::Apis::DatastoreV1::ReserveIdsResponse]
280
+ #
281
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
282
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
283
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
284
+ def reserve_project_ids(project_id, reserve_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
285
+ command = make_simple_command(:post, 'v1/projects/{projectId}:reserveIds', options)
286
+ command.request_representation = Google::Apis::DatastoreV1::ReserveIdsRequest::Representation
287
+ command.request_object = reserve_ids_request_object
288
+ command.response_representation = Google::Apis::DatastoreV1::ReserveIdsResponse::Representation
289
+ command.response_class = Google::Apis::DatastoreV1::ReserveIdsResponse
290
+ command.params['projectId'] = project_id unless project_id.nil?
291
+ command.query['fields'] = fields unless fields.nil?
292
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
293
+ execute_or_queue_command(command, &block)
294
+ end
295
+
296
+ # Rolls back a transaction.
297
+ # @param [String] project_id
298
+ # Required. The ID of the project against which to make the request.
299
+ # @param [Google::Apis::DatastoreV1::RollbackRequest] rollback_request_object
300
+ # @param [String] fields
301
+ # Selector specifying which fields to include in a partial response.
302
+ # @param [String] quota_user
303
+ # Available to use for quota purposes for server-side applications. Can be any
304
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
305
+ # @param [Google::Apis::RequestOptions] options
306
+ # Request-specific options
307
+ #
308
+ # @yield [result, err] Result & error if block supplied
309
+ # @yieldparam result [Google::Apis::DatastoreV1::RollbackResponse] parsed result object
310
+ # @yieldparam err [StandardError] error object if request failed
311
+ #
312
+ # @return [Google::Apis::DatastoreV1::RollbackResponse]
313
+ #
314
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
315
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
316
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
317
+ def rollback_project(project_id, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
318
+ command = make_simple_command(:post, 'v1/projects/{projectId}:rollback', options)
319
+ command.request_representation = Google::Apis::DatastoreV1::RollbackRequest::Representation
320
+ command.request_object = rollback_request_object
321
+ command.response_representation = Google::Apis::DatastoreV1::RollbackResponse::Representation
322
+ command.response_class = Google::Apis::DatastoreV1::RollbackResponse
323
+ command.params['projectId'] = project_id unless project_id.nil?
324
+ command.query['fields'] = fields unless fields.nil?
325
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
326
+ execute_or_queue_command(command, &block)
327
+ end
328
+
329
+ # Queries for entities.
330
+ # @param [String] project_id
331
+ # Required. The ID of the project against which to make the request.
332
+ # @param [Google::Apis::DatastoreV1::RunQueryRequest] run_query_request_object
333
+ # @param [String] fields
334
+ # Selector specifying which fields to include in a partial response.
335
+ # @param [String] quota_user
336
+ # Available to use for quota purposes for server-side applications. Can be any
337
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
338
+ # @param [Google::Apis::RequestOptions] options
339
+ # Request-specific options
340
+ #
341
+ # @yield [result, err] Result & error if block supplied
342
+ # @yieldparam result [Google::Apis::DatastoreV1::RunQueryResponse] parsed result object
343
+ # @yieldparam err [StandardError] error object if request failed
344
+ #
345
+ # @return [Google::Apis::DatastoreV1::RunQueryResponse]
346
+ #
347
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
348
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
349
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
350
+ def run_project_query(project_id, run_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
351
+ command = make_simple_command(:post, 'v1/projects/{projectId}:runQuery', options)
352
+ command.request_representation = Google::Apis::DatastoreV1::RunQueryRequest::Representation
353
+ command.request_object = run_query_request_object
354
+ command.response_representation = Google::Apis::DatastoreV1::RunQueryResponse::Representation
355
+ command.response_class = Google::Apis::DatastoreV1::RunQueryResponse
356
+ command.params['projectId'] = project_id unless project_id.nil?
357
+ command.query['fields'] = fields unless fields.nil?
358
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
359
+ execute_or_queue_command(command, &block)
360
+ end
361
+
362
+ # Creates the specified index. A newly created index's initial state is `
363
+ # CREATING`. On completion of the returned google.longrunning.Operation, the
364
+ # state will be `READY`. If the index already exists, the call will return an `
365
+ # ALREADY_EXISTS` status. During index creation, the process could result in an
366
+ # error, in which case the index will move to the `ERROR` state. The process can
367
+ # be recovered by fixing the data that caused the error, removing the index with
368
+ # delete, then re-creating the index with create. Indexes with a single property
369
+ # cannot be created.
370
+ # @param [String] project_id
371
+ # Project ID against which to make the request.
372
+ # @param [Google::Apis::DatastoreV1::GoogleDatastoreAdminV1Index] google_datastore_admin_v1_index_object
373
+ # @param [String] fields
374
+ # Selector specifying which fields to include in a partial response.
375
+ # @param [String] quota_user
376
+ # Available to use for quota purposes for server-side applications. Can be any
377
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
378
+ # @param [Google::Apis::RequestOptions] options
379
+ # Request-specific options
380
+ #
381
+ # @yield [result, err] Result & error if block supplied
382
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleLongrunningOperation] parsed result object
383
+ # @yieldparam err [StandardError] error object if request failed
384
+ #
385
+ # @return [Google::Apis::DatastoreV1::GoogleLongrunningOperation]
386
+ #
387
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
388
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
389
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
390
+ def create_project_index(project_id, google_datastore_admin_v1_index_object = nil, fields: nil, quota_user: nil, options: nil, &block)
391
+ command = make_simple_command(:post, 'v1/projects/{projectId}/indexes', options)
392
+ command.request_representation = Google::Apis::DatastoreV1::GoogleDatastoreAdminV1Index::Representation
393
+ command.request_object = google_datastore_admin_v1_index_object
394
+ command.response_representation = Google::Apis::DatastoreV1::GoogleLongrunningOperation::Representation
395
+ command.response_class = Google::Apis::DatastoreV1::GoogleLongrunningOperation
396
+ command.params['projectId'] = project_id unless project_id.nil?
397
+ command.query['fields'] = fields unless fields.nil?
398
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
399
+ execute_or_queue_command(command, &block)
400
+ end
401
+
402
+ # Deletes an existing index. An index can only be deleted if it is in a `READY`
403
+ # or `ERROR` state. On successful execution of the request, the index will be in
404
+ # a `DELETING` state. And on completion of the returned google.longrunning.
405
+ # Operation, the index will be removed. During index deletion, the process could
406
+ # result in an error, in which case the index will move to the `ERROR` state.
407
+ # The process can be recovered by fixing the data that caused the error,
408
+ # followed by calling delete again.
409
+ # @param [String] project_id
410
+ # Project ID against which to make the request.
411
+ # @param [String] index_id
412
+ # The resource ID of the index to delete.
413
+ # @param [String] fields
414
+ # Selector specifying which fields to include in a partial response.
415
+ # @param [String] quota_user
416
+ # Available to use for quota purposes for server-side applications. Can be any
417
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
418
+ # @param [Google::Apis::RequestOptions] options
419
+ # Request-specific options
420
+ #
421
+ # @yield [result, err] Result & error if block supplied
422
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleLongrunningOperation] parsed result object
423
+ # @yieldparam err [StandardError] error object if request failed
424
+ #
425
+ # @return [Google::Apis::DatastoreV1::GoogleLongrunningOperation]
426
+ #
427
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
428
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
429
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
430
+ def delete_project_index(project_id, index_id, fields: nil, quota_user: nil, options: nil, &block)
431
+ command = make_simple_command(:delete, 'v1/projects/{projectId}/indexes/{indexId}', options)
432
+ command.response_representation = Google::Apis::DatastoreV1::GoogleLongrunningOperation::Representation
433
+ command.response_class = Google::Apis::DatastoreV1::GoogleLongrunningOperation
434
+ command.params['projectId'] = project_id unless project_id.nil?
435
+ command.params['indexId'] = index_id unless index_id.nil?
436
+ command.query['fields'] = fields unless fields.nil?
437
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
438
+ execute_or_queue_command(command, &block)
439
+ end
440
+
441
+ # Gets an index.
442
+ # @param [String] project_id
443
+ # Project ID against which to make the request.
444
+ # @param [String] index_id
445
+ # The resource ID of the index to get.
446
+ # @param [String] fields
447
+ # Selector specifying which fields to include in a partial response.
448
+ # @param [String] quota_user
449
+ # Available to use for quota purposes for server-side applications. Can be any
450
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
451
+ # @param [Google::Apis::RequestOptions] options
452
+ # Request-specific options
453
+ #
454
+ # @yield [result, err] Result & error if block supplied
455
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleDatastoreAdminV1Index] parsed result object
456
+ # @yieldparam err [StandardError] error object if request failed
457
+ #
458
+ # @return [Google::Apis::DatastoreV1::GoogleDatastoreAdminV1Index]
459
+ #
460
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
461
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
462
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
463
+ def get_project_index(project_id, index_id, fields: nil, quota_user: nil, options: nil, &block)
464
+ command = make_simple_command(:get, 'v1/projects/{projectId}/indexes/{indexId}', options)
465
+ command.response_representation = Google::Apis::DatastoreV1::GoogleDatastoreAdminV1Index::Representation
466
+ command.response_class = Google::Apis::DatastoreV1::GoogleDatastoreAdminV1Index
467
+ command.params['projectId'] = project_id unless project_id.nil?
468
+ command.params['indexId'] = index_id unless index_id.nil?
469
+ command.query['fields'] = fields unless fields.nil?
470
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
471
+ execute_or_queue_command(command, &block)
472
+ end
473
+
474
+ # Lists the indexes that match the specified filters. Datastore uses an
475
+ # eventually consistent query to fetch the list of indexes and may occasionally
476
+ # return stale results.
477
+ # @param [String] project_id
478
+ # Project ID against which to make the request.
479
+ # @param [String] filter
480
+ # @param [Fixnum] page_size
481
+ # The maximum number of items to return. If zero, then all results will be
482
+ # returned.
483
+ # @param [String] page_token
484
+ # The next_page_token value returned from a previous List request, if any.
485
+ # @param [String] fields
486
+ # Selector specifying which fields to include in a partial response.
487
+ # @param [String] quota_user
488
+ # Available to use for quota purposes for server-side applications. Can be any
489
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
490
+ # @param [Google::Apis::RequestOptions] options
491
+ # Request-specific options
492
+ #
493
+ # @yield [result, err] Result & error if block supplied
494
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ListIndexesResponse] parsed result object
495
+ # @yieldparam err [StandardError] error object if request failed
496
+ #
497
+ # @return [Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ListIndexesResponse]
498
+ #
499
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
500
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
501
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
502
+ def list_project_indexes(project_id, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
503
+ command = make_simple_command(:get, 'v1/projects/{projectId}/indexes', options)
504
+ command.response_representation = Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ListIndexesResponse::Representation
505
+ command.response_class = Google::Apis::DatastoreV1::GoogleDatastoreAdminV1ListIndexesResponse
506
+ command.params['projectId'] = project_id unless project_id.nil?
507
+ command.query['filter'] = filter unless filter.nil?
508
+ command.query['pageSize'] = page_size unless page_size.nil?
509
+ command.query['pageToken'] = page_token unless page_token.nil?
510
+ command.query['fields'] = fields unless fields.nil?
511
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
512
+ execute_or_queue_command(command, &block)
513
+ end
514
+
515
+ # Starts asynchronous cancellation on a long-running operation. The server makes
516
+ # a best effort to cancel the operation, but success is not guaranteed. If the
517
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
518
+ # Clients can use Operations.GetOperation or other methods to check whether the
519
+ # cancellation succeeded or whether the operation completed despite cancellation.
520
+ # On successful cancellation, the operation is not deleted; instead, it becomes
521
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
522
+ # corresponding to `Code.CANCELLED`.
523
+ # @param [String] name
524
+ # The name of the operation resource to be cancelled.
525
+ # @param [String] fields
526
+ # Selector specifying which fields to include in a partial response.
527
+ # @param [String] quota_user
528
+ # Available to use for quota purposes for server-side applications. Can be any
529
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
530
+ # @param [Google::Apis::RequestOptions] options
531
+ # Request-specific options
532
+ #
533
+ # @yield [result, err] Result & error if block supplied
534
+ # @yieldparam result [Google::Apis::DatastoreV1::Empty] parsed result object
535
+ # @yieldparam err [StandardError] error object if request failed
536
+ #
537
+ # @return [Google::Apis::DatastoreV1::Empty]
538
+ #
539
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
540
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
541
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
542
+ def cancel_project_operation(name, fields: nil, quota_user: nil, options: nil, &block)
543
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
544
+ command.response_representation = Google::Apis::DatastoreV1::Empty::Representation
545
+ command.response_class = Google::Apis::DatastoreV1::Empty
546
+ command.params['name'] = name unless name.nil?
547
+ command.query['fields'] = fields unless fields.nil?
548
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
549
+ execute_or_queue_command(command, &block)
550
+ end
551
+
552
+ # Deletes a long-running operation. This method indicates that the client is no
553
+ # longer interested in the operation result. It does not cancel the operation.
554
+ # If the server doesn't support this method, it returns `google.rpc.Code.
555
+ # UNIMPLEMENTED`.
556
+ # @param [String] name
557
+ # The name of the operation resource to be deleted.
558
+ # @param [String] fields
559
+ # Selector specifying which fields to include in a partial response.
560
+ # @param [String] quota_user
561
+ # Available to use for quota purposes for server-side applications. Can be any
562
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
563
+ # @param [Google::Apis::RequestOptions] options
564
+ # Request-specific options
565
+ #
566
+ # @yield [result, err] Result & error if block supplied
567
+ # @yieldparam result [Google::Apis::DatastoreV1::Empty] parsed result object
568
+ # @yieldparam err [StandardError] error object if request failed
569
+ #
570
+ # @return [Google::Apis::DatastoreV1::Empty]
571
+ #
572
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
573
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
574
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
575
+ def delete_project_operation(name, fields: nil, quota_user: nil, options: nil, &block)
576
+ command = make_simple_command(:delete, 'v1/{+name}', options)
577
+ command.response_representation = Google::Apis::DatastoreV1::Empty::Representation
578
+ command.response_class = Google::Apis::DatastoreV1::Empty
579
+ command.params['name'] = name unless name.nil?
580
+ command.query['fields'] = fields unless fields.nil?
581
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
582
+ execute_or_queue_command(command, &block)
583
+ end
584
+
585
+ # Gets the latest state of a long-running operation. Clients can use this method
586
+ # to poll the operation result at intervals as recommended by the API service.
587
+ # @param [String] name
588
+ # The name of the operation resource.
589
+ # @param [String] fields
590
+ # Selector specifying which fields to include in a partial response.
591
+ # @param [String] quota_user
592
+ # Available to use for quota purposes for server-side applications. Can be any
593
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
594
+ # @param [Google::Apis::RequestOptions] options
595
+ # Request-specific options
596
+ #
597
+ # @yield [result, err] Result & error if block supplied
598
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleLongrunningOperation] parsed result object
599
+ # @yieldparam err [StandardError] error object if request failed
600
+ #
601
+ # @return [Google::Apis::DatastoreV1::GoogleLongrunningOperation]
602
+ #
603
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
604
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
605
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
606
+ def get_project_operation(name, fields: nil, quota_user: nil, options: nil, &block)
607
+ command = make_simple_command(:get, 'v1/{+name}', options)
608
+ command.response_representation = Google::Apis::DatastoreV1::GoogleLongrunningOperation::Representation
609
+ command.response_class = Google::Apis::DatastoreV1::GoogleLongrunningOperation
610
+ command.params['name'] = name unless name.nil?
611
+ command.query['fields'] = fields unless fields.nil?
612
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
613
+ execute_or_queue_command(command, &block)
614
+ end
615
+
616
+ # Lists operations that match the specified filter in the request. If the server
617
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
618
+ # binding allows API services to override the binding to use different resource
619
+ # name schemes, such as `users/*/operations`. To override the binding, API
620
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
621
+ # service configuration. For backwards compatibility, the default name includes
622
+ # the operations collection id, however overriding users must ensure the name
623
+ # binding is the parent resource, without the operations collection id.
624
+ # @param [String] name
625
+ # The name of the operation's parent resource.
626
+ # @param [String] filter
627
+ # The standard list filter.
628
+ # @param [Fixnum] page_size
629
+ # The standard list page size.
630
+ # @param [String] page_token
631
+ # The standard list page token.
632
+ # @param [String] fields
633
+ # Selector specifying which fields to include in a partial response.
634
+ # @param [String] quota_user
635
+ # Available to use for quota purposes for server-side applications. Can be any
636
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
637
+ # @param [Google::Apis::RequestOptions] options
638
+ # Request-specific options
639
+ #
640
+ # @yield [result, err] Result & error if block supplied
641
+ # @yieldparam result [Google::Apis::DatastoreV1::GoogleLongrunningListOperationsResponse] parsed result object
642
+ # @yieldparam err [StandardError] error object if request failed
643
+ #
644
+ # @return [Google::Apis::DatastoreV1::GoogleLongrunningListOperationsResponse]
645
+ #
646
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
647
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
648
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
649
+ def list_project_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
650
+ command = make_simple_command(:get, 'v1/{+name}/operations', options)
651
+ command.response_representation = Google::Apis::DatastoreV1::GoogleLongrunningListOperationsResponse::Representation
652
+ command.response_class = Google::Apis::DatastoreV1::GoogleLongrunningListOperationsResponse
653
+ command.params['name'] = name unless name.nil?
654
+ command.query['filter'] = filter unless filter.nil?
655
+ command.query['pageSize'] = page_size unless page_size.nil?
656
+ command.query['pageToken'] = page_token unless page_token.nil?
657
+ command.query['fields'] = fields unless fields.nil?
658
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
659
+ execute_or_queue_command(command, &block)
660
+ end
661
+
662
+ protected
663
+
664
+ def apply_command_defaults(command)
665
+ command.query['key'] = key unless key.nil?
666
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
667
+ end
668
+ end
669
+ end
670
+ end
671
+ end