google-cloud-spanner-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-spanner-v1.rb +21 -0
  7. data/lib/google/cloud/spanner/v1.rb +35 -0
  8. data/lib/google/cloud/spanner/v1/spanner.rb +52 -0
  9. data/lib/google/cloud/spanner/v1/spanner/client.rb +1947 -0
  10. data/lib/google/cloud/spanner/v1/spanner/credentials.rb +52 -0
  11. data/lib/google/cloud/spanner/v1/spanner/paths.rb +73 -0
  12. data/lib/google/cloud/spanner/v1/version.rb +28 -0
  13. data/lib/google/spanner/v1/keys_pb.rb +37 -0
  14. data/lib/google/spanner/v1/mutation_pb.rb +42 -0
  15. data/lib/google/spanner/v1/query_plan_pb.rb +51 -0
  16. data/lib/google/spanner/v1/result_set_pb.rb +51 -0
  17. data/lib/google/spanner/v1/spanner_pb.rb +182 -0
  18. data/lib/google/spanner/v1/spanner_services_pb.rb +180 -0
  19. data/lib/google/spanner/v1/transaction_pb.rb +59 -0
  20. data/lib/google/spanner/v1/type_pb.rb +47 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/field_behavior.rb +59 -0
  23. data/proto_docs/google/api/resource.rb +247 -0
  24. data/proto_docs/google/protobuf/any.rb +138 -0
  25. data/proto_docs/google/protobuf/duration.rb +98 -0
  26. data/proto_docs/google/protobuf/empty.rb +36 -0
  27. data/proto_docs/google/protobuf/struct.rb +96 -0
  28. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  29. data/proto_docs/google/rpc/status.rb +46 -0
  30. data/proto_docs/google/spanner/v1/keys.rb +162 -0
  31. data/proto_docs/google/spanner/v1/mutation.rb +110 -0
  32. data/proto_docs/google/spanner/v1/query_plan.rb +148 -0
  33. data/proto_docs/google/spanner/v1/result_set.rb +208 -0
  34. data/proto_docs/google/spanner/v1/spanner.rb +681 -0
  35. data/proto_docs/google/spanner/v1/transaction.rb +457 -0
  36. data/proto_docs/google/spanner/v1/type.rb +127 -0
  37. metadata +218 -0
