google-apis-datastore_v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
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
+ module Google
16
+ module Apis
17
+ module DatastoreV1beta1
18
+ # Version of the google-apis-datastore_v1beta1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200802"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,308 @@
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 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module DatastoreV1beta1
24
+
25
+ class GoogleDatastoreAdminV1CommonMetadata
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleDatastoreAdminV1EntityFilter
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleDatastoreAdminV1ExportEntitiesMetadata
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleDatastoreAdminV1ExportEntitiesResponse
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleDatastoreAdminV1ImportEntitiesMetadata
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GoogleDatastoreAdminV1IndexOperationMetadata
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GoogleDatastoreAdminV1Progress
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GoogleDatastoreAdminV1beta1CommonMetadata
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GoogleDatastoreAdminV1beta1EntityFilter
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GoogleDatastoreAdminV1beta1ExportEntitiesMetadata
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GoogleDatastoreAdminV1beta1ExportEntitiesRequest
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GoogleDatastoreAdminV1beta1ExportEntitiesResponse
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class GoogleDatastoreAdminV1beta1ImportEntitiesMetadata
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class GoogleDatastoreAdminV1beta1ImportEntitiesRequest
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class GoogleDatastoreAdminV1beta1Progress
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class GoogleLongrunningOperation
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Status
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class GoogleDatastoreAdminV1CommonMetadata
128
+ # @private
129
+ class Representation < Google::Apis::Core::JsonRepresentation
130
+ property :end_time, as: 'endTime'
131
+ hash :labels, as: 'labels'
132
+ property :operation_type, as: 'operationType'
133
+ property :start_time, as: 'startTime'
134
+ property :state, as: 'state'
135
+ end
136
+ end
137
+
138
+ class GoogleDatastoreAdminV1EntityFilter
139
+ # @private
140
+ class Representation < Google::Apis::Core::JsonRepresentation
141
+ collection :kinds, as: 'kinds'
142
+ collection :namespace_ids, as: 'namespaceIds'
143
+ end
144
+ end
145
+
146
+ class GoogleDatastoreAdminV1ExportEntitiesMetadata
147
+ # @private
148
+ class Representation < Google::Apis::Core::JsonRepresentation
149
+ property :common, as: 'common', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1CommonMetadata, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1CommonMetadata::Representation
150
+
151
+ property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1EntityFilter, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1EntityFilter::Representation
152
+
153
+ property :output_url_prefix, as: 'outputUrlPrefix'
154
+ property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress::Representation
155
+
156
+ property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress::Representation
157
+
158
+ end
159
+ end
160
+
161
+ class GoogleDatastoreAdminV1ExportEntitiesResponse
162
+ # @private
163
+ class Representation < Google::Apis::Core::JsonRepresentation
164
+ property :output_url, as: 'outputUrl'
165
+ end
166
+ end
167
+
168
+ class GoogleDatastoreAdminV1ImportEntitiesMetadata
169
+ # @private
170
+ class Representation < Google::Apis::Core::JsonRepresentation
171
+ property :common, as: 'common', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1CommonMetadata, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1CommonMetadata::Representation
172
+
173
+ property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1EntityFilter, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1EntityFilter::Representation
174
+
175
+ property :input_url, as: 'inputUrl'
176
+ property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress::Representation
177
+
178
+ property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress::Representation
179
+
180
+ end
181
+ end
182
+
183
+ class GoogleDatastoreAdminV1IndexOperationMetadata
184
+ # @private
185
+ class Representation < Google::Apis::Core::JsonRepresentation
186
+ property :common, as: 'common', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1CommonMetadata, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1CommonMetadata::Representation
187
+
188
+ property :index_id, as: 'indexId'
189
+ property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1Progress::Representation
190
+
191
+ end
192
+ end
193
+
194
+ class GoogleDatastoreAdminV1Progress
195
+ # @private
196
+ class Representation < Google::Apis::Core::JsonRepresentation
197
+ property :work_completed, :numeric_string => true, as: 'workCompleted'
198
+ property :work_estimated, :numeric_string => true, as: 'workEstimated'
199
+ end
200
+ end
201
+
202
+ class GoogleDatastoreAdminV1beta1CommonMetadata
203
+ # @private
204
+ class Representation < Google::Apis::Core::JsonRepresentation
205
+ property :end_time, as: 'endTime'
206
+ hash :labels, as: 'labels'
207
+ property :operation_type, as: 'operationType'
208
+ property :start_time, as: 'startTime'
209
+ property :state, as: 'state'
210
+ end
211
+ end
212
+
213
+ class GoogleDatastoreAdminV1beta1EntityFilter
214
+ # @private
215
+ class Representation < Google::Apis::Core::JsonRepresentation
216
+ collection :kinds, as: 'kinds'
217
+ collection :namespace_ids, as: 'namespaceIds'
218
+ end
219
+ end
220
+
221
+ class GoogleDatastoreAdminV1beta1ExportEntitiesMetadata
222
+ # @private
223
+ class Representation < Google::Apis::Core::JsonRepresentation
224
+ property :common, as: 'common', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1CommonMetadata, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1CommonMetadata::Representation
225
+
226
+ property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter::Representation
227
+
228
+ property :output_url_prefix, as: 'outputUrlPrefix'
229
+ property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress::Representation
230
+
231
+ property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress::Representation
232
+
233
+ end
234
+ end
235
+
236
+ class GoogleDatastoreAdminV1beta1ExportEntitiesRequest
237
+ # @private
238
+ class Representation < Google::Apis::Core::JsonRepresentation
239
+ property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter::Representation
240
+
241
+ hash :labels, as: 'labels'
242
+ property :output_url_prefix, as: 'outputUrlPrefix'
243
+ end
244
+ end
245
+
246
+ class GoogleDatastoreAdminV1beta1ExportEntitiesResponse
247
+ # @private
248
+ class Representation < Google::Apis::Core::JsonRepresentation
249
+ property :output_url, as: 'outputUrl'
250
+ end
251
+ end
252
+
253
+ class GoogleDatastoreAdminV1beta1ImportEntitiesMetadata
254
+ # @private
255
+ class Representation < Google::Apis::Core::JsonRepresentation
256
+ property :common, as: 'common', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1CommonMetadata, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1CommonMetadata::Representation
257
+
258
+ property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter::Representation
259
+
260
+ property :input_url, as: 'inputUrl'
261
+ property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress::Representation
262
+
263
+ property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1Progress::Representation
264
+
265
+ end
266
+ end
267
+
268
+ class GoogleDatastoreAdminV1beta1ImportEntitiesRequest
269
+ # @private
270
+ class Representation < Google::Apis::Core::JsonRepresentation
271
+ property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter, decorator: Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1EntityFilter::Representation
272
+
273
+ property :input_url, as: 'inputUrl'
274
+ hash :labels, as: 'labels'
275
+ end
276
+ end
277
+
278
+ class GoogleDatastoreAdminV1beta1Progress
279
+ # @private
280
+ class Representation < Google::Apis::Core::JsonRepresentation
281
+ property :work_completed, :numeric_string => true, as: 'workCompleted'
282
+ property :work_estimated, :numeric_string => true, as: 'workEstimated'
283
+ end
284
+ end
285
+
286
+ class GoogleLongrunningOperation
287
+ # @private
288
+ class Representation < Google::Apis::Core::JsonRepresentation
289
+ property :done, as: 'done'
290
+ property :error, as: 'error', class: Google::Apis::DatastoreV1beta1::Status, decorator: Google::Apis::DatastoreV1beta1::Status::Representation
291
+
292
+ hash :metadata, as: 'metadata'
293
+ property :name, as: 'name'
294
+ hash :response, as: 'response'
295
+ end
296
+ end
297
+
298
+ class Status
299
+ # @private
300
+ class Representation < Google::Apis::Core::JsonRepresentation
301
+ property :code, as: 'code'
302
+ collection :details, as: 'details'
303
+ property :message, as: 'message'
304
+ end
305
+ end
306
+ end
307
+ end
308
+ end
@@ -0,0 +1,138 @@
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 DatastoreV1beta1
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_v1beta1'
30
+ #
31
+ # Datastore = Google::Apis::DatastoreV1beta1 # 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_v1beta1',
49
+ client_version: Google::Apis::DatastoreV1beta1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Exports a copy of all or a subset of entities from Google Cloud Datastore to
54
+ # another storage system, such as Google Cloud Storage. Recent updates to
55
+ # entities may not be reflected in the export. The export occurs in the
56
+ # background and its progress can be monitored and managed via the Operation
57
+ # resource that is created. The output of an export may only be used once the
58
+ # associated operation is done. If an export operation is cancelled before
59
+ # completion it may leave partial data behind in Google Cloud Storage.
60
+ # @param [String] project_id
61
+ # Project ID against which to make the request.
62
+ # @param [Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1ExportEntitiesRequest] google_datastore_admin_v1beta1_export_entities_request_object
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [String] quota_user
66
+ # Available to use for quota purposes for server-side applications. Can be any
67
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def export_project(project_id, google_datastore_admin_v1beta1_export_entities_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
81
+ command = make_simple_command(:post, 'v1beta1/projects/{projectId}:export', options)
82
+ command.request_representation = Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1ExportEntitiesRequest::Representation
83
+ command.request_object = google_datastore_admin_v1beta1_export_entities_request_object
84
+ command.response_representation = Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation::Representation
85
+ command.response_class = Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation
86
+ command.params['projectId'] = project_id unless project_id.nil?
87
+ command.query['fields'] = fields unless fields.nil?
88
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
89
+ execute_or_queue_command(command, &block)
90
+ end
91
+
92
+ # Imports entities into Google Cloud Datastore. Existing entities with the same
93
+ # key are overwritten. The import occurs in the background and its progress can
94
+ # be monitored and managed via the Operation resource that is created. If an
95
+ # ImportEntities operation is cancelled, it is possible that a subset of the
96
+ # data has already been imported to Cloud Datastore.
97
+ # @param [String] project_id
98
+ # Project ID against which to make the request.
99
+ # @param [Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1ImportEntitiesRequest] google_datastore_admin_v1beta1_import_entities_request_object
100
+ # @param [String] fields
101
+ # Selector specifying which fields to include in a partial response.
102
+ # @param [String] quota_user
103
+ # Available to use for quota purposes for server-side applications. Can be any
104
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
105
+ # @param [Google::Apis::RequestOptions] options
106
+ # Request-specific options
107
+ #
108
+ # @yield [result, err] Result & error if block supplied
109
+ # @yieldparam result [Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation] parsed result object
110
+ # @yieldparam err [StandardError] error object if request failed
111
+ #
112
+ # @return [Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation]
113
+ #
114
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
115
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
116
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
117
+ def import_project(project_id, google_datastore_admin_v1beta1_import_entities_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
118
+ command = make_simple_command(:post, 'v1beta1/projects/{projectId}:import', options)
119
+ command.request_representation = Google::Apis::DatastoreV1beta1::GoogleDatastoreAdminV1beta1ImportEntitiesRequest::Representation
120
+ command.request_object = google_datastore_admin_v1beta1_import_entities_request_object
121
+ command.response_representation = Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation::Representation
122
+ command.response_class = Google::Apis::DatastoreV1beta1::GoogleLongrunningOperation
123
+ command.params['projectId'] = project_id unless project_id.nil?
124
+ command.query['fields'] = fields unless fields.nil?
125
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
126
+ execute_or_queue_command(command, &block)
127
+ end
128
+
129
+ protected
130
+
131
+ def apply_command_defaults(command)
132
+ command.query['key'] = key unless key.nil?
133
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end