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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +151 -8
  5. data/lib/google/cloud/universal_ledger/v1/rest.rb +37 -0
  6. data/lib/google/cloud/universal_ledger/v1/universal_ledger/client.rb +1163 -0
  7. data/lib/google/cloud/universal_ledger/v1/universal_ledger/credentials.rb +47 -0
  8. data/lib/google/cloud/universal_ledger/v1/universal_ledger/paths.rb +69 -0
  9. data/lib/google/cloud/universal_ledger/v1/universal_ledger/rest/client.rb +1067 -0
  10. data/lib/google/cloud/universal_ledger/v1/universal_ledger/rest/service_stub.rb +511 -0
  11. data/lib/google/cloud/universal_ledger/v1/universal_ledger/rest.rb +59 -0
  12. data/lib/google/cloud/universal_ledger/v1/universal_ledger.rb +62 -0
  13. data/lib/google/cloud/universal_ledger/v1/version.rb +7 -2
  14. data/lib/google/cloud/universal_ledger/v1.rb +45 -0
  15. data/lib/google/cloud/universalledger/v1/accounts_pb.rb +23 -0
  16. data/lib/google/cloud/universalledger/v1/common_pb.rb +36 -0
  17. data/lib/google/cloud/universalledger/v1/query_pb.rb +39 -0
  18. data/lib/google/cloud/universalledger/v1/status_event_pb.rb +27 -0
  19. data/lib/google/cloud/universalledger/v1/transactions_pb.rb +52 -0
  20. data/lib/google/cloud/universalledger/v1/types_pb.rb +47 -0
  21. data/lib/google/cloud/universalledger/v1/universalledger_pb.rb +41 -0
  22. data/lib/google/cloud/universalledger/v1/universalledger_services_pb.rb +89 -0
  23. data/lib/google-cloud-universal_ledger-v1.rb +21 -0
  24. data/proto_docs/README.md +4 -0
  25. data/proto_docs/google/api/client.rb +593 -0
  26. data/proto_docs/google/api/field_behavior.rb +85 -0
  27. data/proto_docs/google/api/launch_stage.rb +71 -0
  28. data/proto_docs/google/api/resource.rb +227 -0
  29. data/proto_docs/google/cloud/universalledger/v1/accounts.rb +75 -0
  30. data/proto_docs/google/cloud/universalledger/v1/common.rb +272 -0
  31. data/proto_docs/google/cloud/universalledger/v1/query.rb +314 -0
  32. data/proto_docs/google/cloud/universalledger/v1/status_event.rb +88 -0
  33. data/proto_docs/google/cloud/universalledger/v1/transactions.rb +716 -0
  34. data/proto_docs/google/cloud/universalledger/v1/types.rb +618 -0
  35. data/proto_docs/google/cloud/universalledger/v1/universalledger.rb +237 -0
  36. data/proto_docs/google/protobuf/any.rb +145 -0
  37. data/proto_docs/google/protobuf/duration.rb +98 -0
  38. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  39. data/proto_docs/google/protobuf/timestamp.rb +128 -0
  40. data/proto_docs/google/rpc/code.rb +185 -0
  41. metadata +86 -9
