google-cloud-datastore-admin-v1 0.1.1 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,7 @@ module Google
22
22
  module Datastore
23
23
  module Admin
24
24
  module V1
25
- VERSION = "0.1.1"
25
+ VERSION = "0.4.1"
26
26
  end
27
27
  end
28
28
  end
@@ -65,6 +65,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
65
65
  repeated :kinds, :string, 1
66
66
  repeated :namespace_ids, :string, 2
67
67
  end
68
+ add_message "google.datastore.admin.v1.CreateIndexRequest" do
69
+ optional :project_id, :string, 1
70
+ optional :index, :message, 3, "google.datastore.admin.v1.Index"
71
+ end
72
+ add_message "google.datastore.admin.v1.DeleteIndexRequest" do
73
+ optional :project_id, :string, 1
74
+ optional :index_id, :string, 3
75
+ end
68
76
  add_message "google.datastore.admin.v1.GetIndexRequest" do
69
77
  optional :project_id, :string, 1
70
78
  optional :index_id, :string, 3
@@ -108,6 +116,8 @@ module Google
108
116
  ExportEntitiesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ExportEntitiesMetadata").msgclass
109
117
  ImportEntitiesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ImportEntitiesMetadata").msgclass
110
118
  EntityFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.EntityFilter").msgclass
119
+ CreateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.CreateIndexRequest").msgclass
120
+ DeleteIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.DeleteIndexRequest").msgclass
111
121
  GetIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.GetIndexRequest").msgclass
112
122
  ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ListIndexesRequest").msgclass
113
123
  ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ListIndexesResponse").msgclass
@@ -88,7 +88,7 @@ module Google
88
88
  # but are accessed via service google.longrunning.Operations.
89
89
  class Service
90
90
 
91
- include GRPC::GenericService
91
+ include ::GRPC::GenericService
92
92
 
93
93
  self.marshal_class_method = :encode
94
94
  self.unmarshal_class_method = :decode
@@ -102,19 +102,45 @@ module Google
102
102
  # used once the associated operation is done. If an export operation is
103
103
  # cancelled before completion it may leave partial data behind in Google
104
104
  # Cloud Storage.
105
- rpc :ExportEntities, Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest, Google::Longrunning::Operation
105
+ rpc :ExportEntities, ::Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest, ::Google::Longrunning::Operation
106
106
  # Imports entities into Google Cloud Datastore. Existing entities with the
107
107
  # same key are overwritten. The import occurs in the background and its
108
108
  # progress can be monitored and managed via the Operation resource that is
109
109
  # created. If an ImportEntities operation is cancelled, it is possible
110
110
  # that a subset of the data has already been imported to Cloud Datastore.
111
- rpc :ImportEntities, Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest, Google::Longrunning::Operation
111
+ rpc :ImportEntities, ::Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest, ::Google::Longrunning::Operation
112
+ # Creates the specified index.
113
+ # A newly created index's initial state is `CREATING`. On completion of the
114
+ # returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
115
+ # If the index already exists, the call will return an `ALREADY_EXISTS`
116
+ # status.
117
+ #
118
+ # During index creation, the process could result in an error, in which
119
+ # case the index will move to the `ERROR` state. The process can be recovered
120
+ # by fixing the data that caused the error, removing the index with
121
+ # [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
122
+ # re-creating the index with [create]
123
+ # [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
124
+ #
125
+ # Indexes with a single property cannot be created.
126
+ rpc :CreateIndex, ::Google::Cloud::Datastore::Admin::V1::CreateIndexRequest, ::Google::Longrunning::Operation
127
+ # Deletes an existing index.
128
+ # An index can only be deleted if it is in a `READY` or `ERROR` state. On
129
+ # successful execution of the request, the index will be in a `DELETING`
130
+ # [state][google.datastore.admin.v1.Index.State]. And on completion of the
131
+ # returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.
132
+ #
133
+ # During index deletion, the process could result in an error, in which
134
+ # case the index will move to the `ERROR` state. The process can be recovered
135
+ # by fixing the data that caused the error, followed by calling
136
+ # [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
137
+ rpc :DeleteIndex, ::Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest, ::Google::Longrunning::Operation
112
138
  # Gets an index.
113
- rpc :GetIndex, Google::Cloud::Datastore::Admin::V1::GetIndexRequest, Google::Cloud::Datastore::Admin::V1::Index
139
+ rpc :GetIndex, ::Google::Cloud::Datastore::Admin::V1::GetIndexRequest, ::Google::Cloud::Datastore::Admin::V1::Index
114
140
  # Lists the indexes that match the specified filters. Datastore uses an
115
141
  # eventually consistent query to fetch the list of indexes and may
116
142
  # occasionally return stale results.
