google-apis-datastore_v1beta3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,295 @@
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 DatastoreV1beta3
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_v1beta3'
30
+ #
31
+ # Datastore = Google::Apis::DatastoreV1beta3 # 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_v1beta3',
49
+ client_version: Google::Apis::DatastoreV1beta3::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::DatastoreV1beta3::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::DatastoreV1beta3::AllocateIdsResponse] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::DatastoreV1beta3::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, 'v1beta3/projects/{projectId}:allocateIds', options)
77
+ command.request_representation = Google::Apis::DatastoreV1beta3::AllocateIdsRequest::Representation
78
+ command.request_object = allocate_ids_request_object
79
+ command.response_representation = Google::Apis::DatastoreV1beta3::AllocateIdsResponse::Representation
80
+ command.response_class = Google::Apis::DatastoreV1beta3::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::DatastoreV1beta3::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::DatastoreV1beta3::BeginTransactionResponse] parsed result object
101
+ # @yieldparam err [StandardError] error object if request failed
102
+ #
103
+ # @return [Google::Apis::DatastoreV1beta3::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, 'v1beta3/projects/{projectId}:beginTransaction', options)
110
+ command.request_representation = Google::Apis::DatastoreV1beta3::BeginTransactionRequest::Representation
111
+ command.request_object = begin_transaction_request_object
112
+ command.response_representation = Google::Apis::DatastoreV1beta3::BeginTransactionResponse::Representation
113
+ command.response_class = Google::Apis::DatastoreV1beta3::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::DatastoreV1beta3::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::DatastoreV1beta3::CommitResponse] parsed result object
135
+ # @yieldparam err [StandardError] error object if request failed
136
+ #
137
+ # @return [Google::Apis::DatastoreV1beta3::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, 'v1beta3/projects/{projectId}:commit', options)
144
+ command.request_representation = Google::Apis::DatastoreV1beta3::CommitRequest::Representation
145
+ command.request_object = commit_request_object
146
+ command.response_representation = Google::Apis::DatastoreV1beta3::CommitResponse::Representation
147
+ command.response_class = Google::Apis::DatastoreV1beta3::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
+ # Looks up entities by key.
155
+ # @param [String] project_id
156
+ # Required. The ID of the project against which to make the request.
157
+ # @param [Google::Apis::DatastoreV1beta3::LookupRequest] lookup_request_object
158
+ # @param [String] fields
159
+ # Selector specifying which fields to include in a partial response.
160
+ # @param [String] quota_user
161
+ # Available to use for quota purposes for server-side applications. Can be any
162
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
163
+ # @param [Google::Apis::RequestOptions] options
164
+ # Request-specific options
165
+ #
166
+ # @yield [result, err] Result & error if block supplied
167
+ # @yieldparam result [Google::Apis::DatastoreV1beta3::LookupResponse] parsed result object
168
+ # @yieldparam err [StandardError] error object if request failed
169
+ #
170
+ # @return [Google::Apis::DatastoreV1beta3::LookupResponse]
171
+ #
172
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
173
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
174
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
175
+ def lookup_project(project_id, lookup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
176
+ command = make_simple_command(:post, 'v1beta3/projects/{projectId}:lookup', options)
177
+ command.request_representation = Google::Apis::DatastoreV1beta3::LookupRequest::Representation
178
+ command.request_object = lookup_request_object
179
+ command.response_representation = Google::Apis::DatastoreV1beta3::LookupResponse::Representation
180
+ command.response_class = Google::Apis::DatastoreV1beta3::LookupResponse
181
+ command.params['projectId'] = project_id unless project_id.nil?
182
+ command.query['fields'] = fields unless fields.nil?
183
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
184
+ execute_or_queue_command(command, &block)
185
+ end
186
+
187
+ # Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.
188
+ # @param [String] project_id
189
+ # Required. The ID of the project against which to make the request.
190
+ # @param [Google::Apis::DatastoreV1beta3::ReserveIdsRequest] reserve_ids_request_object
191
+ # @param [String] fields
192
+ # Selector specifying which fields to include in a partial response.
193
+ # @param [String] quota_user
194
+ # Available to use for quota purposes for server-side applications. Can be any
195
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
196
+ # @param [Google::Apis::RequestOptions] options
197
+ # Request-specific options
198
+ #
199
+ # @yield [result, err] Result & error if block supplied
200
+ # @yieldparam result [Google::Apis::DatastoreV1beta3::ReserveIdsResponse] parsed result object
201
+ # @yieldparam err [StandardError] error object if request failed
202
+ #
203
+ # @return [Google::Apis::DatastoreV1beta3::ReserveIdsResponse]
204
+ #
205
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
206
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
207
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
208
+ def reserve_project_ids(project_id, reserve_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
209
+ command = make_simple_command(:post, 'v1beta3/projects/{projectId}:reserveIds', options)
210
+ command.request_representation = Google::Apis::DatastoreV1beta3::ReserveIdsRequest::Representation
211
+ command.request_object = reserve_ids_request_object
212
+ command.response_representation = Google::Apis::DatastoreV1beta3::ReserveIdsResponse::Representation
213
+ command.response_class = Google::Apis::DatastoreV1beta3::ReserveIdsResponse
214
+ command.params['projectId'] = project_id unless project_id.nil?
215
+ command.query['fields'] = fields unless fields.nil?
216
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
217
+ execute_or_queue_command(command, &block)
218
+ end
219
+
220
+ # Rolls back a transaction.
221
+ # @param [String] project_id
222
+ # Required. The ID of the project against which to make the request.
223
+ # @param [Google::Apis::DatastoreV1beta3::RollbackRequest] rollback_request_object
224
+ # @param [String] fields
225
+ # Selector specifying which fields to include in a partial response.
226
+ # @param [String] quota_user
227
+ # Available to use for quota purposes for server-side applications. Can be any
228
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
229
+ # @param [Google::Apis::RequestOptions] options
230
+ # Request-specific options
231
+ #
232
+ # @yield [result, err] Result & error if block supplied
233
+ # @yieldparam result [Google::Apis::DatastoreV1beta3::RollbackResponse] parsed result object
234
+ # @yieldparam err [StandardError] error object if request failed
235
+ #
236
+ # @return [Google::Apis::DatastoreV1beta3::RollbackResponse]
237
+ #
238
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
239
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
240
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
241
+ def rollback_project(project_id, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
242
+ command = make_simple_command(:post, 'v1beta3/projects/{projectId}:rollback', options)
243
+ command.request_representation = Google::Apis::DatastoreV1beta3::RollbackRequest::Representation
244
+ command.request_object = rollback_request_object
245
+ command.response_representation = Google::Apis::DatastoreV1beta3::RollbackResponse::Representation
246
+ command.response_class = Google::Apis::DatastoreV1beta3::RollbackResponse
247
+ command.params['projectId'] = project_id unless project_id.nil?
248
+ command.query['fields'] = fields unless fields.nil?
249
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
250
+ execute_or_queue_command(command, &block)
251
+ end
252
+
253
+ # Queries for entities.
254
+ # @param [String] project_id
255
+ # Required. The ID of the project against which to make the request.
256
+ # @param [Google::Apis::DatastoreV1beta3::RunQueryRequest] run_query_request_object
257
+ # @param [String] fields
258
+ # Selector specifying which fields to include in a partial response.
259
+ # @param [String] quota_user
260
+ # Available to use for quota purposes for server-side applications. Can be any
261
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
262
+ # @param [Google::Apis::RequestOptions] options
263
+ # Request-specific options
264
+ #
265
+ # @yield [result, err] Result & error if block supplied
266
+ # @yieldparam result [Google::Apis::DatastoreV1beta3::RunQueryResponse] parsed result object
267
+ # @yieldparam err [StandardError] error object if request failed
268
+ #
269
+ # @return [Google::Apis::DatastoreV1beta3::RunQueryResponse]
270
+ #
271
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
272
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
273
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
274
+ def run_project_query(project_id, run_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
275
+ command = make_simple_command(:post, 'v1beta3/projects/{projectId}:runQuery', options)
276
+ command.request_representation = Google::Apis::DatastoreV1beta3::RunQueryRequest::Representation
277
+ command.request_object = run_query_request_object
278
+ command.response_representation = Google::Apis::DatastoreV1beta3::RunQueryResponse::Representation
279
+ command.response_class = Google::Apis::DatastoreV1beta3::RunQueryResponse
280
+ command.params['projectId'] = project_id unless project_id.nil?
281
+ command.query['fields'] = fields unless fields.nil?
282
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
283
+ execute_or_queue_command(command, &block)
284
+ end
285
+
286
+ protected
287
+
288
+ def apply_command_defaults(command)
289
+ command.query['key'] = key unless key.nil?
290
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
291
+ end
292
+ end
293
+ end
294
+ end
295
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-datastore_v1beta3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Cloud Datastore API V1beta3. Simple
28
+ REST clients are Ruby client libraries that provide access to Google services via
29
+ their HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Cloud Datastore API, but note that some services may
33
+ provide a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-datastore_v1beta3.rb
44
+ - lib/google/apis/datastore_v1beta3.rb
45
+ - lib/google/apis/datastore_v1beta3/classes.rb
46
+ - lib/google/apis/datastore_v1beta3/gem_version.rb
47
+ - lib/google/apis/datastore_v1beta3/representations.rb
48
+ - lib/google/apis/datastore_v1beta3/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-datastore_v1beta3/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-datastore_v1beta3/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-datastore_v1beta3
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Cloud Datastore API V1beta3
76
+ test_files: []