@@ -0,0 +1,1163 @@
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
+ require "google/cloud/errors"
20
+ require "google/cloud/universalledger/v1/universalledger_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module UniversalLedger
26
+ module V1
27
+ module UniversalLedger
28
+ ##
29
+ # Client for the UniversalLedger service.
30
+ #
31
+ # A service for interacting with the Google Cloud Universal Ledger.
32
+ # Endpoints are pre-created and managed by Google and cannot
33
+ # be modified by users.
34
+ # The names of available endpoints will be provided in the public
35
+ # documentation.
36
+ # An endpoint is a regional resource within a Universal Ledger network.
37
+ # Requests sent to an endpoint may be routed to different validators in the
38
+ # given network within the given region.
39
+ #
40
+ class Client
41
+ # @private
42
+ API_VERSION = ""
43
+
44
+ # @private
45
+ DEFAULT_ENDPOINT_TEMPLATE = "universalledger.$UNIVERSE_DOMAIN$"
46
+
47
+ include Paths
48
+
49
+ # @private
50
+ attr_reader :universal_ledger_stub
51
+
52
+ ##
53
+ # Configure the UniversalLedger Client class.
54
+ #
55
+ # See {::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client::Configuration}
56
+ # for a description of the configuration fields.
57
+ #
58
+ # @example
59
+ #
60
+ # # Modify the configuration for all UniversalLedger clients
61
+ # ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.configure do |config|
62
+ # config.timeout = 10.0
63
+ # end
64
+ #
65
+ # @yield [config] Configure the Client client.
66
+ # @yieldparam config [Client::Configuration]
67
+ #
68
+ # @return [Client::Configuration]
69
+ #
70
+ def self.configure
71
+ @configure ||= begin
72
+ namespace = ["Google", "Cloud", "UniversalLedger", "V1"]
73
+ parent_config = while namespace.any?
74
+ parent_name = namespace.join "::"
75
+ parent_const = const_get parent_name
76
+ break parent_const.configure if parent_const.respond_to? :configure
77
+ namespace.pop
78
+ end
79
+ default_config = Client::Configuration.new parent_config
80
+
81
+ default_config.rpcs.submit_transaction.timeout = 60.0
82
+
83
+ default_config.rpcs.list_endpoints.timeout = 60.0
84
+ default_config.rpcs.list_endpoints.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
86
+ }
87
+
88
+ default_config.rpcs.get_endpoint.timeout = 60.0
89
+ default_config.rpcs.get_endpoint.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config.rpcs.submit_operational_transaction.timeout = 60.0
94
+
95
+ default_config.rpcs.query_transaction_state.timeout = 60.0
96
+ default_config.rpcs.query_transaction_state.retry_policy = {
97
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
98
+ }
99
+
100
+ default_config.rpcs.query_account.timeout = 60.0
101
+ default_config.rpcs.query_account.retry_policy = {
102
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
103
+ }
104
+
105
+ default_config.rpcs.query_data.timeout = 60.0
106
+ default_config.rpcs.query_data.retry_policy = {
107
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
108
+ }
109
+
110
+ default_config
111
+ end
112
+ yield @configure if block_given?
113
+ @configure
114
+ end
115
+
116
+ ##
117
+ # Configure the UniversalLedger Client instance.
118
+ #
119
+ # The configuration is set to the derived mode, meaning that values can be changed,
120
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
121
+ # should be made on {Client.configure}.
122
+ #
123
+ # See {::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client::Configuration}
124
+ # for a description of the configuration fields.
125
+ #
126
+ # @yield [config] Configure the Client client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ # @return [Client::Configuration]
130
+ #
131
+ def configure
132
+ yield @config if block_given?
133
+ @config
134
+ end
135
+
136
+ ##
137
+ # The effective universe domain
138
+ #
139
+ # @return [String]
140
+ #
141
+ def universe_domain
142
+ @universal_ledger_stub.universe_domain
143
+ end
144
+
145
+ ##
146
+ # Create a new UniversalLedger client object.
147
+ #
148
+ # @example
149
+ #
150
+ # # Create a client using the default configuration
151
+ # client = ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
152
+ #
153
+ # # Create a client using a custom configuration
154
+ # client = ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new do |config|
155
+ # config.timeout = 10.0
156
+ # end
157
+ #
158
+ # @yield [config] Configure the UniversalLedger client.
159
+ # @yieldparam config [Client::Configuration]
160
+ #
161
+ def initialize
162
+ # These require statements are intentionally placed here to initialize
163
+ # the gRPC module only when it's required.
164
+ # See https://github.com/googleapis/toolkit/issues/446
165
+ require "gapic/grpc"
166
+ require "google/cloud/universalledger/v1/universalledger_services_pb"
167
+
168
+ # Create the configuration object
169
+ @config = Configuration.new Client.configure
170
+
171
+ # Yield the configuration if needed
172
+ yield @config if block_given?
173
+
174
+ # Create credentials
175
+ credentials = @config.credentials
176
+ # Use self-signed JWT if the endpoint is unchanged from default,
177
+ # but only if the default endpoint does not have a region prefix.
178
+ enable_self_signed_jwt = @config.endpoint.nil? ||
179
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
180
+ !@config.endpoint.split(".").first.include?("-"))
181
+ credentials ||= Credentials.default scope: @config.scope,
182
+ enable_self_signed_jwt: enable_self_signed_jwt
183
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
184
+ credentials = Credentials.new credentials, scope: @config.scope
185
+ end
186
+ @quota_project_id = @config.quota_project
187
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
188
+
189
+ @universal_ledger_stub = ::Gapic::ServiceStub.new(
190
+ ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Stub,
191
+ credentials: credentials,
192
+ endpoint: @config.endpoint,
193
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
194
+ universe_domain: @config.universe_domain,
195
+ channel_args: @config.channel_args,
196
+ interceptors: @config.interceptors,
197
+ channel_pool_config: @config.channel_pool,
198
+ logger: @config.logger
199
+ )
200
+
201
+ @universal_ledger_stub.stub_logger&.info do |entry|
202
+ entry.set_system_name
203
+ entry.set_service
204
+ entry.message = "Created client for #{entry.service}"
205
+ entry.set_credentials_fields credentials
206
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
207
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
208
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
209
+ end
210
+
211
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
212
+ config.credentials = credentials
213
+ config.quota_project = @quota_project_id
214
+ config.endpoint = @universal_ledger_stub.endpoint
215
+ config.universe_domain = @universal_ledger_stub.universe_domain
216
+ config.logger = @universal_ledger_stub.logger if config.respond_to? :logger=
217
+ end
218
+ end
219
+
220
+ ##
221
+ # Get the associated client for mix-in of the Locations.
222
+ #
223
+ # @return [Google::Cloud::Location::Locations::Client]
224
+ #
225
+ attr_reader :location_client
226
+
227
+ ##
228
+ # The logger used for request/response debug logging.
229
+ #
230
+ # @return [Logger]
231
+ #
232
+ def logger
233
+ @universal_ledger_stub.logger
234
+ end
235
+
236
+ # Service calls
237
+
238
+ ##
239
+ # Submits a transaction to the network.
240
+ # The request is first validated for basic correctness. If validation fails,
241
+ # the request will fail immediately.
242
+ # If validation succeeds, this method returns only after the transaction has
243
+ # been replicated across a majority of validators in the network, or until
244
+ # the request fails.
245
+ #
246
+ # @overload submit_transaction(request, options = nil)
247
+ # Pass arguments to `submit_transaction` via a request object, either of type
248
+ # {::Google::Cloud::UniversalLedger::V1::SubmitTransactionRequest} or an equivalent Hash.
249
+ #
250
+ # @param request [::Google::Cloud::UniversalLedger::V1::SubmitTransactionRequest, ::Hash]
251
+ # A request object representing the call parameters. Required. To specify no
252
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
253
+ # @param options [::Gapic::CallOptions, ::Hash]
254
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
255
+ #
256
+ # @overload submit_transaction(endpoint: nil, serialized_signed_transaction: nil)
257
+ # Pass arguments to `submit_transaction` via keyword arguments. Note that at
258
+ # least one keyword argument is required. To specify no parameters, or to keep all
259
+ # the default parameter values, pass an empty Hash as a request object (see above).
260
+ #
261
+ # @param endpoint [::String]
262
+ # Required. The endpoint to submit the transaction to.
263
+ # Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
264
+ # The location is a region.
265
+ # @param serialized_signed_transaction [::String]
266
+ # Required. A protobuf serialized
267
+ # {::Google::Cloud::UniversalLedger::V1::SignedTransaction SignedTransaction} to
268
+ # submit to the ledger. Using a serialized format ensures that all validators
269
+ # compute the same transaction ID as the SHA-256 digest of the serialized
270
+ # bytes.
271
+ #
272
+ # @yield [response, operation] Access the result along with the RPC operation
273
+ # @yieldparam response [::Google::Cloud::UniversalLedger::V1::SubmitTransactionResponse]
274
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
275
+ #
276
+ # @return [::Google::Cloud::UniversalLedger::V1::SubmitTransactionResponse]
277
+ #
278
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
279
+ #
280
+ # @example Basic example
281
+ # require "google/cloud/universal_ledger/v1"
282
+ #
283
+ # # Create a client object. The client can be reused for multiple calls.
284
+ # client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
285
+ #
286
+ # # Create a request. To set request fields, pass in keyword arguments.
287
+ # request = Google::Cloud::UniversalLedger::V1::SubmitTransactionRequest.new
288
+ #
289
+ # # Call the submit_transaction method.
290
+ # result = client.submit_transaction request
291
+ #
292
+ # # The returned object is of type Google::Cloud::UniversalLedger::V1::SubmitTransactionResponse.
293
+ # p result
294
+ #
295
+ def submit_transaction request, options = nil
296
+ raise ::ArgumentError, "request must be provided" if request.nil?
297
+
298
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::UniversalLedger::V1::SubmitTransactionRequest
299
+
300
+ # Converts hash and nil to an options object
301
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
302
+
303
+ # Customize the options with defaults
304
+ metadata = @config.rpcs.submit_transaction.metadata.to_h
305
+
306
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
307
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
308
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
309
+ gapic_version: ::Google::Cloud::UniversalLedger::V1::VERSION
310
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
311
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
312
+
313
+ header_params = {}
314
+ if request.endpoint
315
+ header_params["endpoint"] = request.endpoint
316
+ end
317
+
318
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
319
+ metadata[:"x-goog-request-params"] ||= request_params_header
320
+
321
+ options.apply_defaults timeout: @config.rpcs.submit_transaction.timeout,
322
+ metadata: metadata,
323
+ retry_policy: @config.rpcs.submit_transaction.retry_policy
324
+
325
+ options.apply_defaults timeout: @config.timeout,
326
+ metadata: @config.metadata,
327
+ retry_policy: @config.retry_policy
328
+
329
+ @universal_ledger_stub.call_rpc :submit_transaction, request, options: options do |response, operation|
330
+ yield response, operation if block_given?
331
+ end
332
+ rescue ::GRPC::BadStatus => e
333
+ raise ::Google::Cloud::Error.from_error(e)
334
+ end
335
+
336
+ ##
337
+ # Lists all endpoints for a given project and location.
338
+ #
339
+ # @overload list_endpoints(request, options = nil)
340
+ # Pass arguments to `list_endpoints` via a request object, either of type
341
+ # {::Google::Cloud::UniversalLedger::V1::ListEndpointsRequest} or an equivalent Hash.
342
+ #
343
+ # @param request [::Google::Cloud::UniversalLedger::V1::ListEndpointsRequest, ::Hash]
344
+ # A request object representing the call parameters. Required. To specify no
345
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
346
+ # @param options [::Gapic::CallOptions, ::Hash]
347
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
348
+ #
349
+ # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil)
350
+ # Pass arguments to `list_endpoints` via keyword arguments. Note that at
351
+ # least one keyword argument is required. To specify no parameters, or to keep all
352
+ # the default parameter values, pass an empty Hash as a request object (see above).
353
+ #
354
+ # @param parent [::String]
355
+ # Required. The parent, which owns this collection of endpoints.
356
+ # Format: `projects/{project}/locations/{location}`
357
+ # @param page_size [::Integer]
358
+ # Optional. The maximum number of endpoints to return. The service may return
359
+ # fewer than this value. If unspecified, at most 50 endpoints will be
360
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
361
+ # 1000.
362
+ # @param page_token [::String]
363
+ # Optional. A page token, received from a previous `ListEndpoints` call.
364
+ # Provide this to retrieve the subsequent page.
365
+ #
366
+ # @yield [response, operation] Access the result along with the RPC operation
367
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>]
368
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
369
+ #
370
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::UniversalLedger::V1::Endpoint>]
371
+ #
372
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
373
+ #
374
+ # @example Basic example
375
+ # require "google/cloud/universal_ledger/v1"
376
+ #
377
+ # # Create a client object. The client can be reused for multiple calls.
378
+ # client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
379
+ #
380
+ # # Create a request. To set request fields, pass in keyword arguments.
381
+ # request = Google::Cloud::UniversalLedger::V1::ListEndpointsRequest.new
382
+ #
383
+ # # Call the list_endpoints method.
384
+ # result = client.list_endpoints request
385
+ #
386
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
387
+ # # over elements, and API calls will be issued to fetch pages as needed.
388
+ # result.each do |item|
389
+ # # Each element is of type ::Google::Cloud::UniversalLedger::V1::Endpoint.
390
+ # p item
391
+ # end
392
+ #
393
+ def list_endpoints request, options = nil
394
+ raise ::ArgumentError, "request must be provided" if request.nil?
395
+
396
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::UniversalLedger::V1::ListEndpointsRequest
397
+
398
+ # Converts hash and nil to an options object
399
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
400
+
401
+ # Customize the options with defaults
402
+ metadata = @config.rpcs.list_endpoints.metadata.to_h
403
+
404
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
405
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
406
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
407
+ gapic_version: ::Google::Cloud::UniversalLedger::V1::VERSION
408
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
409
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
410
+
411
+ header_params = {}
412
+ if request.parent
413
+ header_params["parent"] = request.parent
414
+ end
415
+
416
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
417
+ metadata[:"x-goog-request-params"] ||= request_params_header
418
+
419
+ options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout,
420
+ metadata: metadata,
421
+ retry_policy: @config.rpcs.list_endpoints.retry_policy
422
+
423
+ options.apply_defaults timeout: @config.timeout,
424
+ metadata: @config.metadata,
425
+ retry_policy: @config.retry_policy
426
+
427
+ @universal_ledger_stub.call_rpc :list_endpoints, request, options: options do |response, operation|
428
+ response = ::Gapic::PagedEnumerable.new @universal_ledger_stub, :list_endpoints, request, response, operation, options
429
+ yield response, operation if block_given?
430
+ throw :response, response
431
+ end
432
+ rescue ::GRPC::BadStatus => e
433
+ raise ::Google::Cloud::Error.from_error(e)
434
+ end
435
+
436
+ ##
437
+ # Gets the details of a specific endpoint.
438
+ #
439
+ # @overload get_endpoint(request, options = nil)
440
+ # Pass arguments to `get_endpoint` via a request object, either of type
441
+ # {::Google::Cloud::UniversalLedger::V1::GetEndpointRequest} or an equivalent Hash.
442
+ #
443
+ # @param request [::Google::Cloud::UniversalLedger::V1::GetEndpointRequest, ::Hash]
444
+ # A request object representing the call parameters. Required. To specify no
445
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
446
+ # @param options [::Gapic::CallOptions, ::Hash]
447
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
448
+ #
449
+ # @overload get_endpoint(name: nil)
450
+ # Pass arguments to `get_endpoint` via keyword arguments. Note that at
451
+ # least one keyword argument is required. To specify no parameters, or to keep all
452
+ # the default parameter values, pass an empty Hash as a request object (see above).
453
+ #
454
+ # @param name [::String]
455
+ # Required. The name of the endpoint to retrieve.
456
+ # Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
457
+ #
458
+ # @yield [response, operation] Access the result along with the RPC operation
459
+ # @yieldparam response [::Google::Cloud::UniversalLedger::V1::Endpoint]
460
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
461
+ #
462
+ # @return [::Google::Cloud::UniversalLedger::V1::Endpoint]
463
+ #
464
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
465
+ #
466
+ # @example Basic example
467
+ # require "google/cloud/universal_ledger/v1"
468
+ #
469
+ # # Create a client object. The client can be reused for multiple calls.
470
+ # client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
471
+ #
472
+ # # Create a request. To set request fields, pass in keyword arguments.
473
+ # request = Google::Cloud::UniversalLedger::V1::GetEndpointRequest.new
474
+ #
475
+ # # Call the get_endpoint method.
476
+ # result = client.get_endpoint request
477
+ #
478
+ # # The returned object is of type Google::Cloud::UniversalLedger::V1::Endpoint.
479
+ # p result
480
+ #
481
+ def get_endpoint request, options = nil
482
+ raise ::ArgumentError, "request must be provided" if request.nil?
483
+
484
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::UniversalLedger::V1::GetEndpointRequest
485
+
486
+ # Converts hash and nil to an options object
487
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
488
+
489
+ # Customize the options with defaults
490
+ metadata = @config.rpcs.get_endpoint.metadata.to_h
491
+
492
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
493
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
494
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
495
+ gapic_version: ::Google::Cloud::UniversalLedger::V1::VERSION
496
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
497
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
498
+
499
+ header_params = {}
500
+ if request.name
501
+ header_params["name"] = request.name
502
+ end
503
+
504
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
505
+ metadata[:"x-goog-request-params"] ||= request_params_header
506
+
507
+ options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout,
508
+ metadata: metadata,
509
+ retry_policy: @config.rpcs.get_endpoint.retry_policy
510
+
511
+ options.apply_defaults timeout: @config.timeout,
512
+ metadata: @config.metadata,
513
+ retry_policy: @config.retry_policy
514
+
515
+ @universal_ledger_stub.call_rpc :get_endpoint, request, options: options do |response, operation|
516
+ yield response, operation if block_given?
517
+ end
518
+ rescue ::GRPC::BadStatus => e
519
+ raise ::Google::Cloud::Error.from_error(e)
520
+ end
521
+
522
+ ##
523
+ # Submits an operational transaction to the network.
524
+ # This method returns only after the transaction has been replicated across a
525
+ # majority of validators in the network, or if the transaction fails.
526
+ #
527
+ # @overload submit_operational_transaction(request, options = nil)
528
+ # Pass arguments to `submit_operational_transaction` via a request object, either of type
529
+ # {::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionRequest} or an equivalent Hash.
530
+ #
531
+ # @param request [::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionRequest, ::Hash]
532
+ # A request object representing the call parameters. Required. To specify no
533
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
534
+ # @param options [::Gapic::CallOptions, ::Hash]
535
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
536
+ #
537
+ # @overload submit_operational_transaction(endpoint: nil, serialized_signed_operational_transaction: nil)
538
+ # Pass arguments to `submit_operational_transaction` via keyword arguments. Note that at
539
+ # least one keyword argument is required. To specify no parameters, or to keep all
540
+ # the default parameter values, pass an empty Hash as a request object (see above).
541
+ #
542
+ # @param endpoint [::String]
543
+ # Required. The endpoint to serve the request.
544
+ # Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
545
+ # The location is a region.
546
+ # @param serialized_signed_operational_transaction [::String]
547
+ # Required. A protobuf serialized
548
+ # {::Google::Cloud::UniversalLedger::V1::SignedTransaction SignedTransaction} to
549
+ # submit to the ledger. The enclosed client transaction must be an
550
+ # operational transaction, and the sender must be the platform operator.
551
+ # Using a serialized format ensures that all validators compute the same
552
+ # transaction ID as the SHA-256 digest of the serialized bytes.
553
+ #
554
+ # @yield [response, operation] Access the result along with the RPC operation
555
+ # @yieldparam response [::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponse]
556
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
557
+ #
558
+ # @return [::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponse]
559
+ #
560
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
561
+ #
562
+ # @example Basic example
563
+ # require "google/cloud/universal_ledger/v1"
564
+ #
565
+ # # Create a client object. The client can be reused for multiple calls.
566
+ # client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
567
+ #
568
+ # # Create a request. To set request fields, pass in keyword arguments.
569
+ # request = Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionRequest.new
570
+ #
571
+ # # Call the submit_operational_transaction method.
572
+ # result = client.submit_operational_transaction request
573
+ #
574
+ # # The returned object is of type Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionResponse.
575
+ # p result
576
+ #
577
+ def submit_operational_transaction request, options = nil
578
+ raise ::ArgumentError, "request must be provided" if request.nil?
579
+
580
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::UniversalLedger::V1::SubmitOperationalTransactionRequest
581
+
582
+ # Converts hash and nil to an options object
583
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
584
+
585
+ # Customize the options with defaults
586
+ metadata = @config.rpcs.submit_operational_transaction.metadata.to_h
587
+
588
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
589
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
590
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
591
+ gapic_version: ::Google::Cloud::UniversalLedger::V1::VERSION
592
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
593
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
594
+
595
+ header_params = {}
596
+ if request.endpoint
597
+ header_params["endpoint"] = request.endpoint
598
+ end
599
+
600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
601
+ metadata[:"x-goog-request-params"] ||= request_params_header
602
+
603
+ options.apply_defaults timeout: @config.rpcs.submit_operational_transaction.timeout,
604
+ metadata: metadata,
605
+ retry_policy: @config.rpcs.submit_operational_transaction.retry_policy
606
+
607
+ options.apply_defaults timeout: @config.timeout,
608
+ metadata: @config.metadata,
609
+ retry_policy: @config.retry_policy
610
+
611
+ @universal_ledger_stub.call_rpc :submit_operational_transaction, request, options: options do |response, operation|
612
+ yield response, operation if block_given?
613
+ end
614
+ rescue ::GRPC::BadStatus => e
615
+ raise ::Google::Cloud::Error.from_error(e)
616
+ end
617
+
618
+ ##
619
+ # Deprecated: Use the
620
+ # {::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client#query_data QueryData}
621
+ # method instead. Queries the state of a transaction. This method can be
622
+ # called for any transaction submitted to the network. The returned
623
+ # transaction details may vary between calls, because an endpoint may route
624
+ # requests to different validators within the network and region, and the
625
+ # validators may not be at the same round ID at any given time.
626
+ #
627
+ # @deprecated This method is deprecated and may be removed in the next major version update.
628
+ #
629
+ # @overload query_transaction_state(request, options = nil)
630
+ # Pass arguments to `query_transaction_state` via a request object, either of type
631
+ # {::Google::Cloud::UniversalLedger::V1::QueryTransactionStateRequest} or an equivalent Hash.
632
+ #
633
+ # @param request [::Google::Cloud::UniversalLedger::V1::QueryTransactionStateRequest, ::Hash]
634
+ # A request object representing the call parameters. Required. To specify no
635
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
636
+ # @param options [::Gapic::CallOptions, ::Hash]
637
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
638
+ #
639
+ # @overload query_transaction_state(endpoint: nil, transaction_digest_hex: nil)
640
+ # Pass arguments to `query_transaction_state` via keyword arguments. Note that at
641
+ # least one keyword argument is required. To specify no parameters, or to keep all
642
+ # the default parameter values, pass an empty Hash as a request object (see above).
643
+ #
644
+ # @param endpoint [::String]
645
+ # Required. The endpoint to serve the request.
646
+ # Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
647
+ # The location is a region.
648
+ # @param transaction_digest_hex [::String]
649
+ # Required. The transaction ID to get the state of.
650
+ #
651
+ # @yield [response, operation] Access the result along with the RPC operation
652
+ # @yieldparam response [::Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponse]
653
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
654
+ #
655
+ # @return [::Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponse]
656
+ #
657
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
658
+ #
659
+ # @example Basic example
660
+ # require "google/cloud/universal_ledger/v1"
661
+ #
662
+ # # Create a client object. The client can be reused for multiple calls.
663
+ # client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
664
+ #
665
+ # # Create a request. To set request fields, pass in keyword arguments.
666
+ # request = Google::Cloud::UniversalLedger::V1::QueryTransactionStateRequest.new
667
+ #
668
+ # # Call the query_transaction_state method.
669
+ # result = client.query_transaction_state request
670
+ #
671
+ # # The returned object is of type Google::Cloud::UniversalLedger::V1::QueryTransactionStateResponse.
672
+ # p result
673
+ #
674
+ def query_transaction_state request, options = nil
675
+ raise ::ArgumentError, "request must be provided" if request.nil?
676
+
677
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::UniversalLedger::V1::QueryTransactionStateRequest
678
+
679
+ # Converts hash and nil to an options object
680
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
681
+
682
+ # Customize the options with defaults
683
+ metadata = @config.rpcs.query_transaction_state.metadata.to_h
684
+
685
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
686
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
687
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
688
+ gapic_version: ::Google::Cloud::UniversalLedger::V1::VERSION
689
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
690
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
+
692
+ header_params = {}
693
+ if request.endpoint
694
+ header_params["endpoint"] = request.endpoint
695
+ end
696
+
697
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
698
+ metadata[:"x-goog-request-params"] ||= request_params_header
699
+
700
+ options.apply_defaults timeout: @config.rpcs.query_transaction_state.timeout,
701
+ metadata: metadata,
702
+ retry_policy: @config.rpcs.query_transaction_state.retry_policy
703
+
704
+ options.apply_defaults timeout: @config.timeout,
705
+ metadata: @config.metadata,
706
+ retry_policy: @config.retry_policy
707
+
708
+ @universal_ledger_stub.call_rpc :query_transaction_state, request, options: options do |response, operation|
709
+ yield response, operation if block_given?
710
+ end
711
+ rescue ::GRPC::BadStatus => e
712
+ raise ::Google::Cloud::Error.from_error(e)
713
+ end
714
+
715
+ ##
716
+ # Deprecated: Use the
717
+ # {::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client#query_data QueryData}
718
+ # method instead. Queries all the information stored about an account in the
719
+ # network. The returned account details may vary between calls, because an
720
+ # endpoint may route requests to different validators within the network and
721
+ # region, and the validators may not be at the same round ID at any given
722
+ # time.
723
+ #
724
+ # @deprecated This method is deprecated and may be removed in the next major version update.
725
+ #
726
+ # @overload query_account(request, options = nil)
727
+ # Pass arguments to `query_account` via a request object, either of type
728
+ # {::Google::Cloud::UniversalLedger::V1::QueryAccountRequest} or an equivalent Hash.
729
+ #
730
+ # @param request [::Google::Cloud::UniversalLedger::V1::QueryAccountRequest, ::Hash]
731
+ # A request object representing the call parameters. Required. To specify no
732
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
733
+ # @param options [::Gapic::CallOptions, ::Hash]
734
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
735
+ #
736
+ # @overload query_account(endpoint: nil, account_id: nil, round_id: nil)
737
+ # Pass arguments to `query_account` via keyword arguments. Note that at
738
+ # least one keyword argument is required. To specify no parameters, or to keep all
739
+ # the default parameter values, pass an empty Hash as a request object (see above).
740
+ #
741
+ # @param endpoint [::String]
742
+ # Required. The endpoint to serve the request.
743
+ # Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
744
+ # The location is a region.
745
+ # @param account_id [::String]
746
+ # Required. The account ID to get information about. The value is limited to
747
+ # 60 characters.
748
+ # @param round_id [::Integer]
749
+ # Optional. The ID of the execution round (similar to block "height") at
750
+ # which to request data. The returned account information will be accurate
751
+ # for the world state at this execution round. If unspecified, uses the
752
+ # latest finalized round as known by the serving validator. The state at a
753
+ # given round ID is always consistent and canonical.
754
+ #
755
+ # @yield [response, operation] Access the result along with the RPC operation
756
+ # @yieldparam response [::Google::Cloud::UniversalLedger::V1::QueryAccountResponse]
757
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
758
+ #
759
+ # @return [::Google::Cloud::UniversalLedger::V1::QueryAccountResponse]
760
+ #
761
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
762
+ #
763
+ # @example Basic example
764
+ # require "google/cloud/universal_ledger/v1"
765
+ #
766
+ # # Create a client object. The client can be reused for multiple calls.
767
+ # client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
768
+ #
769
+ # # Create a request. To set request fields, pass in keyword arguments.
770
+ # request = Google::Cloud::UniversalLedger::V1::QueryAccountRequest.new
771
+ #
772
+ # # Call the query_account method.
773
+ # result = client.query_account request
774
+ #
775
+ # # The returned object is of type Google::Cloud::UniversalLedger::V1::QueryAccountResponse.
776
+ # p result
777
+ #
778
+ def query_account request, options = nil
779
+ raise ::ArgumentError, "request must be provided" if request.nil?
780
+
781
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::UniversalLedger::V1::QueryAccountRequest
782
+
783
+ # Converts hash and nil to an options object
784
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
785
+
786
+ # Customize the options with defaults
787
+ metadata = @config.rpcs.query_account.metadata.to_h
788
+
789
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
790
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
791
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
792
+ gapic_version: ::Google::Cloud::UniversalLedger::V1::VERSION
793
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
794
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
795
+
796
+ header_params = {}
797
+ if request.endpoint
798
+ header_params["endpoint"] = request.endpoint
799
+ end
800
+
801
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
802
+ metadata[:"x-goog-request-params"] ||= request_params_header
803
+
804
+ options.apply_defaults timeout: @config.rpcs.query_account.timeout,
805
+ metadata: metadata,
806
+ retry_policy: @config.rpcs.query_account.retry_policy
807
+
808
+ options.apply_defaults timeout: @config.timeout,
809
+ metadata: @config.metadata,
810
+ retry_policy: @config.retry_policy
811
+
812
+ @universal_ledger_stub.call_rpc :query_account, request, options: options do |response, operation|
813
+ yield response, operation if block_given?
814
+ end
815
+ rescue ::GRPC::BadStatus => e
816
+ raise ::Google::Cloud::Error.from_error(e)
817
+ end
818
+
819
+ ##
820
+ # Queries the network for information stored on the ledger,
821
+ # such as accounts and transactions.
822
+ #
823
+ # Access to certain sensitive fields, such as account balances, may be
824
+ # restricted based on the identity of the sender derived from the signature
825
+ # in the request. If the sender lacks permission, sensitive fields will be
826
+ # redacted from the response and reported in the `redacted_fields` field.
827
+ #
828
+ # @overload query_data(request, options = nil)
829
+ # Pass arguments to `query_data` via a request object, either of type
830
+ # {::Google::Cloud::UniversalLedger::V1::QueryDataRequest} or an equivalent Hash.
831
+ #
832
+ # @param request [::Google::Cloud::UniversalLedger::V1::QueryDataRequest, ::Hash]
833
+ # A request object representing the call parameters. Required. To specify no
834
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
835
+ # @param options [::Gapic::CallOptions, ::Hash]
836
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
837
+ #
838
+ # @overload query_data(endpoint: nil, serialized_signed_query_request: nil)
839
+ # Pass arguments to `query_data` via keyword arguments. Note that at
840
+ # least one keyword argument is required. To specify no parameters, or to keep all
841
+ # the default parameter values, pass an empty Hash as a request object (see above).
842
+ #
843
+ # @param endpoint [::String]
844
+ # Required. The endpoint to serve the request.
845
+ # Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
846
+ # The location is a region.
847
+ # @param serialized_signed_query_request [::String]
848
+ # Required. A protobuf serialized
849
+ # {::Google::Cloud::UniversalLedger::V1::SignedQueryRequest SignedQueryRequest} to
850
+ # query the Universal Ledger network.
851
+ #
852
+ # @yield [response, operation] Access the result along with the RPC operation
853
+ # @yieldparam response [::Google::Cloud::UniversalLedger::V1::QueryDataResponse]
854
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
855
+ #
856
+ # @return [::Google::Cloud::UniversalLedger::V1::QueryDataResponse]
857
+ #
858
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
859
+ #
860
+ # @example Basic example
861
+ # require "google/cloud/universal_ledger/v1"
862
+ #
863
+ # # Create a client object. The client can be reused for multiple calls.
864
+ # client = Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new
865
+ #
866
+ # # Create a request. To set request fields, pass in keyword arguments.
867
+ # request = Google::Cloud::UniversalLedger::V1::QueryDataRequest.new
868
+ #
869
+ # # Call the query_data method.
870
+ # result = client.query_data request
871
+ #
872
+ # # The returned object is of type Google::Cloud::UniversalLedger::V1::QueryDataResponse.
873
+ # p result
874
+ #
875
+ def query_data request, options = nil
876
+ raise ::ArgumentError, "request must be provided" if request.nil?
877
+
878
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::UniversalLedger::V1::QueryDataRequest
879
+
880
+ # Converts hash and nil to an options object
881
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
882
+
883
+ # Customize the options with defaults
884
+ metadata = @config.rpcs.query_data.metadata.to_h
885
+
886
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
887
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
888
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
889
+ gapic_version: ::Google::Cloud::UniversalLedger::V1::VERSION
890
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
891
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
892
+
893
+ header_params = {}
894
+ if request.endpoint
895
+ header_params["endpoint"] = request.endpoint
896
+ end
897
+
898
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
899
+ metadata[:"x-goog-request-params"] ||= request_params_header
900
+
901
+ options.apply_defaults timeout: @config.rpcs.query_data.timeout,
902
+ metadata: metadata,
903
+ retry_policy: @config.rpcs.query_data.retry_policy
904
+
905
+ options.apply_defaults timeout: @config.timeout,
906
+ metadata: @config.metadata,
907
+ retry_policy: @config.retry_policy
908
+
909
+ @universal_ledger_stub.call_rpc :query_data, request, options: options do |response, operation|
910
+ yield response, operation if block_given?
911
+ end
912
+ rescue ::GRPC::BadStatus => e
913
+ raise ::Google::Cloud::Error.from_error(e)
914
+ end
915
+
916
+ ##
917
+ # Configuration class for the UniversalLedger API.
918
+ #
919
+ # This class represents the configuration for UniversalLedger,
920
+ # providing control over timeouts, retry behavior, logging, transport
921
+ # parameters, and other low-level controls. Certain parameters can also be
922
+ # applied individually to specific RPCs. See
923
+ # {::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client::Configuration::Rpcs}
924
+ # for a list of RPCs that can be configured independently.
925
+ #
926
+ # Configuration can be applied globally to all clients, or to a single client
927
+ # on construction.
928
+ #
929
+ # @example
930
+ #
931
+ # # Modify the global config, setting the timeout for
932
+ # # submit_transaction to 20 seconds,
933
+ # # and all remaining timeouts to 10 seconds.
934
+ # ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.configure do |config|
935
+ # config.timeout = 10.0
936
+ # config.rpcs.submit_transaction.timeout = 20.0
937
+ # end
938
+ #
939
+ # # Apply the above configuration only to a new client.
940
+ # client = ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new do |config|
941
+ # config.timeout = 10.0
942
+ # config.rpcs.submit_transaction.timeout = 20.0
943
+ # end
944
+ #
945
+ # @!attribute [rw] endpoint
946
+ # A custom service endpoint, as a hostname or hostname:port. The default is
947
+ # nil, indicating to use the default endpoint in the current universe domain.
948
+ # @return [::String,nil]
949
+ # @!attribute [rw] credentials
950
+ # Credentials to send with calls. You may provide any of the following types:
951
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
952
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
953
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
954
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
955
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
956
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
957
+ # * (`nil`) indicating no credentials
958
+ #
959
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
960
+ # is deprecated. Providing an unvalidated credential configuration to
961
+ # Google APIs can compromise the security of your systems and data.
962
+ #
963
+ # @example
964
+ #
965
+ # # The recommended way to provide credentials is to use the `make_creds` method
966
+ # # on the appropriate credentials class for your environment.
967
+ #
968
+ # require "googleauth"
969
+ #
970
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
971
+ # json_key_io: ::File.open("/path/to/keyfile.json")
972
+ # )
973
+ #
974
+ # client = ::Google::Cloud::UniversalLedger::V1::UniversalLedger::Client.new do |config|
975
+ # config.credentials = credentials
976
+ # end
977
+ #
978
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
979
+ # external source for authentication to Google Cloud, you must validate it before
980
+ # providing it to a Google API client library. Providing an unvalidated credential
981
+ # configuration to Google APIs can compromise the security of your systems and data.
982
+ # For more information, refer to [Validate credential configurations from external
983
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
984
+ # @return [::Object]
985
+ # @!attribute [rw] scope
986
+ # The OAuth scopes
987
+ # @return [::Array<::String>]
988
+ # @!attribute [rw] lib_name
989
+ # The library name as recorded in instrumentation and logging
990
+ # @return [::String]
991
+ # @!attribute [rw] lib_version
992
+ # The library version as recorded in instrumentation and logging
993
+ # @return [::String]
994
+ # @!attribute [rw] channel_args
995
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
996
+ # `GRPC::Core::Channel` object is provided as the credential.
997
+ # @return [::Hash]
998
+ # @!attribute [rw] interceptors
999
+ # An array of interceptors that are run before calls are executed.
1000
+ # @return [::Array<::GRPC::ClientInterceptor>]
1001
+ # @!attribute [rw] timeout
1002
+ # The call timeout in seconds.
1003
+ # @return [::Numeric]
1004
+ # @!attribute [rw] metadata
1005
+ # Additional gRPC headers to be sent with the call.
1006
+ # @return [::Hash{::Symbol=>::String}]
1007
+ # @!attribute [rw] retry_policy
1008
+ # The retry policy. The value is a hash with the following keys:
1009
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1010
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1011
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1012
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1013
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1014
+ # trigger a retry.
1015
+ # @return [::Hash]
1016
+ # @!attribute [rw] quota_project
1017
+ # A separate project against which to charge quota.
1018
+ # @return [::String]
1019
+ # @!attribute [rw] universe_domain
1020
+ # The universe domain within which to make requests. This determines the
1021
+ # default endpoint URL. The default value of nil uses the environment
1022
+ # universe (usually the default "googleapis.com" universe).
1023
+ # @return [::String,nil]
1024
+ # @!attribute [rw] logger
1025
+ # A custom logger to use for request/response debug logging, or the value
1026
+ # `:default` (the default) to construct a default logger, or `nil` to
1027
+ # explicitly disable logging.
1028
+ # @return [::Logger,:default,nil]
1029
+ #
1030
+ class Configuration
1031
+ extend ::Gapic::Config
1032
+
1033
+ # @private
1034
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1035
+ DEFAULT_ENDPOINT = "universalledger.googleapis.com"
1036
+
1037
+ config_attr :endpoint, nil, ::String, nil
1038
+ config_attr :credentials, nil do |value|
1039
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1040
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1041
+ allowed.any? { |klass| klass === value }
1042
+ end
1043
+ config_attr :scope, nil, ::String, ::Array, nil
1044
+ config_attr :lib_name, nil, ::String, nil
1045
+ config_attr :lib_version, nil, ::String, nil
1046
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1047
+ config_attr :interceptors, nil, ::Array, nil
1048
+ config_attr :timeout, nil, ::Numeric, nil
1049
+ config_attr :metadata, nil, ::Hash, nil
1050
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1051
+ config_attr :quota_project, nil, ::String, nil
1052
+ config_attr :universe_domain, nil, ::String, nil
1053
+ config_attr :logger, :default, ::Logger, nil, :default
1054
+
1055
+ # @private
1056
+ def initialize parent_config = nil
1057
+ @parent_config = parent_config unless parent_config.nil?
1058
+
1059
+ yield self if block_given?
1060
+ end
1061
+
1062
+ ##
1063
+ # Configurations for individual RPCs
1064
+ # @return [Rpcs]
1065
+ #
1066
+ def rpcs
1067
+ @rpcs ||= begin
1068
+ parent_rpcs = nil
1069
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1070
+ Rpcs.new parent_rpcs
1071
+ end
1072
+ end
1073
+
1074
+ ##
1075
+ # Configuration for the channel pool
1076
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1077
+ #
1078
+ def channel_pool
1079
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1080
+ end
1081
+
1082
+ ##
1083
+ # Configuration RPC class for the UniversalLedger API.
1084
+ #
1085
+ # Includes fields providing the configuration for each RPC in this service.
1086
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1087
+ # the following configuration fields:
1088
+ #
1089
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1090
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1091
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1092
+ # include the following keys:
1093
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1094
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1095
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1096
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1097
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1098
+ # trigger a retry.
1099
+ #
1100
+ class Rpcs
1101
+ ##
1102
+ # RPC-specific configuration for `submit_transaction`
1103
+ # @return [::Gapic::Config::Method]
1104
+ #
1105
+ attr_reader :submit_transaction
1106
+ ##
1107
+ # RPC-specific configuration for `list_endpoints`
1108
+ # @return [::Gapic::Config::Method]
1109
+ #
1110
+ attr_reader :list_endpoints
1111
+ ##
1112
+ # RPC-specific configuration for `get_endpoint`
1113
+ # @return [::Gapic::Config::Method]
1114
+ #
1115
+ attr_reader :get_endpoint
1116
+ ##
1117
+ # RPC-specific configuration for `submit_operational_transaction`
1118
+ # @return [::Gapic::Config::Method]
1119
+ #
1120
+ attr_reader :submit_operational_transaction
1121
+ ##
1122
+ # RPC-specific configuration for `query_transaction_state`
1123
+ # @return [::Gapic::Config::Method]
1124
+ #
1125
+ attr_reader :query_transaction_state
1126
+ ##
1127
+ # RPC-specific configuration for `query_account`
1128
+ # @return [::Gapic::Config::Method]
1129
+ #
1130
+ attr_reader :query_account
1131
+ ##
1132
+ # RPC-specific configuration for `query_data`
1133
+ # @return [::Gapic::Config::Method]
1134
+ #
1135
+ attr_reader :query_data
1136
+
1137
+ # @private
1138
+ def initialize parent_rpcs = nil
1139
+ submit_transaction_config = parent_rpcs.submit_transaction if parent_rpcs.respond_to? :submit_transaction
1140
+ @submit_transaction = ::Gapic::Config::Method.new submit_transaction_config
1141
+ list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints
1142
+ @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config
1143
+ get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint
1144
+ @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config
1145
+ submit_operational_transaction_config = parent_rpcs.submit_operational_transaction if parent_rpcs.respond_to? :submit_operational_transaction
1146
+ @submit_operational_transaction = ::Gapic::Config::Method.new submit_operational_transaction_config
1147
+ query_transaction_state_config = parent_rpcs.query_transaction_state if parent_rpcs.respond_to? :query_transaction_state
1148
+ @query_transaction_state = ::Gapic::Config::Method.new query_transaction_state_config
1149
+ query_account_config = parent_rpcs.query_account if parent_rpcs.respond_to? :query_account
1150
+ @query_account = ::Gapic::Config::Method.new query_account_config
1151
+ query_data_config = parent_rpcs.query_data if parent_rpcs.respond_to? :query_data
1152
+ @query_data = ::Gapic::Config::Method.new query_data_config
1153
+
1154
+ yield self if block_given?
1155
+ end
1156
+ end
1157
+ end
1158
+ end
1159
+ end
1160
+ end
1161
+ end
1162
+ end
1163
+ end