117
- rpc :ListIndexes, Google::Cloud::Datastore::Admin::V1::ListIndexesRequest, Google::Cloud::Datastore::Admin::V1::ListIndexesResponse
143
+ rpc :ListIndexes, ::Google::Cloud::Datastore::Admin::V1::ListIndexesRequest, ::Google::Cloud::Datastore::Admin::V1::ListIndexesResponse
118
144
  end
119
145
 
120
146
  Stub = Service.rpc_stub_class
@@ -0,0 +1,44 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/datastore/admin/v1/migration.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/datastore/admin/v1/migration.proto", :syntax => :proto3) do
8
+ add_message "google.datastore.admin.v1.MigrationStateEvent" do
9
+ optional :state, :enum, 1, "google.datastore.admin.v1.MigrationState"
10
+ end
11
+ add_message "google.datastore.admin.v1.MigrationProgressEvent" do
12
+ optional :step, :enum, 1, "google.datastore.admin.v1.MigrationStep"
13
+ end
14
+ add_enum "google.datastore.admin.v1.MigrationState" do
15
+ value :MIGRATION_STATE_UNSPECIFIED, 0
16
+ value :RUNNING, 1
17
+ value :PAUSED, 2
18
+ value :COMPLETE, 3
19
+ end
20
+ add_enum "google.datastore.admin.v1.MigrationStep" do
21
+ value :MIGRATION_STEP_UNSPECIFIED, 0
22
+ value :START, 1
23
+ value :COPY_AND_VERIFY, 2
24
+ value :REDIRECT_EVENTUALLY_CONSISTENT_READS, 3
25
+ value :REDIRECT_STRONGLY_CONSISTENT_READS, 4
26
+ value :REDIRECT_WRITES, 5
27
+ end
28
+ end
29
+ end
30
+
31
+ module Google
32
+ module Cloud
33
+ module Datastore
34
+ module Admin
35
+ module V1
36
+ MigrationStateEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStateEvent").msgclass
37
+ MigrationProgressEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationProgressEvent").msgclass
38
+ MigrationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationState").enummodule
39
+ MigrationStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStep").enummodule
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -54,6 +54,12 @@ module Google
54
54
  # This indicates that the field may be set once in a request to create a
55
55
  # resource, but may not be changed thereafter.
56
56
  IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
57
63
  end
58
64
  end
59
65
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -281,6 +281,33 @@ module Google
281
281
  extend ::Google::Protobuf::MessageExts::ClassMethods
282
282
  end
283
283
 
284
+ # The request for
285
+ # {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#create_index google.datastore.admin.v1.DatastoreAdmin.CreateIndex}.
286
+ # @!attribute [rw] project_id
287
+ # @return [::String]
288
+ # Project ID against which to make the request.
289
+ # @!attribute [rw] index
290
+ # @return [::Google::Cloud::Datastore::Admin::V1::Index]
291
+ # The index to create. The name and state fields are output only and will be
292
+ # ignored. Single property indexes cannot be created or deleted.
293
+ class CreateIndexRequest
294
+ include ::Google::Protobuf::MessageExts
295
+ extend ::Google::Protobuf::MessageExts::ClassMethods
296
+ end
297
+
298
+ # The request for
299
+ # {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#delete_index google.datastore.admin.v1.DatastoreAdmin.DeleteIndex}.
300
+ # @!attribute [rw] project_id
301
+ # @return [::String]
302
+ # Project ID against which to make the request.
303
+ # @!attribute [rw] index_id
304
+ # @return [::String]
305
+ # The resource ID of the index to delete.
306
+ class DeleteIndexRequest
307
+ include ::Google::Protobuf::MessageExts
308
+ extend ::Google::Protobuf::MessageExts::ClassMethods
309
+ end
310
+
284
311
  # The request for {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#get_index google.datastore.admin.v1.DatastoreAdmin.GetIndex}.
285
312
  # @!attribute [rw] project_id
286
313
  # @return [::String]
@@ -22,7 +22,7 @@ module Google
22
22
  module Datastore
23
23
  module Admin
24
24
  module V1
25
- # A minimal index definition.
25
+ # Datastore composite index definition.
26
26
  # @!attribute [r] project_id
27
27
  # @return [::String]