@@ -0,0 +1,180 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/spanner/v1/spanner.proto for package 'Google.Cloud.Spanner.V1'
3
+ # Original file comments:
4
+ # Copyright 2020 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/spanner/v1/spanner_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Spanner
25
+ module V1
26
+ module Spanner
27
+ # Cloud Spanner API
28
+ #
29
+ # The Cloud Spanner API can be used to manage sessions and execute
30
+ # transactions on data stored in Cloud Spanner databases.
31
+ class Service
32
+
33
+ include GRPC::GenericService
34
+
35
+ self.marshal_class_method = :encode
36
+ self.unmarshal_class_method = :decode
37
+ self.service_name = 'google.spanner.v1.Spanner'
38
+
39
+ # Creates a new session. A session can be used to perform
40
+ # transactions that read and/or modify data in a Cloud Spanner database.
41
+ # Sessions are meant to be reused for many consecutive
42
+ # transactions.
43
+ #
44
+ # Sessions can only execute one transaction at a time. To execute
45
+ # multiple concurrent read-write/write-only transactions, create
46
+ # multiple sessions. Note that standalone reads and queries use a
47
+ # transaction internally, and count toward the one transaction
48
+ # limit.
49
+ #
50
+ # Active sessions use additional server resources, so it is a good idea to
51
+ # delete idle and unneeded sessions.
52
+ # Aside from explicit deletes, Cloud Spanner may delete sessions for which no
53
+ # operations are sent for more than an hour. If a session is deleted,
54
+ # requests to it return `NOT_FOUND`.
55
+ #
56
+ # Idle sessions can be kept alive by sending a trivial SQL query
57
+ # periodically, e.g., `"SELECT 1"`.
58
+ rpc :CreateSession, Google::Cloud::Spanner::V1::CreateSessionRequest, Google::Cloud::Spanner::V1::Session
59
+ # Creates multiple new sessions.
60
+ #
61
+ # This API can be used to initialize a session cache on the clients.
62
+ # See https://goo.gl/TgSFN2 for best practices on session cache management.
63
+ rpc :BatchCreateSessions, Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, Google::Cloud::Spanner::V1::BatchCreateSessionsResponse
64
+ # Gets a session. Returns `NOT_FOUND` if the session does not exist.
65
+ # This is mainly useful for determining whether a session is still
66
+ # alive.
67
+ rpc :GetSession, Google::Cloud::Spanner::V1::GetSessionRequest, Google::Cloud::Spanner::V1::Session
68
+ # Lists all sessions in a given database.
69
+ rpc :ListSessions, Google::Cloud::Spanner::V1::ListSessionsRequest, Google::Cloud::Spanner::V1::ListSessionsResponse
70
+ # Ends a session, releasing server resources associated with it. This will
71
+ # asynchronously trigger cancellation of any operations that are running with
72
+ # this session.
73
+ rpc :DeleteSession, Google::Cloud::Spanner::V1::DeleteSessionRequest, Google::Protobuf::Empty
74
+ # Executes an SQL statement, returning all results in a single reply. This
75
+ # method cannot be used to return a result set larger than 10 MiB;
76
+ # if the query yields more data than that, the query fails with
77
+ # a `FAILED_PRECONDITION` error.
78
+ #
79
+ # Operations inside read-write transactions might return `ABORTED`. If
80
+ # this occurs, the application should restart the transaction from
81
+ # the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
82
+ #
83
+ # Larger result sets can be fetched in streaming fashion by calling
84
+ # [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead.
85
+ rpc :ExecuteSql, Google::Cloud::Spanner::V1::ExecuteSqlRequest, Google::Cloud::Spanner::V1::ResultSet
86
+ # Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result
87
+ # set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there
88
+ # is no limit on the size of the returned result set. However, no
89
+ # individual row in the result set can exceed 100 MiB, and no
90
+ # column value can exceed 10 MiB.
91
+ rpc :ExecuteStreamingSql, Google::Cloud::Spanner::V1::ExecuteSqlRequest, stream(Google::Cloud::Spanner::V1::PartialResultSet)
92
+ # Executes a batch of SQL DML statements. This method allows many statements
93
+ # to be run with lower latency than submitting them sequentially with
94
+ # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
95
+ #
96
+ # Statements are executed in sequential order. A request can succeed even if
97
+ # a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the
98
+ # response provides information about the statement that failed. Clients must
99
+ # inspect this field to determine whether an error occurred.
100
+ #
101
+ # Execution stops after the first failed statement; the remaining statements
102
+ # are not executed.
103
+ rpc :ExecuteBatchDml, Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse
104
+ # Reads rows from the database using key lookups and scans, as a
105
+ # simple key/value style alternative to
106
+ # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to
107
+ # return a result set larger than 10 MiB; if the read matches more
108
+ # data than that, the read fails with a `FAILED_PRECONDITION`
109
+ # error.
110
+ #
111
+ # Reads inside read-write transactions might return `ABORTED`. If
112
+ # this occurs, the application should restart the transaction from
113
+ # the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
114
+ #
115
+ # Larger result sets can be yielded in streaming fashion by calling
116
+ # [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
117
+ rpc :Read, Google::Cloud::Spanner::V1::ReadRequest, Google::Cloud::Spanner::V1::ResultSet
118
+ # Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a
119
+ # stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the
120
+ # size of the returned result set. However, no individual row in
121
+ # the result set can exceed 100 MiB, and no column value can exceed
122
+ # 10 MiB.
123
+ rpc :StreamingRead, Google::Cloud::Spanner::V1::ReadRequest, stream(Google::Cloud::Spanner::V1::PartialResultSet)
124
+ # Begins a new transaction. This step can often be skipped:
125
+ # [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
126
+ # [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a
127
+ # side-effect.
128
+ rpc :BeginTransaction, Google::Cloud::Spanner::V1::BeginTransactionRequest, Google::Cloud::Spanner::V1::Transaction
129
+ # Commits a transaction. The request includes the mutations to be
130
+ # applied to rows in the database.
131
+ #
132
+ # `Commit` might return an `ABORTED` error. This can occur at any time;
133
+ # commonly, the cause is conflicts with concurrent
134
+ # transactions. However, it can also happen for a variety of other
135
+ # reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
136
+ # the transaction from the beginning, re-using the same session.
137
+ rpc :Commit, Google::Cloud::Spanner::V1::CommitRequest, Google::Cloud::Spanner::V1::CommitResponse
138
+ # Rolls back a transaction, releasing any locks it holds. It is a good
139
+ # idea to call this for any transaction that includes one or more
140
+ # [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and
141
+ # ultimately decides not to commit.
142
+ #
143
+ # `Rollback` returns `OK` if it successfully aborts the transaction, the
144
+ # transaction was already aborted, or the transaction is not
145
+ # found. `Rollback` never returns `ABORTED`.
146
+ rpc :Rollback, Google::Cloud::Spanner::V1::RollbackRequest, Google::Protobuf::Empty
147
+ # Creates a set of partition tokens that can be used to execute a query
148
+ # operation in parallel. Each of the returned partition tokens can be used
149
+ # by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset
150
+ # of the query result to read. The same session and read-only transaction
151
+ # must be used by the PartitionQueryRequest used to create the
152
+ # partition tokens and the ExecuteSqlRequests that use the partition tokens.
153
+ #
154
+ # Partition tokens become invalid when the session used to create them
155
+ # is deleted, is idle for too long, begins a new transaction, or becomes too
156
+ # old. When any of these happen, it is not possible to resume the query, and
157
+ # the whole operation must be restarted from the beginning.
158
+ rpc :PartitionQuery, Google::Cloud::Spanner::V1::PartitionQueryRequest, Google::Cloud::Spanner::V1::PartitionResponse
159
+ # Creates a set of partition tokens that can be used to execute a read
160
+ # operation in parallel. Each of the returned partition tokens can be used
161
+ # by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read
162
+ # result to read. The same session and read-only transaction must be used by
163
+ # the PartitionReadRequest used to create the partition tokens and the
164
+ # ReadRequests that use the partition tokens. There are no ordering
165
+ # guarantees on rows returned among the returned partition tokens, or even
166
+ # within each individual StreamingRead call issued with a partition_token.
167
+ #
168
+ # Partition tokens become invalid when the session used to create them
169
+ # is deleted, is idle for too long, begins a new transaction, or becomes too
170
+ # old. When any of these happen, it is not possible to resume the read, and
171
+ # the whole operation must be restarted from the beginning.
172
+ rpc :PartitionRead, Google::Cloud::Spanner::V1::PartitionReadRequest, Google::Cloud::Spanner::V1::PartitionResponse
173
+ end
174
+
175
+ Stub = Service.rpc_stub_class
176
+ end
177
+ end
178
+ end
179
+ end
180
+ end
@@ -0,0 +1,59 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/spanner/v1/transaction.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/protobuf/duration_pb'
7
+ require 'google/protobuf/timestamp_pb'
8
+ require 'google/api/annotations_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_file("google/spanner/v1/transaction.proto", :syntax => :proto3) do
11
+ add_message "google.spanner.v1.TransactionOptions" do
12
+ oneof :mode do
13
+ optional :read_write, :message, 1, "google.spanner.v1.TransactionOptions.ReadWrite"
14
+ optional :partitioned_dml, :message, 3, "google.spanner.v1.TransactionOptions.PartitionedDml"
15
+ optional :read_only, :message, 2, "google.spanner.v1.TransactionOptions.ReadOnly"
16
+ end
17
+ end
18
+ add_message "google.spanner.v1.TransactionOptions.ReadWrite" do
19
+ end
20
+ add_message "google.spanner.v1.TransactionOptions.PartitionedDml" do
21
+ end
22
+ add_message "google.spanner.v1.TransactionOptions.ReadOnly" do
23
+ optional :return_read_timestamp, :bool, 6
24
+ oneof :timestamp_bound do
25
+ optional :strong, :bool, 1
26
+ optional :min_read_timestamp, :message, 2, "google.protobuf.Timestamp"
27
+ optional :max_staleness, :message, 3, "google.protobuf.Duration"
28
+ optional :read_timestamp, :message, 4, "google.protobuf.Timestamp"
29
+ optional :exact_staleness, :message, 5, "google.protobuf.Duration"
30
+ end
31
+ end
32
+ add_message "google.spanner.v1.Transaction" do
33
+ optional :id, :bytes, 1
34
+ optional :read_timestamp, :message, 2, "google.protobuf.Timestamp"
35
+ end
36
+ add_message "google.spanner.v1.TransactionSelector" do
37
+ oneof :selector do
38
+ optional :single_use, :message, 1, "google.spanner.v1.TransactionOptions"
39
+ optional :id, :bytes, 2
40
+ optional :begin, :message, 3, "google.spanner.v1.TransactionOptions"
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ module Google
47
+ module Cloud
48
+ module Spanner
49
+ module V1
50
+ TransactionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TransactionOptions").msgclass
51
+ TransactionOptions::ReadWrite = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TransactionOptions.ReadWrite").msgclass
52
+ TransactionOptions::PartitionedDml = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TransactionOptions.PartitionedDml").msgclass
53
+ TransactionOptions::ReadOnly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TransactionOptions.ReadOnly").msgclass
54
+ Transaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Transaction").msgclass
55
+ TransactionSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TransactionSelector").msgclass
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,47 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/spanner/v1/type.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_file("google/spanner/v1/type.proto", :syntax => :proto3) do
9
+ add_message "google.spanner.v1.Type" do
10
+ optional :code, :enum, 1, "google.spanner.v1.TypeCode"
11
+ optional :array_element_type, :message, 2, "google.spanner.v1.Type"
12
+ optional :struct_type, :message, 3, "google.spanner.v1.StructType"
13
+ end
14
+ add_message "google.spanner.v1.StructType" do
15
+ repeated :fields, :message, 1, "google.spanner.v1.StructType.Field"
16
+ end
17
+ add_message "google.spanner.v1.StructType.Field" do
18
+ optional :name, :string, 1
19
+ optional :type, :message, 2, "google.spanner.v1.Type"
20
+ end
21
+ add_enum "google.spanner.v1.TypeCode" do
22
+ value :TYPE_CODE_UNSPECIFIED, 0
23
+ value :BOOL, 1
24
+ value :INT64, 2
25
+ value :FLOAT64, 3
26
+ value :TIMESTAMP, 4
27
+ value :DATE, 5
28
+ value :STRING, 6
29
+ value :BYTES, 7
30
+ value :ARRAY, 8
31
+ value :STRUCT, 9
32
+ end
33
+ end
34
+ end
35
+
36
+ module Google
37
+ module Cloud
38
+ module Spanner
39
+ module V1
40
+ Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Type").msgclass
41
+ StructType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType").msgclass
42
+ StructType::Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType.Field").msgclass
43
+ TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeCode").enummodule
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,4 @@
1
+ # Cloud Spanner V1 Protocol Buffer Documentation
2
+
3
+ These files are for the YARD documentation of the generated protobuf files.
4
+ They are not intended to be required or loaded at runtime.
@@ -0,0 +1,59 @@
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 Api
22
+ # An indicator of the behavior of a given field (for example, that a field
23
+ # is required in requests, or given as output but ignored as input).
24
+ # This **does not** change the behavior in protocol buffers itself; it only
25
+ # denotes the behavior and may affect how API tooling handles the field.
26
+ #
27
+ # Note: This enum **may** receive new values in the future.
28
+ module FieldBehavior
29
+ # Conventional default for enums. Do not use this.
30
+ FIELD_BEHAVIOR_UNSPECIFIED = 0
31
+
32
+ # Specifically denotes a field as optional.
33
+ # While all fields in protocol buffers are optional, this may be specified
34
+ # for emphasis if appropriate.
35
+ OPTIONAL = 1
36
+
37
+ # Denotes a field as required.
38
+ # This indicates that the field **must** be provided as part of the request,
39
+ # and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
40
+ REQUIRED = 2
41
+
42
+ # Denotes a field as output only.
43
+ # This indicates that the field is provided in responses, but including the
44
+ # field in a request does nothing (the server *must* ignore it and
45
+ # *must not* throw an error as a result of the field's presence).
46
+ OUTPUT_ONLY = 3
47
+
48
+ # Denotes a field as input only.
49
+ # This indicates that the field is provided in requests, and the
50
+ # corresponding field is not included in output.
51
+ INPUT_ONLY = 4
52
+
53
+ # Denotes a field as immutable.
54
+ # This indicates that the field may be set once in a request to create a
55
+ # resource, but may not be changed thereafter.
56
+ IMMUTABLE = 5
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,247 @@
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 Api
22
+ # A simple descriptor of a resource type.
23
+ #
24
+ # ResourceDescriptor annotates a resource message (either by means of a
25
+ # protobuf annotation or use in the service config), and associates the
26
+ # resource's schema, the resource type, and the pattern of the resource name.
27
+ #
28
+ # Example:
29
+ #
30
+ # message Topic {
31
+ # // Indicates this message defines a resource schema.
32
+ # // Declares the resource type in the format of {service}/{kind}.
33
+ # // For Kubernetes resources, the format is {api group}/{kind}.
34
+ # option (google.api.resource) = {
35
+ # type: "pubsub.googleapis.com/Topic"
36
+ # name_descriptor: {
37
+ # pattern: "projects/{project}/topics/{topic}"
38
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
+ # parent_name_extractor: "projects/{project}"
40
+ # }
41
+ # };
42
+ # }
43
+ #
44
+ # The ResourceDescriptor Yaml config will look like:
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}"
52
+ #
53
+ # Sometimes, resources have multiple patterns, typically because they can
54
+ # live under multiple parents.
55
+ #
56
+ # Example:
57
+ #
58
+ # message LogEntry {
59
+ # option (google.api.resource) = {
60
+ # type: "logging.googleapis.com/LogEntry"
61
+ # name_descriptor: {
62
+ # pattern: "projects/{project}/logs/{log}"
63
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
+ # parent_name_extractor: "projects/{project}"
65
+ # }
66
+ # name_descriptor: {
67
+ # pattern: "folders/{folder}/logs/{log}"
68
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
+ # parent_name_extractor: "folders/{folder}"
70
+ # }
71
+ # name_descriptor: {
72
+ # pattern: "organizations/{organization}/logs/{log}"
73
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
+ # parent_name_extractor: "organizations/{organization}"
75
+ # }
76
+ # name_descriptor: {
77
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
+ # parent_type: "billing.googleapis.com/BillingAccount"
79
+ # parent_name_extractor: "billingAccounts/{billing_account}"
80
+ # }
81
+ # };
82
+ # }
83
+ #
84
+ # The ResourceDescriptor Yaml config will look like:
85
+ #
86
+ # resources:
87
+ # - type: 'logging.googleapis.com/LogEntry'
88
+ # name_descriptor:
89
+ # - pattern: "projects/{project}/logs/{log}"
90
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
+ # parent_name_extractor: "projects/{project}"
92
+ # - pattern: "folders/{folder}/logs/{log}"
93
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
+ # parent_name_extractor: "folders/{folder}"
95
+ # - pattern: "organizations/{organization}/logs/{log}"
96
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
+ # parent_name_extractor: "organizations/{organization}"
98
+ # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
+ # parent_type: "billing.googleapis.com/BillingAccount"
100
+ # parent_name_extractor: "billingAccounts/{billing_account}"
101
+ #
102
+ # For flexible resources, the resource name doesn't contain parent names, but
103
+ # the resource itself has parents for policy evaluation.
104
+ #
105
+ # Example:
106
+ #
107
+ # message Shelf {
108
+ # option (google.api.resource) = {
109
+ # type: "library.googleapis.com/Shelf"
110
+ # name_descriptor: {
111
+ # pattern: "shelves/{shelf}"
112
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
+ # }
114
+ # name_descriptor: {
115
+ # pattern: "shelves/{shelf}"
116
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
+ # }
118
+ # };
119
+ # }
120
+ #
121
+ # The ResourceDescriptor Yaml config will look like:
122
+ #
123
+ # resources:
124
+ # - type: 'library.googleapis.com/Shelf'
125
+ # name_descriptor:
126
+ # - pattern: "shelves/{shelf}"
127
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
+ # - pattern: "shelves/{shelf}"
129
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
130
+ # @!attribute [rw] type
131
+ # @return [::String]
132
+ # The resource type. It must be in the format of
133
+ # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be
134
+ # singular and must not include version numbers.
135
+ #
136
+ # Example: `storage.googleapis.com/Bucket`
137
+ #
138
+ # The value of the resource_type_kind must follow the regular expression
139
+ # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
140
+ # should use PascalCase (UpperCamelCase). The maximum number of
141
+ # characters allowed for the `resource_type_kind` is 100.
142
+ # @!attribute [rw] pattern
143
+ # @return [::Array<::String>]
144
+ # Optional. The relative resource name pattern associated with this resource
145
+ # type. The DNS prefix of the full resource name shouldn't be specified here.
146
+ #
147
+ # The path pattern must follow the syntax, which aligns with HTTP binding
148
+ # syntax:
149
+ #
150
+ # Template = Segment { "/" Segment } ;
151
+ # Segment = LITERAL | Variable ;
152
+ # Variable = "{" LITERAL "}" ;
153
+ #
154
+ # Examples:
155
+ #
156
+ # - "projects/\\{project}/topics/\\{topic}"
157
+ # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}"
158
+ #
159
+ # The components in braces correspond to the IDs for each resource in the
160
+ # hierarchy. It is expected that, if multiple patterns are provided,
161
+ # the same component name (e.g. "project") refers to IDs of the same
162
+ # type of resource.
163
+ # @!attribute [rw] name_field
164
+ # @return [::String]
165
+ # Optional. The field on the resource that designates the resource name
166
+ # field. If omitted, this is assumed to be "name".
167
+ # @!attribute [rw] history
168
+ # @return [::Google::Api::ResourceDescriptor::History]
169
+ # Optional. The historical or future-looking state of the resource pattern.
170
+ #
171
+ # Example:
172
+ #
173
+ # // The InspectTemplate message originally only supported resource
174
+ # // names with organization, and project was added later.
175
+ # message InspectTemplate {
176
+ # option (google.api.resource) = {
177
+ # type: "dlp.googleapis.com/InspectTemplate"
178
+ # pattern:
179
+ # "organizations/{organization}/inspectTemplates/{inspect_template}"
180
+ # pattern: "projects/{project}/inspectTemplates/{inspect_template}"
181
+ # history: ORIGINALLY_SINGLE_PATTERN
182
+ # };
183
+ # }
184
+ # @!attribute [rw] plural
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
189
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
190
+ # @!attribute [rw] singular
191
+ # @return [::String]
192
+ # The same concept of the `singular` field in k8s CRD spec
193
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
+ # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
195
+ class ResourceDescriptor
196
+ include ::Google::Protobuf::MessageExts
197
+ extend ::Google::Protobuf::MessageExts::ClassMethods
198
+
199
+ # A description of the historical or future-looking state of the
200
+ # resource pattern.
201
+ module History
202
+ # The "unset" value.
203
+ HISTORY_UNSPECIFIED = 0
204
+
205
+ # The resource originally had one pattern and launched as such, and
206
+ # additional patterns were added later.
207
+ ORIGINALLY_SINGLE_PATTERN = 1
208
+
209
+ # The resource has one pattern, but the API owner expects to add more
210
+ # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
211
+ # that from being necessary once there are multiple patterns.)
212
+ FUTURE_MULTI_PATTERN = 2
213
+ end
214
+ end
215
+
216
+ # Defines a proto annotation that describes a string field that refers to
217
+ # an API resource.
218
+ # @!attribute [rw] type
219
+ # @return [::String]
220
+ # The resource type that the annotated field references.
221
+ #
222
+ # Example:
223
+ #
224
+ # message Subscription {
225
+ # string topic = 2 [(google.api.resource_reference) = {
226
+ # type: "pubsub.googleapis.com/Topic"
227
+ # }];
228
+ # }
229
+ # @!attribute [rw] child_type
230
+ # @return [::String]
231
+ # The resource type of a child collection that the annotated field
232
+ # references. This is useful for annotating the `parent` field that
233
+ # doesn't have a fixed resource type.
234
+ #
235
+ # Example:
236
+ #
237
+ # message ListLogEntriesRequest {
238
+ # string parent = 1 [(google.api.resource_reference) = {
239
+ # child_type: "logging.googleapis.com/LogEntry"
240
+ # };
241
+ # }
242
+ class ResourceReference
243
+ include ::Google::Protobuf::MessageExts
244
+ extend ::Google::Protobuf::MessageExts::ClassMethods
245
+ end
246
+ end
247
+ end