google-cloud-universal_ledger-v1 0.a → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +151 -8
- data/lib/google/cloud/universal_ledger/v1/rest.rb +37 -0
- data/lib/google/cloud/universal_ledger/v1/universal_ledger/client.rb +1163 -0
- data/lib/google/cloud/universal_ledger/v1/universal_ledger/credentials.rb +47 -0
- data/lib/google/cloud/universal_ledger/v1/universal_ledger/paths.rb +69 -0
- data/lib/google/cloud/universal_ledger/v1/universal_ledger/rest/client.rb +1067 -0
- data/lib/google/cloud/universal_ledger/v1/universal_ledger/rest/service_stub.rb +511 -0
- data/lib/google/cloud/universal_ledger/v1/universal_ledger/rest.rb +59 -0
- data/lib/google/cloud/universal_ledger/v1/universal_ledger.rb +62 -0
- data/lib/google/cloud/universal_ledger/v1/version.rb +7 -2
- data/lib/google/cloud/universal_ledger/v1.rb +45 -0
- data/lib/google/cloud/universalledger/v1/accounts_pb.rb +23 -0
- data/lib/google/cloud/universalledger/v1/common_pb.rb +36 -0
- data/lib/google/cloud/universalledger/v1/query_pb.rb +39 -0
- data/lib/google/cloud/universalledger/v1/status_event_pb.rb +27 -0
- data/lib/google/cloud/universalledger/v1/transactions_pb.rb +52 -0
- data/lib/google/cloud/universalledger/v1/types_pb.rb +47 -0
- data/lib/google/cloud/universalledger/v1/universalledger_pb.rb +41 -0
- data/lib/google/cloud/universalledger/v1/universalledger_services_pb.rb +89 -0
- data/lib/google-cloud-universal_ledger-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +593 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +227 -0
- data/proto_docs/google/cloud/universalledger/v1/accounts.rb +75 -0
- data/proto_docs/google/cloud/universalledger/v1/common.rb +272 -0
- data/proto_docs/google/cloud/universalledger/v1/query.rb +314 -0
- data/proto_docs/google/cloud/universalledger/v1/status_event.rb +88 -0
- data/proto_docs/google/cloud/universalledger/v1/transactions.rb +716 -0
- data/proto_docs/google/cloud/universalledger/v1/types.rb +618 -0
- data/proto_docs/google/cloud/universalledger/v1/universalledger.rb +237 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +128 -0
- data/proto_docs/google/rpc/code.rb +185 -0
- metadata +86 -9
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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 UniversalLedger
|
|
23
|
+
module V1
|
|
24
|
+
# Represents a Universal Ledger endpoint.
|
|
25
|
+
# @!attribute [rw] name
|
|
26
|
+
# @return [::String]
|
|
27
|
+
# Identifier. The resource name of the endpoint.
|
|
28
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
|
29
|
+
class Endpoint
|
|
30
|
+
include ::Google::Protobuf::MessageExts
|
|
31
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Request message for ListEndpoints.
|
|
35
|
+
# @!attribute [rw] parent
|
|
36
|
+
# @return [::String]
|
|
37
|
+
# Required. The parent, which owns this collection of endpoints.
|
|
38
|
+
# Format: `projects/{project}/locations/{location}`
|
|
39
|
+
# @!attribute [rw] page_size
|
|
40
|
+
# @return [::Integer]
|
|
41
|
+
# Optional. The maximum number of endpoints to return. The service may return
|
|
42
|
+
# fewer than this value. If unspecified, at most 50 endpoints will be
|
|
43
|
+
# returned. The maximum value is 1000; values above 1000 will be coerced to
|
|
44
|
+
# 1000.
|
|
45
|
+
# @!attribute [rw] page_token
|
|
46
|
+
# @return [::String]
|
|
47
|
+
# Optional. A page token, received from a previous `ListEndpoints` call.
|
|
48
|
+
# Provide this to retrieve the subsequent page.
|
|
49
|
+
class ListEndpointsRequest
|
|
50
|
+
include ::Google::Protobuf::MessageExts
|
|
51
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Response message for ListEndpoints.
|
|
55
|
+
# @!attribute [rw] endpoints
|
|
56
|
+
# @return [::Array<::Google::Cloud::UniversalLedger::V1::Endpoint>]
|
|
57
|
+
# The endpoints for the given project and location.
|
|
58
|
+
# @!attribute [rw] next_page_token
|
|
59
|
+
# @return [::String]
|
|
60
|
+
# A token, which can be sent as `page_token` to retrieve the next page.
|
|
61
|
+
# If this field is omitted, there are no subsequent pages.
|
|
62
|
+
class ListEndpointsResponse
|
|
63
|
+
include ::Google::Protobuf::MessageExts
|
|
64
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Request message for GetEndpoint.
|
|
68
|
+
# @!attribute [rw] name
|
|
69
|
+
# @return [::String]
|
|
70
|
+
# Required. The name of the endpoint to retrieve.
|
|
71
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
|
72
|
+
class GetEndpointRequest
|
|
73
|
+
include ::Google::Protobuf::MessageExts
|
|
74
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Request message for QueryAccount.
|
|
78
|
+
# @!attribute [rw] endpoint
|
|
79
|
+
# @return [::String]
|
|
80
|
+
# Required. The endpoint to serve the request.
|
|
81
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
|
82
|
+
# The location is a region.
|
|
83
|
+
# @!attribute [rw] account_id
|
|
84
|
+
# @return [::String]
|
|
85
|
+
# Required. The account ID to get information about. The value is limited to
|
|
86
|
+
# 60 characters.
|
|
87
|
+
# @!attribute [rw] round_id
|
|
88
|
+
# @return [::Integer]
|
|
89
|
+
# Optional. The ID of the execution round (similar to block "height") at
|
|
90
|
+
# which to request data. The returned account information will be accurate
|
|
91
|
+
# for the world state at this execution round. If unspecified, uses the
|
|
92
|
+
# latest finalized round as known by the serving validator. The state at a
|
|
93
|
+
# given round ID is always consistent and canonical.
|
|
94
|
+
class QueryAccountRequest
|
|
95
|
+
include ::Google::Protobuf::MessageExts
|
|
96
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Response message for QueryAccount.
|
|
100
|
+
# @!attribute [rw] account
|
|
101
|
+
# @return [::Google::Cloud::UniversalLedger::V1::Account]
|
|
102
|
+
# The account information, along with the height at which it was obtained.
|
|
103
|
+
class QueryAccountResponse
|
|
104
|
+
include ::Google::Protobuf::MessageExts
|
|
105
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Request message for SubmitTransaction.
|
|
109
|
+
# @!attribute [rw] endpoint
|
|
110
|
+
# @return [::String]
|
|
111
|
+
# Required. The endpoint to submit the transaction to.
|
|
112
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
|
113
|
+
# The location is a region.
|
|
114
|
+
# @!attribute [rw] serialized_signed_transaction
|
|
115
|
+
# @return [::String]
|
|
116
|
+
# Required. A protobuf serialized
|
|
117
|
+
# {::Google::Cloud::UniversalLedger::V1::SignedTransaction SignedTransaction} to
|
|
118
|
+
# submit to the ledger. Using a serialized format ensures that all validators
|
|
119
|
+
# compute the same transaction ID as the SHA-256 digest of the serialized
|
|
120
|
+
# bytes.
|
|
121
|
+
class SubmitTransactionRequest
|
|
122
|
+
include ::Google::Protobuf::MessageExts
|
|
123
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Response message for SubmitTransaction.
|
|
127
|
+
# @!attribute [rw] transaction_digest_hex
|
|
128
|
+
# @return [::String]
|
|
129
|
+
# Identifier that uniquely represents the submitted transaction.
|
|
130
|
+
# It is the hexadecimal representation of the SHA-256 digest of the
|
|
131
|
+
# `serialized_signed_transaction`.
|
|
132
|
+
# This transaction ID is provided so that a client can track the transaction
|
|
133
|
+
# without needing to implement the hashing logic itself.
|
|
134
|
+
# The identifier can be directly used in subsequent API calls, for example to
|
|
135
|
+
# query the transaction state.
|
|
136
|
+
class SubmitTransactionResponse
|
|
137
|
+
include ::Google::Protobuf::MessageExts
|
|
138
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Request message for SubmitOperationalTransaction.
|
|
142
|
+
# @!attribute [rw] endpoint
|
|
143
|
+
# @return [::String]
|
|
144
|
+
# Required. The endpoint to serve the request.
|
|
145
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
|
146
|
+
# The location is a region.
|
|
147
|
+
# @!attribute [rw] serialized_signed_operational_transaction
|
|
148
|
+
# @return [::String]
|
|
149
|
+
# Required. A protobuf serialized
|
|
150
|
+
# {::Google::Cloud::UniversalLedger::V1::SignedTransaction SignedTransaction} to
|
|
151
|
+
# submit to the ledger. The enclosed client transaction must be an
|
|
152
|
+
# operational transaction, and the sender must be the platform operator.
|
|
153
|
+
# Using a serialized format ensures that all validators compute the same
|
|
154
|
+
# transaction ID as the SHA-256 digest of the serialized bytes.
|
|
155
|
+
class SubmitOperationalTransactionRequest
|
|
156
|
+
include ::Google::Protobuf::MessageExts
|
|
157
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Response message for SubmitOperationalTransaction.
|
|
161
|
+
# @!attribute [rw] transaction_digest_hex
|
|
162
|
+
# @return [::String]
|
|
163
|
+
# Identifier that uniquely represents the submitted operational transaction.
|
|
164
|
+
# It is the hexadecimal representation of the SHA-256 digest of the
|
|
165
|
+
# `serialized_signed_operational_transaction`.
|
|
166
|
+
# This transaction ID is provided so that a client can track the transaction
|
|
167
|
+
# without needing to implement the hashing logic itself.
|
|
168
|
+
# The identifier can be directly used in subsequent API calls, for example to
|
|
169
|
+
# query the transaction state.
|
|
170
|
+
class SubmitOperationalTransactionResponse
|
|
171
|
+
include ::Google::Protobuf::MessageExts
|
|
172
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Request message for QueryTransactionState.
|
|
176
|
+
# @!attribute [rw] endpoint
|
|
177
|
+
# @return [::String]
|
|
178
|
+
# Required. The endpoint to serve the request.
|
|
179
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
|
180
|
+
# The location is a region.
|
|
181
|
+
# @!attribute [rw] transaction_digest_hex
|
|
182
|
+
# @return [::String]
|
|
183
|
+
# Required. The transaction ID to get the state of.
|
|
184
|
+
class QueryTransactionStateRequest
|
|
185
|
+
include ::Google::Protobuf::MessageExts
|
|
186
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Response message for QueryTransactionState.
|
|
190
|
+
# @!attribute [rw] transaction_attempts
|
|
191
|
+
# @return [::Array<::Google::Cloud::UniversalLedger::V1::TransactionAttempt>]
|
|
192
|
+
# One entry per each known submission of the transaction to the validator
|
|
193
|
+
# handling the request.
|
|
194
|
+
class QueryTransactionStateResponse
|
|
195
|
+
include ::Google::Protobuf::MessageExts
|
|
196
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Request message for QueryData.
|
|
200
|
+
# @!attribute [rw] endpoint
|
|
201
|
+
# @return [::String]
|
|
202
|
+
# Required. The endpoint to serve the request.
|
|
203
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
|
204
|
+
# The location is a region.
|
|
205
|
+
# @!attribute [rw] serialized_signed_query_request
|
|
206
|
+
# @return [::String]
|
|
207
|
+
# Required. A protobuf serialized
|
|
208
|
+
# {::Google::Cloud::UniversalLedger::V1::SignedQueryRequest SignedQueryRequest} to
|
|
209
|
+
# query the Universal Ledger network.
|
|
210
|
+
class QueryDataRequest
|
|
211
|
+
include ::Google::Protobuf::MessageExts
|
|
212
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Response message for QueryData.
|
|
216
|
+
# @!attribute [rw] account
|
|
217
|
+
# @return [::Google::Cloud::UniversalLedger::V1::Account]
|
|
218
|
+
# The account information, if the query was for an account.
|
|
219
|
+
#
|
|
220
|
+
# Note: The following fields are mutually exclusive: `account`, `transaction_state`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
|
221
|
+
# @!attribute [rw] transaction_state
|
|
222
|
+
# @return [::Google::Cloud::UniversalLedger::V1::TransactionState]
|
|
223
|
+
# The state of a transaction, if the query was for a transaction.
|
|
224
|
+
#
|
|
225
|
+
# Note: The following fields are mutually exclusive: `transaction_state`, `account`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
|
226
|
+
# @!attribute [rw] redacted_fields
|
|
227
|
+
# @return [::Array<::Google::Cloud::UniversalLedger::V1::RedactedField>]
|
|
228
|
+
# Indicates which fields have been redacted from the response due to
|
|
229
|
+
# permission restrictions.
|
|
230
|
+
class QueryDataResponse
|
|
231
|
+
include ::Google::Protobuf::MessageExts
|
|
232
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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 Protobuf
|
|
22
|
+
# `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
23
|
+
# URL that describes the type of the serialized message.
|
|
24
|
+
#
|
|
25
|
+
# Protobuf library provides support to pack/unpack Any values in the form
|
|
26
|
+
# of utility functions or additional generated methods of the Any type.
|
|
27
|
+
#
|
|
28
|
+
# Example 1: Pack and unpack a message in C++.
|
|
29
|
+
#
|
|
30
|
+
# Foo foo = ...;
|
|
31
|
+
# Any any;
|
|
32
|
+
# any.PackFrom(foo);
|
|
33
|
+
# ...
|
|
34
|
+
# if (any.UnpackTo(&foo)) {
|
|
35
|
+
# ...
|
|
36
|
+
# }
|
|
37
|
+
#
|
|
38
|
+
# Example 2: Pack and unpack a message in Java.
|
|
39
|
+
#
|
|
40
|
+
# Foo foo = ...;
|
|
41
|
+
# Any any = Any.pack(foo);
|
|
42
|
+
# ...
|
|
43
|
+
# if (any.is(Foo.class)) {
|
|
44
|
+
# foo = any.unpack(Foo.class);
|
|
45
|
+
# }
|
|
46
|
+
# // or ...
|
|
47
|
+
# if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
|
48
|
+
# foo = any.unpack(Foo.getDefaultInstance());
|
|
49
|
+
# }
|
|
50
|
+
#
|
|
51
|
+
# Example 3: Pack and unpack a message in Python.
|
|
52
|
+
#
|
|
53
|
+
# foo = Foo(...)
|
|
54
|
+
# any = Any()
|
|
55
|
+
# any.Pack(foo)
|
|
56
|
+
# ...
|
|
57
|
+
# if any.Is(Foo.DESCRIPTOR):
|
|
58
|
+
# any.Unpack(foo)
|
|
59
|
+
# ...
|
|
60
|
+
#
|
|
61
|
+
# Example 4: Pack and unpack a message in Go
|
|
62
|
+
#
|
|
63
|
+
# foo := &pb.Foo{...}
|
|
64
|
+
# any, err := anypb.New(foo)
|
|
65
|
+
# if err != nil {
|
|
66
|
+
# ...
|
|
67
|
+
# }
|
|
68
|
+
# ...
|
|
69
|
+
# foo := &pb.Foo{}
|
|
70
|
+
# if err := any.UnmarshalTo(foo); err != nil {
|
|
71
|
+
# ...
|
|
72
|
+
# }
|
|
73
|
+
#
|
|
74
|
+
# The pack methods provided by protobuf library will by default use
|
|
75
|
+
# 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
|
76
|
+
# methods only use the fully qualified type name after the last '/'
|
|
77
|
+
# in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
78
|
+
# name "y.z".
|
|
79
|
+
#
|
|
80
|
+
# JSON
|
|
81
|
+
# ====
|
|
82
|
+
# The JSON representation of an `Any` value uses the regular
|
|
83
|
+
# representation of the deserialized, embedded message, with an
|
|
84
|
+
# additional field `@type` which contains the type URL. Example:
|
|
85
|
+
#
|
|
86
|
+
# package google.profile;
|
|
87
|
+
# message Person {
|
|
88
|
+
# string first_name = 1;
|
|
89
|
+
# string last_name = 2;
|
|
90
|
+
# }
|
|
91
|
+
#
|
|
92
|
+
# {
|
|
93
|
+
# "@type": "type.googleapis.com/google.profile.Person",
|
|
94
|
+
# "firstName": <string>,
|
|
95
|
+
# "lastName": <string>
|
|
96
|
+
# }
|
|
97
|
+
#
|
|
98
|
+
# If the embedded message type is well-known and has a custom JSON
|
|
99
|
+
# representation, that representation will be embedded adding a field
|
|
100
|
+
# `value` which holds the custom JSON in addition to the `@type`
|
|
101
|
+
# field. Example (for message [google.protobuf.Duration][]):
|
|
102
|
+
#
|
|
103
|
+
# {
|
|
104
|
+
# "@type": "type.googleapis.com/google.protobuf.Duration",
|
|
105
|
+
# "value": "1.212s"
|
|
106
|
+
# }
|
|
107
|
+
# @!attribute [rw] type_url
|
|
108
|
+
# @return [::String]
|
|
109
|
+
# A URL/resource name that uniquely identifies the type of the serialized
|
|
110
|
+
# protocol buffer message. This string must contain at least
|
|
111
|
+
# one "/" character. The last segment of the URL's path must represent
|
|
112
|
+
# the fully qualified name of the type (as in
|
|
113
|
+
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
114
|
+
# (e.g., leading "." is not accepted).
|
|
115
|
+
#
|
|
116
|
+
# In practice, teams usually precompile into the binary all types that they
|
|
117
|
+
# expect it to use in the context of Any. However, for URLs which use the
|
|
118
|
+
# scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
119
|
+
# server that maps type URLs to message definitions as follows:
|
|
120
|
+
#
|
|
121
|
+
# * If no scheme is provided, `https` is assumed.
|
|
122
|
+
# * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
|
123
|
+
# value in binary format, or produce an error.
|
|
124
|
+
# * Applications are allowed to cache lookup results based on the
|
|
125
|
+
# URL, or have them precompiled into a binary to avoid any
|
|
126
|
+
# lookup. Therefore, binary compatibility needs to be preserved
|
|
127
|
+
# on changes to types. (Use versioned type names to manage
|
|
128
|
+
# breaking changes.)
|
|
129
|
+
#
|
|
130
|
+
# Note: this functionality is not currently available in the official
|
|
131
|
+
# protobuf release, and it is not used for type URLs beginning with
|
|
132
|
+
# type.googleapis.com. As of May 2023, there are no widely used type server
|
|
133
|
+
# implementations and no plans to implement one.
|
|
134
|
+
#
|
|
135
|
+
# Schemes other than `http`, `https` (or the empty scheme) might be
|
|
136
|
+
# used with implementation specific semantics.
|
|
137
|
+
# @!attribute [rw] value
|
|
138
|
+
# @return [::String]
|
|
139
|
+
# Must be a valid serialized protocol buffer of the above specified type.
|
|
140
|
+
class Any
|
|
141
|
+
include ::Google::Protobuf::MessageExts
|
|
142
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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 Protobuf
|
|
22
|
+
# A Duration represents a signed, fixed-length span of time represented
|
|
23
|
+
# as a count of seconds and fractions of seconds at nanosecond
|
|
24
|
+
# resolution. It is independent of any calendar and concepts like "day"
|
|
25
|
+
# or "month". It is related to Timestamp in that the difference between
|
|
26
|
+
# two Timestamp values is a Duration and it can be added or subtracted
|
|
27
|
+
# from a Timestamp. Range is approximately +-10,000 years.
|
|
28
|
+
#
|
|
29
|
+
# # Examples
|
|
30
|
+
#
|
|
31
|
+
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
32
|
+
#
|
|
33
|
+
# Timestamp start = ...;
|
|
34
|
+
# Timestamp end = ...;
|
|
35
|
+
# Duration duration = ...;
|
|
36
|
+
#
|
|
37
|
+
# duration.seconds = end.seconds - start.seconds;
|
|
38
|
+
# duration.nanos = end.nanos - start.nanos;
|
|
39
|
+
#
|
|
40
|
+
# if (duration.seconds < 0 && duration.nanos > 0) {
|
|
41
|
+
# duration.seconds += 1;
|
|
42
|
+
# duration.nanos -= 1000000000;
|
|
43
|
+
# } else if (duration.seconds > 0 && duration.nanos < 0) {
|
|
44
|
+
# duration.seconds -= 1;
|
|
45
|
+
# duration.nanos += 1000000000;
|
|
46
|
+
# }
|
|
47
|
+
#
|
|
48
|
+
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
49
|
+
#
|
|
50
|
+
# Timestamp start = ...;
|
|
51
|
+
# Duration duration = ...;
|
|
52
|
+
# Timestamp end = ...;
|
|
53
|
+
#
|
|
54
|
+
# end.seconds = start.seconds + duration.seconds;
|
|
55
|
+
# end.nanos = start.nanos + duration.nanos;
|
|
56
|
+
#
|
|
57
|
+
# if (end.nanos < 0) {
|
|
58
|
+
# end.seconds -= 1;
|
|
59
|
+
# end.nanos += 1000000000;
|
|
60
|
+
# } else if (end.nanos >= 1000000000) {
|
|
61
|
+
# end.seconds += 1;
|
|
62
|
+
# end.nanos -= 1000000000;
|
|
63
|
+
# }
|
|
64
|
+
#
|
|
65
|
+
# Example 3: Compute Duration from datetime.timedelta in Python.
|
|
66
|
+
#
|
|
67
|
+
# td = datetime.timedelta(days=3, minutes=10)
|
|
68
|
+
# duration = Duration()
|
|
69
|
+
# duration.FromTimedelta(td)
|
|
70
|
+
#
|
|
71
|
+
# # JSON Mapping
|
|
72
|
+
#
|
|
73
|
+
# In JSON format, the Duration type is encoded as a string rather than an
|
|
74
|
+
# object, where the string ends in the suffix "s" (indicating seconds) and
|
|
75
|
+
# is preceded by the number of seconds, with nanoseconds expressed as
|
|
76
|
+
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
77
|
+
# encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
78
|
+
# be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
79
|
+
# microsecond should be expressed in JSON format as "3.000001s".
|
|
80
|
+
# @!attribute [rw] seconds
|
|
81
|
+
# @return [::Integer]
|
|
82
|
+
# Signed seconds of the span of time. Must be from -315,576,000,000
|
|
83
|
+
# to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
84
|
+
# 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
85
|
+
# @!attribute [rw] nanos
|
|
86
|
+
# @return [::Integer]
|
|
87
|
+
# Signed fractions of a second at nanosecond resolution of the span
|
|
88
|
+
# of time. Durations less than one second are represented with a 0
|
|
89
|
+
# `seconds` field and a positive or negative `nanos` field. For durations
|
|
90
|
+
# of one second or more, a non-zero value for the `nanos` field must be
|
|
91
|
+
# of the same sign as the `seconds` field. Must be from -999,999,999
|
|
92
|
+
# to +999,999,999 inclusive.
|
|
93
|
+
class Duration
|
|
94
|
+
include ::Google::Protobuf::MessageExts
|
|
95
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|