28
28
  # Output only. Project ID.
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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
+ # An event signifying a change in state of a [migration from Cloud Datastore to
26
+ # Cloud Firestore in Datastore
27
+ # mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
28
+ # @!attribute [rw] state
29
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationState]
30
+ # The new state of the migration.
31
+ class MigrationStateEvent
32
+ include ::Google::Protobuf::MessageExts
33
+ extend ::Google::Protobuf::MessageExts::ClassMethods
34
+ end
35
+
36
+ # An event signifying the start of a new step in a [migration from Cloud
37
+ # Datastore to Cloud Firestore in Datastore
38
+ # mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
39
+ # @!attribute [rw] step
40
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationStep]
41
+ # The step that is starting.
42
+ #
43
+ # An event with step set to `START` indicates that the migration
44
+ # has been reverted back to the initial pre-migration state.
45
+ class MigrationProgressEvent
46
+ include ::Google::Protobuf::MessageExts
47
+ extend ::Google::Protobuf::MessageExts::ClassMethods
48
+ end
49
+
50
+ # States for a migration.
51
+ module MigrationState
52
+ # Unspecified.
53
+ MIGRATION_STATE_UNSPECIFIED = 0
54
+
55
+ # The migration is running.
56
+ RUNNING = 1
57
+
58
+ # The migration is paused.
59
+ PAUSED = 2
60
+
61
+ # The migration is complete.
62
+ COMPLETE = 3
63
+ end
64
+
65
+ # Steps in a migration.
66
+ module MigrationStep
67
+ # Unspecified.
68
+ MIGRATION_STEP_UNSPECIFIED = 0
69
+
70
+ # Start of migration.
71
+ START = 1
72
+
73
+ # Data is copied to Cloud Firestore and then verified to match the data in
74
+ # Cloud Datastore.
75
+ COPY_AND_VERIFY = 2
76
+
77
+ # Eventually-consistent reads are redirected to Cloud Firestore.
78
+ REDIRECT_EVENTUALLY_CONSISTENT_READS = 3
79
+
80
+ # Strongly-consistent reads are redirected to Cloud Firestore.
81
+ REDIRECT_STRONGLY_CONSISTENT_READS = 4
82
+
83
+ # Writes are redirected to Cloud Firestore.
84
+ REDIRECT_WRITES = 5
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
@@ -25,7 +25,7 @@ module Google
25
25
  # @return [::String]
26
26
  # The server-assigned name, which is only unique within the same service that
27
27
  # originally returns it. If you use the default HTTP mapping, the
28
- # `name` should have the format of `operations/some/unique/name`.
28
+ # `name` should be a resource name ending with `operations/{unique_id}`.
29
29
  # @!attribute [rw] metadata
30
30
  # @return [::Google::Protobuf::Any]
31
31
  # Service-specific metadata associated with the operation. It typically
@@ -35,7 +35,7 @@ module Google
35
35
  # @!attribute [rw] done
36
36
  # @return [::Boolean]
37
37
  # If the value is `false`, it means the operation is still in progress.
38
- # If true, the operation is completed, and either `error` or `response` is
38
+ # If `true`, the operation is completed, and either `error` or `response` is
39
39
  # available.
40
40
  # @!attribute [rw] error
41
41
  # @return [::Google::Rpc::Status]
@@ -67,7 +67,7 @@ module Google
67
67
  # The request message for Operations.ListOperations.
68
68
  # @!attribute [rw] name
69
69
  # @return [::String]
70
- # The name of the operation collection.
70
+ # The name of the operation's parent resource.
71
71
  # @!attribute [rw] filter
72
72
  # @return [::String]
73
73
  # The standard list filter.
@@ -112,6 +112,20 @@ module Google
112
112
  extend ::Google::Protobuf::MessageExts::ClassMethods
113
113
  end
114
114
 
115
+ # The request message for Operations.WaitOperation.
116
+ # @!attribute [rw] name
117
+ # @return [::String]
118
+ # The name of the operation resource to wait on.
119
+ # @!attribute [rw] timeout
120
+ # @return [::Google::Protobuf::Duration]
121
+ # The maximum duration to wait before timing out. If left blank, the wait
122
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
123
+ # If RPC context deadline is also specified, the shorter one will be used.
124
+ class WaitOperationRequest
125
+ include ::Google::Protobuf::MessageExts
126
+ extend ::Google::Protobuf::MessageExts::ClassMethods
127
+ end
128
+
115
129
  # A message representing the message types used by a long-running operation.
116
130
  #
117
131
  # Example:
@@ -57,10 +57,13 @@ module Google
57
57
  # Example 4: Pack and unpack a message in Go
58
58
  #
59
59
  # foo := &pb.Foo{...}
60
- # any, err := ptypes.MarshalAny(foo)
60
+ # any, err := anypb.New(foo)
61
+ # if err != nil {
62
+ # ...
63
+ # }
61
64
  # ...
62
65
  # foo := &pb.Foo{}
63
- # if err := ptypes.UnmarshalAny(any, foo); err != nil {
66
+ # if err := any.UnmarshalTo(foo); err != nil {
64
67
  # ...
65
68
  # }
66
69
  #