google-cloud-datastore-admin-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,364 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Cloud
22
+ module Datastore
23
+ module Admin
24
+ module V1
25
+ # Metadata common to all Datastore Admin operations.
26
+ # @!attribute [rw] start_time
27
+ # @return [::Google::Protobuf::Timestamp]
28
+ # The time that work began on the operation.
29
+ # @!attribute [rw] end_time
30
+ # @return [::Google::Protobuf::Timestamp]
31
+ # The time the operation ended, either successfully or otherwise.
32
+ # @!attribute [rw] operation_type
33
+ # @return [::Google::Cloud::Datastore::Admin::V1::OperationType]
34
+ # The type of the operation. Can be used as a filter in
35
+ # ListOperationsRequest.
36
+ # @!attribute [rw] labels
37
+ # @return [::Google::Protobuf::Map{::String => ::String}]
38
+ # The client-assigned labels which were provided when the operation was
39
+ # created. May also include additional labels.
40
+ # @!attribute [rw] state
41
+ # @return [::Google::Cloud::Datastore::Admin::V1::CommonMetadata::State]
42
+ # The current state of the Operation.
43
+ class CommonMetadata
44
+ include ::Google::Protobuf::MessageExts
45
+ extend ::Google::Protobuf::MessageExts::ClassMethods
46
+
47
+ # @!attribute [rw] key
48
+ # @return [::String]
49
+ # @!attribute [rw] value
50
+ # @return [::String]
51
+ class LabelsEntry
52
+ include ::Google::Protobuf::MessageExts
53
+ extend ::Google::Protobuf::MessageExts::ClassMethods
54
+ end
55
+
56
+ # The various possible states for an ongoing Operation.
57
+ module State
58
+ # Unspecified.
59
+ STATE_UNSPECIFIED = 0
60
+
61
+ # Request is being prepared for processing.
62
+ INITIALIZING = 1
63
+
64
+ # Request is actively being processed.
65
+ PROCESSING = 2
66
+
67
+ # Request is in the process of being cancelled after user called
68
+ # google.longrunning.Operations.CancelOperation on the operation.
69
+ CANCELLING = 3
70
+
71
+ # Request has been processed and is in its finalization stage.
72
+ FINALIZING = 4
73
+
74
+ # Request has completed successfully.
75
+ SUCCESSFUL = 5
76
+
77
+ # Request has finished being processed, but encountered an error.
78
+ FAILED = 6
79
+
80
+ # Request has finished being cancelled after user called
81
+ # google.longrunning.Operations.CancelOperation.
82
+ CANCELLED = 7
83
+ end
84
+ end
85
+
86
+ # Measures the progress of a particular metric.
87
+ # @!attribute [rw] work_completed
88
+ # @return [::Integer]
89
+ # The amount of work that has been completed. Note that this may be greater
90
+ # than work_estimated.
91
+ # @!attribute [rw] work_estimated
92
+ # @return [::Integer]
93
+ # An estimate of how much work needs to be performed. May be zero if the
94
+ # work estimate is unavailable.
95
+ class Progress
96
+ include ::Google::Protobuf::MessageExts
97
+ extend ::Google::Protobuf::MessageExts::ClassMethods
98
+ end
99
+
100
+ # The request for
101
+ # {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#export_entities google.datastore.admin.v1.DatastoreAdmin.ExportEntities}.
102
+ # @!attribute [rw] project_id
103
+ # @return [::String]
104
+ # Required. Project ID against which to make the request.
105
+ # @!attribute [rw] labels
106
+ # @return [::Google::Protobuf::Map{::String => ::String}]
107
+ # Client-assigned labels.
108
+ # @!attribute [rw] entity_filter
109
+ # @return [::Google::Cloud::Datastore::Admin::V1::EntityFilter]
110
+ # Description of what data from the project is included in the export.
111
+ # @!attribute [rw] output_url_prefix
112
+ # @return [::String]
113
+ # Required. Location for the export metadata and data files.
114
+ #
115
+ # The full resource URL of the external storage location. Currently, only
116
+ # Google Cloud Storage is supported. So output_url_prefix should be of the
117
+ # form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
118
+ # name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
119
+ # Storage namespace path (this is not a Cloud Datastore namespace). For more
120
+ # information about Cloud Storage namespace paths, see
121
+ # [Object name
122
+ # considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
123
+ #
124
+ # The resulting files will be nested deeper than the specified URL prefix.
125
+ # The final output URL will be provided in the
126
+ # {::Google::Cloud::Datastore::Admin::V1::ExportEntitiesResponse#output_url google.datastore.admin.v1.ExportEntitiesResponse.output_url} field. That
127
+ # value should be used for subsequent ImportEntities operations.
128
+ #
129
+ # By nesting the data files deeper, the same Cloud Storage bucket can be used
130
+ # in multiple ExportEntities operations without conflict.
131
+ class ExportEntitiesRequest
132
+ include ::Google::Protobuf::MessageExts
133
+ extend ::Google::Protobuf::MessageExts::ClassMethods
134
+
135
+ # @!attribute [rw] key
136
+ # @return [::String]
137
+ # @!attribute [rw] value
138
+ # @return [::String]
139
+ class LabelsEntry
140
+ include ::Google::Protobuf::MessageExts
141
+ extend ::Google::Protobuf::MessageExts::ClassMethods
142
+ end
143
+ end
144
+
145
+ # The request for
146
+ # {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#import_entities google.datastore.admin.v1.DatastoreAdmin.ImportEntities}.
147
+ # @!attribute [rw] project_id
148
+ # @return [::String]
149
+ # Required. Project ID against which to make the request.
150
+ # @!attribute [rw] labels
151
+ # @return [::Google::Protobuf::Map{::String => ::String}]
152
+ # Client-assigned labels.
153
+ # @!attribute [rw] input_url
154
+ # @return [::String]
155
+ # Required. The full resource URL of the external storage location. Currently, only
156
+ # Google Cloud Storage is supported. So input_url should be of the form:
157
+ # `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
158
+ # `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
159
+ # an optional Cloud Storage namespace path (this is not a Cloud Datastore
160
+ # namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
161
+ # by the ExportEntities operation. For more information about Cloud Storage
162
+ # namespace paths, see
163
+ # [Object name
164
+ # considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
165
+ #
166
+ # For more information, see
167
+ # {::Google::Cloud::Datastore::Admin::V1::ExportEntitiesResponse#output_url google.datastore.admin.v1.ExportEntitiesResponse.output_url}.
168
+ # @!attribute [rw] entity_filter
169
+ # @return [::Google::Cloud::Datastore::Admin::V1::EntityFilter]
170
+ # Optionally specify which kinds/namespaces are to be imported. If provided,
171
+ # the list must be a subset of the EntityFilter used in creating the export,
172
+ # otherwise a FAILED_PRECONDITION error will be returned. If no filter is
173
+ # specified then all entities from the export are imported.
174
+ class ImportEntitiesRequest
175
+ include ::Google::Protobuf::MessageExts
176
+ extend ::Google::Protobuf::MessageExts::ClassMethods
177
+
178
+ # @!attribute [rw] key
179
+ # @return [::String]
180
+ # @!attribute [rw] value
181
+ # @return [::String]
182
+ class LabelsEntry
183
+ include ::Google::Protobuf::MessageExts
184
+ extend ::Google::Protobuf::MessageExts::ClassMethods
185
+ end
186
+ end
187
+
188
+ # The response for
189
+ # {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#export_entities google.datastore.admin.v1.DatastoreAdmin.ExportEntities}.
190
+ # @!attribute [rw] output_url
191
+ # @return [::String]
192
+ # Location of the output metadata file. This can be used to begin an import
193
+ # into Cloud Datastore (this project or another project). See
194
+ # {::Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest#input_url google.datastore.admin.v1.ImportEntitiesRequest.input_url}.
195
+ # Only present if the operation completed successfully.
196
+ class ExportEntitiesResponse
197
+ include ::Google::Protobuf::MessageExts
198
+ extend ::Google::Protobuf::MessageExts::ClassMethods
199
+ end
200
+
201
+ # Metadata for ExportEntities operations.
202
+ # @!attribute [rw] common
203
+ # @return [::Google::Cloud::Datastore::Admin::V1::CommonMetadata]
204
+ # Metadata common to all Datastore Admin operations.
205
+ # @!attribute [rw] progress_entities
206
+ # @return [::Google::Cloud::Datastore::Admin::V1::Progress]
207
+ # An estimate of the number of entities processed.
208
+ # @!attribute [rw] progress_bytes
209
+ # @return [::Google::Cloud::Datastore::Admin::V1::Progress]
210
+ # An estimate of the number of bytes processed.
211
+ # @!attribute [rw] entity_filter
212
+ # @return [::Google::Cloud::Datastore::Admin::V1::EntityFilter]
213
+ # Description of which entities are being exported.
214
+ # @!attribute [rw] output_url_prefix
215
+ # @return [::String]
216
+ # Location for the export metadata and data files. This will be the same
217
+ # value as the
218
+ # {::Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest#output_url_prefix google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix}
219
+ # field. The final output location is provided in
220
+ # {::Google::Cloud::Datastore::Admin::V1::ExportEntitiesResponse#output_url google.datastore.admin.v1.ExportEntitiesResponse.output_url}.
221
+ class ExportEntitiesMetadata
222
+ include ::Google::Protobuf::MessageExts
223
+ extend ::Google::Protobuf::MessageExts::ClassMethods
224
+ end
225
+
226
+ # Metadata for ImportEntities operations.
227
+ # @!attribute [rw] common
228
+ # @return [::Google::Cloud::Datastore::Admin::V1::CommonMetadata]
229
+ # Metadata common to all Datastore Admin operations.
230
+ # @!attribute [rw] progress_entities
231
+ # @return [::Google::Cloud::Datastore::Admin::V1::Progress]
232
+ # An estimate of the number of entities processed.
233
+ # @!attribute [rw] progress_bytes
234
+ # @return [::Google::Cloud::Datastore::Admin::V1::Progress]
235
+ # An estimate of the number of bytes processed.
236
+ # @!attribute [rw] entity_filter
237
+ # @return [::Google::Cloud::Datastore::Admin::V1::EntityFilter]
238
+ # Description of which entities are being imported.
239
+ # @!attribute [rw] input_url
240
+ # @return [::String]
241
+ # The location of the import metadata file. This will be the same value as
242
+ # the {::Google::Cloud::Datastore::Admin::V1::ExportEntitiesResponse#output_url google.datastore.admin.v1.ExportEntitiesResponse.output_url} field.
243
+ class ImportEntitiesMetadata
244
+ include ::Google::Protobuf::MessageExts
245
+ extend ::Google::Protobuf::MessageExts::ClassMethods
246
+ end
247
+
248
+ # Identifies a subset of entities in a project. This is specified as
249
+ # combinations of kinds and namespaces (either or both of which may be all, as
250
+ # described in the following examples).
251
+ # Example usage:
252
+ #
253
+ # Entire project:
254
+ # kinds=[], namespace_ids=[]
255
+ #
256
+ # Kinds Foo and Bar in all namespaces:
257
+ # kinds=['Foo', 'Bar'], namespace_ids=[]
258
+ #
259
+ # Kinds Foo and Bar only in the default namespace:
260
+ # kinds=['Foo', 'Bar'], namespace_ids=['']
261
+ #
262
+ # Kinds Foo and Bar in both the default and Baz namespaces:
263
+ # kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
264
+ #
265
+ # The entire Baz namespace:
266
+ # kinds=[], namespace_ids=['Baz']
267
+ # @!attribute [rw] kinds
268
+ # @return [::Array<::String>]
269
+ # If empty, then this represents all kinds.
270
+ # @!attribute [rw] namespace_ids
271
+ # @return [::Array<::String>]
272
+ # An empty list represents all namespaces. This is the preferred
273
+ # usage for projects that don't use namespaces.
274
+ #
275
+ # An empty string element represents the default namespace. This should be
276
+ # used if the project has data in non-default namespaces, but doesn't want to
277
+ # include them.
278
+ # Each namespace in this list must be unique.
279
+ class EntityFilter
280
+ include ::Google::Protobuf::MessageExts
281
+ extend ::Google::Protobuf::MessageExts::ClassMethods
282
+ end
283
+
284
+ # The request for {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#get_index google.datastore.admin.v1.DatastoreAdmin.GetIndex}.
285
+ # @!attribute [rw] project_id
286
+ # @return [::String]
287
+ # Project ID against which to make the request.
288
+ # @!attribute [rw] index_id
289
+ # @return [::String]
290
+ # The resource ID of the index to get.
291
+ class GetIndexRequest
292
+ include ::Google::Protobuf::MessageExts
293
+ extend ::Google::Protobuf::MessageExts::ClassMethods
294
+ end
295
+
296
+ # The request for
297
+ # {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#list_indexes google.datastore.admin.v1.DatastoreAdmin.ListIndexes}.
298
+ # @!attribute [rw] project_id
299
+ # @return [::String]
300
+ # Project ID against which to make the request.
301
+ # @!attribute [rw] filter
302
+ # @return [::String]
303
+ # @!attribute [rw] page_size
304
+ # @return [::Integer]
305
+ # The maximum number of items to return. If zero, then all results will be
306
+ # returned.
307
+ # @!attribute [rw] page_token
308
+ # @return [::String]
309
+ # The next_page_token value returned from a previous List request, if any.
310
+ class ListIndexesRequest
311
+ include ::Google::Protobuf::MessageExts
312
+ extend ::Google::Protobuf::MessageExts::ClassMethods
313
+ end
314
+
315
+ # The response for
316
+ # {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#list_indexes google.datastore.admin.v1.DatastoreAdmin.ListIndexes}.
317
+ # @!attribute [rw] indexes
318
+ # @return [::Array<::Google::Cloud::Datastore::Admin::V1::Index>]
319
+ # The indexes.
320
+ # @!attribute [rw] next_page_token
321
+ # @return [::String]
322
+ # The standard List next-page token.
323
+ class ListIndexesResponse
324
+ include ::Google::Protobuf::MessageExts
325
+ extend ::Google::Protobuf::MessageExts::ClassMethods
326
+ end
327
+
328
+ # Metadata for Index operations.
329
+ # @!attribute [rw] common
330
+ # @return [::Google::Cloud::Datastore::Admin::V1::CommonMetadata]
331
+ # Metadata common to all Datastore Admin operations.
332
+ # @!attribute [rw] progress_entities
333
+ # @return [::Google::Cloud::Datastore::Admin::V1::Progress]
334
+ # An estimate of the number of entities processed.
335
+ # @!attribute [rw] index_id
336
+ # @return [::String]
337
+ # The index resource ID that this operation is acting on.
338
+ class IndexOperationMetadata
339
+ include ::Google::Protobuf::MessageExts
340
+ extend ::Google::Protobuf::MessageExts::ClassMethods
341
+ end
342
+
343
+ # Operation types.
344
+ module OperationType
345
+ # Unspecified.
346
+ OPERATION_TYPE_UNSPECIFIED = 0
347
+
348
+ # ExportEntities.
349
+ EXPORT_ENTITIES = 1
350
+
351
+ # ImportEntities.
352
+ IMPORT_ENTITIES = 2
353
+
354
+ # CreateIndex.
355
+ CREATE_INDEX = 3
356
+
357
+ # DeleteIndex.
358
+ DELETE_INDEX = 4
359
+ end
360
+ end
361
+ end
362
+ end
363
+ end
364
+ end
@@ -0,0 +1,122 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+
20
+ module Google
21
+ module Cloud
22
+ module Datastore
23
+ module Admin
24
+ module V1
25
+ # A minimal index definition.
26
+ # @!attribute [r] project_id
27
+ # @return [::String]
28
+ # Output only. Project ID.
29
+ # @!attribute [r] index_id
30
+ # @return [::String]
31
+ # Output only. The resource ID of the index.
32
+ # @!attribute [rw] kind
33
+ # @return [::String]
34
+ # Required. The entity kind to which this index applies.
35
+ # @!attribute [rw] ancestor
36
+ # @return [::Google::Cloud::Datastore::Admin::V1::Index::AncestorMode]
37
+ # Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED.
38
+ # @!attribute [rw] properties
39
+ # @return [::Array<::Google::Cloud::Datastore::Admin::V1::Index::IndexedProperty>]
40
+ # Required. An ordered sequence of property names and their index attributes.
41
+ # @!attribute [r] state
42
+ # @return [::Google::Cloud::Datastore::Admin::V1::Index::State]
43
+ # Output only. The state of the index.
44
+ class Index
45
+ include ::Google::Protobuf::MessageExts
46
+ extend ::Google::Protobuf::MessageExts::ClassMethods
47
+
48
+ # A property of an index.
49
+ # @!attribute [rw] name
50
+ # @return [::String]
51
+ # Required. The property name to index.
52
+ # @!attribute [rw] direction
53
+ # @return [::Google::Cloud::Datastore::Admin::V1::Index::Direction]
54
+ # Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED.
55
+ class IndexedProperty
56
+ include ::Google::Protobuf::MessageExts
57
+ extend ::Google::Protobuf::MessageExts::ClassMethods
58
+ end
59
+
60
+ # For an ordered index, specifies whether each of the entity's ancestors
61
+ # will be included.
62
+ module AncestorMode
63
+ # The ancestor mode is unspecified.
64
+ ANCESTOR_MODE_UNSPECIFIED = 0
65
+
66
+ # Do not include the entity's ancestors in the index.
67
+ NONE = 1
68
+
69
+ # Include all the entity's ancestors in the index.
70
+ ALL_ANCESTORS = 2
71
+ end
72
+
73
+ # The direction determines how a property is indexed.
74
+ module Direction
75
+ # The direction is unspecified.
76
+ DIRECTION_UNSPECIFIED = 0
77
+
78
+ # The property's values are indexed so as to support sequencing in
79
+ # ascending order and also query by <, >, <=, >=, and =.
80
+ ASCENDING = 1
81
+
82
+ # The property's values are indexed so as to support sequencing in
83
+ # descending order and also query by <, >, <=, >=, and =.
84
+ DESCENDING = 2
85
+ end
86
+
87
+ # The possible set of states of an index.
88
+ module State
89
+ # The state is unspecified.
90
+ STATE_UNSPECIFIED = 0
91
+
92
+ # The index is being created, and cannot be used by queries.
93
+ # There is an active long-running operation for the index.
94
+ # The index is updated when writing an entity.
95
+ # Some index data may exist.
96
+ CREATING = 1
97
+
98
+ # The index is ready to be used.
99
+ # The index is updated when writing an entity.
100
+ # The index is fully populated from all stored entities it applies to.
101
+ READY = 2
102
+
103
+ # The index is being deleted, and cannot be used by queries.
104
+ # There is an active long-running operation for the index.
105
+ # The index is not updated when writing an entity.
106
+ # Some index data may exist.
107
+ DELETING = 3
108
+
109
+ # The index was being created or deleted, but something went wrong.
110
+ # The index cannot by used by queries.
111
+ # There is no active long-running operation for the index,
112
+ # and the most recently finished long-running operation failed.
113
+ # The index is not updated when writing an entity.
114
+ # Some index data may exist.
115
+ ERROR = 4
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end