google-cloud-spanner-admin-instance-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) 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-admin-instance-v1.rb +21 -0
  7. data/lib/google/cloud/spanner/admin/instance/v1.rb +39 -0
  8. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb +74 -0
  9. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb +1291 -0
  10. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb +56 -0
  11. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb +574 -0
  12. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb +85 -0
  13. data/lib/google/cloud/spanner/admin/instance/v1/version.rb +32 -0
  14. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +128 -0
  15. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +182 -0
  16. data/proto_docs/README.md +4 -0
  17. data/proto_docs/google/api/field_behavior.rb +59 -0
  18. data/proto_docs/google/api/resource.rb +247 -0
  19. data/proto_docs/google/iam/v1/iam_policy.rb +80 -0
  20. data/proto_docs/google/iam/v1/options.rb +40 -0
  21. data/proto_docs/google/iam/v1/policy.rb +248 -0
  22. data/proto_docs/google/longrunning/operations.rb +150 -0
  23. data/proto_docs/google/protobuf/any.rb +138 -0
  24. data/proto_docs/google/protobuf/empty.rb +36 -0
  25. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  26. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  27. data/proto_docs/google/rpc/status.rb +46 -0
  28. data/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb +391 -0
  29. data/proto_docs/google/type/expr.rb +52 -0
  30. metadata +231 -0
@@ -0,0 +1,56 @@
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
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Spanner
24
+ module Admin
25
+ module Instance
26
+ module V1
27
+ module InstanceAdmin
28
+ # Credentials for the InstanceAdmin API.
29
+ class Credentials < ::Google::Auth::Credentials
30
+ self.scope = [
31
+ "https://www.googleapis.com/auth/cloud-platform",
32
+ "https://www.googleapis.com/auth/spanner.admin"
33
+ ]
34
+ self.env_vars = [
35
+ "SPANNER_INSTANCE_ADMIN_CREDENTIALS",
36
+ "SPANNER_INSTANCE_ADMIN_KEYFILE",
37
+ "GOOGLE_CLOUD_CREDENTIALS",
38
+ "GOOGLE_CLOUD_KEYFILE",
39
+ "GCLOUD_KEYFILE",
40
+ "SPANNER_INSTANCE_ADMIN_CREDENTIALS_JSON",
41
+ "SPANNER_INSTANCE_ADMIN_KEYFILE_JSON",
42
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
43
+ "GOOGLE_CLOUD_KEYFILE_JSON",
44
+ "GCLOUD_KEYFILE_JSON"
45
+ ]
46
+ self.paths = [
47
+ "~/.config/google_cloud/application_default_credentials.json"
48
+ ]
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,574 @@
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
+ require "gapic/operation"
20
+ require "google/longrunning/operations_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Spanner
25
+ module Admin
26
+ module Instance
27
+ module V1
28
+ module InstanceAdmin
29
+ # Service that implements Longrunning Operations API.
30
+ class Operations
31
+ # @private
32
+ attr_reader :operations_stub
33
+
34
+ ##
35
+ # Configuration for the InstanceAdmin Operations API.
36
+ #
37
+ # @yield [config] Configure the Operations client.
38
+ # @yieldparam config [Operations::Configuration]
39
+ #
40
+ # @return [Operations::Configuration]
41
+ #
42
+ def self.configure
43
+ @configure ||= Operations::Configuration.new
44
+ yield @configure if block_given?
45
+ @configure
46
+ end
47
+
48
+ ##
49
+ # Configure the InstanceAdmin Operations instance.
50
+ #
51
+ # The configuration is set to the derived mode, meaning that values can be changed,
52
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
53
+ # should be made on {Operations.configure}.
54
+ #
55
+ # @yield [config] Configure the Operations client.
56
+ # @yieldparam config [Operations::Configuration]
57
+ #
58
+ # @return [Operations::Configuration]
59
+ #
60
+ def configure
61
+ yield @config if block_given?
62
+ @config
63
+ end
64
+
65
+ ##
66
+ # Create a new Operations client object.
67
+ #
68
+ # @yield [config] Configure the Client client.
69
+ # @yieldparam config [Operations::Configuration]
70
+ #
71
+ def initialize
72
+ # These require statements are intentionally placed here to initialize
73
+ # the gRPC module only when it's required.
74
+ # See https://github.com/googleapis/toolkit/issues/446
75
+ require "gapic/grpc"
76
+ require "google/longrunning/operations_services_pb"
77
+
78
+ # Create the configuration object
79
+ @config = Configuration.new Operations.configure
80
+
81
+ # Yield the configuration if needed
82
+ yield @config if block_given?
83
+
84
+ # Create credentials
85
+ credentials = @config.credentials
86
+ credentials ||= Credentials.default scope: @config.scope
87
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
88
+ credentials = Credentials.new credentials, scope: @config.scope
89
+ end
90
+ @quota_project_id = @config.quota_project
91
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
92
+
93
+ @operations_stub = ::Gapic::ServiceStub.new(
94
+ ::Google::Longrunning::Operations::Stub,
95
+ credentials: credentials,
96
+ endpoint: @config.endpoint,
97
+ channel_args: @config.channel_args,
98
+ interceptors: @config.interceptors
99
+ )
100
+ end
101
+
102
+ # Service calls
103
+
104
+ ##
105
+ # Lists operations that match the specified filter in the request. If the
106
+ # server doesn't support this method, it returns `UNIMPLEMENTED`.
107
+ #
108
+ # NOTE: the `name` binding below allows API services to override the binding
109
+ # to use different resource name schemes, such as `users/*/operations`.
110
+ #
111
+ # @overload list_operations(request, options = nil)
112
+ # Pass arguments to `list_operations` via a request object, either of type
113
+ # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
114
+ #
115
+ # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash]
116
+ # A request object representing the call parameters. Required. To specify no
117
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
118
+ # @param options [::Gapic::CallOptions, ::Hash]
119
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
120
+ #
121
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
122
+ # Pass arguments to `list_operations` via keyword arguments. Note that at
123
+ # least one keyword argument is required. To specify no parameters, or to keep all
124
+ # the default parameter values, pass an empty Hash as a request object (see above).
125
+ #
126
+ # @param name [::String]
127
+ # The name of the operation collection.
128
+ # @param filter [::String]
129
+ # The standard list filter.
130
+ # @param page_size [::Integer]
131
+ # The standard list page size.
132
+ # @param page_token [::String]
133
+ # The standard list page token.
134
+ #
135
+ # @yield [response, operation] Access the result along with the RPC operation
136
+ # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
137
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
138
+ #
139
+ # @return [::Gapic::PagedEnumerable<::Gapic::Operation>]
140
+ #
141
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
142
+ #
143
+ def list_operations request, options = nil
144
+ raise ::ArgumentError, "request must be provided" if request.nil?
145
+
146
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest
147
+
148
+ # Converts hash and nil to an options object
149
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
150
+
151
+ # Customize the options with defaults
152
+ metadata = @config.rpcs.list_operations.metadata.to_h
153
+
154
+ # Set x-goog-api-client and x-goog-user-project headers
155
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
156
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
157
+ gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
158
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
159
+
160
+ header_params = {
161
+ "name" => request.name
162
+ }
163
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
164
+ metadata[:"x-goog-request-params"] ||= request_params_header
165
+
166
+ options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
167
+ metadata: metadata,
168
+ retry_policy: @config.rpcs.list_operations.retry_policy
169
+ options.apply_defaults metadata: @config.metadata,
170
+ retry_policy: @config.retry_policy
171
+
172
+ @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
173
+ wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
174
+ response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
175
+ yield response, operation if block_given?
176
+ return response
177
+ end
178
+ rescue ::GRPC::BadStatus => e
179
+ raise ::Google::Cloud::Error.from_error(e)
180
+ end
181
+
182
+ ##
183
+ # Gets the latest state of a long-running operation. Clients can use this
184
+ # method to poll the operation result at intervals as recommended by the API
185
+ # service.
186
+ #
187
+ # @overload get_operation(request, options = nil)
188
+ # Pass arguments to `get_operation` via a request object, either of type
189
+ # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash.
190
+ #
191
+ # @param request [::Google::Longrunning::GetOperationRequest, ::Hash]
192
+ # A request object representing the call parameters. Required. To specify no
193
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
194
+ # @param options [::Gapic::CallOptions, ::Hash]
195
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
196
+ #
197
+ # @overload get_operation(name: nil)
198
+ # Pass arguments to `get_operation` via keyword arguments. Note that at
199
+ # least one keyword argument is required. To specify no parameters, or to keep all
200
+ # the default parameter values, pass an empty Hash as a request object (see above).
201
+ #
202
+ # @param name [::String]
203
+ # The name of the operation resource.
204
+ #
205
+ # @yield [response, operation] Access the result along with the RPC operation
206
+ # @yieldparam response [::Gapic::Operation]
207
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
208
+ #
209
+ # @return [::Gapic::Operation]
210
+ #
211
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
212
+ #
213
+ def get_operation request, options = nil
214
+ raise ::ArgumentError, "request must be provided" if request.nil?
215
+
216
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
217
+
218
+ # Converts hash and nil to an options object
219
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
220
+
221
+ # Customize the options with defaults
222
+ metadata = @config.rpcs.get_operation.metadata.to_h
223
+
224
+ # Set x-goog-api-client and x-goog-user-project headers
225
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
226
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
227
+ gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
228
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
229
+
230
+ header_params = {
231
+ "name" => request.name
232
+ }
233
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
234
+ metadata[:"x-goog-request-params"] ||= request_params_header
235
+
236
+ options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
237
+ metadata: metadata,
238
+ retry_policy: @config.rpcs.get_operation.retry_policy
239
+ options.apply_defaults metadata: @config.metadata,
240
+ retry_policy: @config.retry_policy
241
+
242
+ @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
243
+ response = ::Gapic::Operation.new response, @operations_client, options: options
244
+ yield response, operation if block_given?
245
+ return response
246
+ end
247
+ rescue ::GRPC::BadStatus => e
248
+ raise ::Google::Cloud::Error.from_error(e)
249
+ end
250
+
251
+ ##
252
+ # Deletes a long-running operation. This method indicates that the client is
253
+ # no longer interested in the operation result. It does not cancel the
254
+ # operation. If the server doesn't support this method, it returns
255
+ # `google.rpc.Code.UNIMPLEMENTED`.
256
+ #
257
+ # @overload delete_operation(request, options = nil)
258
+ # Pass arguments to `delete_operation` via a request object, either of type
259
+ # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
260
+ #
261
+ # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash]
262
+ # A request object representing the call parameters. Required. To specify no
263
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
264
+ # @param options [::Gapic::CallOptions, ::Hash]
265
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
266
+ #
267
+ # @overload delete_operation(name: nil)
268
+ # Pass arguments to `delete_operation` via keyword arguments. Note that at
269
+ # least one keyword argument is required. To specify no parameters, or to keep all
270
+ # the default parameter values, pass an empty Hash as a request object (see above).
271
+ #
272
+ # @param name [::String]
273
+ # The name of the operation resource to be deleted.
274
+ #
275
+ # @yield [response, operation] Access the result along with the RPC operation
276
+ # @yieldparam response [::Google::Protobuf::Empty]
277
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
278
+ #
279
+ # @return [::Google::Protobuf::Empty]
280
+ #
281
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
282
+ #
283
+ def delete_operation request, options = nil
284
+ raise ::ArgumentError, "request must be provided" if request.nil?
285
+
286
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest
287
+
288
+ # Converts hash and nil to an options object
289
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
290
+
291
+ # Customize the options with defaults
292
+ metadata = @config.rpcs.delete_operation.metadata.to_h
293
+
294
+ # Set x-goog-api-client and x-goog-user-project headers
295
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
296
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
297
+ gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
298
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
299
+
300
+ header_params = {
301
+ "name" => request.name
302
+ }
303
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
304
+ metadata[:"x-goog-request-params"] ||= request_params_header
305
+
306
+ options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
307
+ metadata: metadata,
308
+ retry_policy: @config.rpcs.delete_operation.retry_policy
309
+ options.apply_defaults metadata: @config.metadata,
310
+ retry_policy: @config.retry_policy
311
+
312
+ @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
313
+ yield response, operation if block_given?
314
+ return response
315
+ end
316
+ rescue ::GRPC::BadStatus => e
317
+ raise ::Google::Cloud::Error.from_error(e)
318
+ end
319
+
320
+ ##
321
+ # Starts asynchronous cancellation on a long-running operation. The server
322
+ # makes a best effort to cancel the operation, but success is not
323
+ # guaranteed. If the server doesn't support this method, it returns
324
+ # `google.rpc.Code.UNIMPLEMENTED`. Clients can use
325
+ # Operations.GetOperation or
326
+ # other methods to check whether the cancellation succeeded or whether the
327
+ # operation completed despite cancellation. On successful cancellation,
328
+ # the operation is not deleted; instead, it becomes an operation with
329
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
330
+ # corresponding to `Code.CANCELLED`.
331
+ #
332
+ # @overload cancel_operation(request, options = nil)
333
+ # Pass arguments to `cancel_operation` via a request object, either of type
334
+ # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
335
+ #
336
+ # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash]
337
+ # A request object representing the call parameters. Required. To specify no
338
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
339
+ # @param options [::Gapic::CallOptions, ::Hash]
340
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
341
+ #
342
+ # @overload cancel_operation(name: nil)
343
+ # Pass arguments to `cancel_operation` via keyword arguments. Note that at
344
+ # least one keyword argument is required. To specify no parameters, or to keep all
345
+ # the default parameter values, pass an empty Hash as a request object (see above).
346
+ #
347
+ # @param name [::String]
348
+ # The name of the operation resource to be cancelled.
349
+ #
350
+ # @yield [response, operation] Access the result along with the RPC operation
351
+ # @yieldparam response [::Google::Protobuf::Empty]
352
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
353
+ #
354
+ # @return [::Google::Protobuf::Empty]
355
+ #
356
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
357
+ #
358
+ def cancel_operation request, options = nil
359
+ raise ::ArgumentError, "request must be provided" if request.nil?
360
+
361
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest
362
+
363
+ # Converts hash and nil to an options object
364
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
365
+
366
+ # Customize the options with defaults
367
+ metadata = @config.rpcs.cancel_operation.metadata.to_h
368
+
369
+ # Set x-goog-api-client and x-goog-user-project headers
370
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
371
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
372
+ gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
373
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
374
+
375
+ header_params = {
376
+ "name" => request.name
377
+ }
378
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
379
+ metadata[:"x-goog-request-params"] ||= request_params_header
380
+
381
+ options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
382
+ metadata: metadata,
383
+ retry_policy: @config.rpcs.cancel_operation.retry_policy
384
+ options.apply_defaults metadata: @config.metadata,
385
+ retry_policy: @config.retry_policy
386
+
387
+ @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
388
+ yield response, operation if block_given?
389
+ return response
390
+ end
391
+ rescue ::GRPC::BadStatus => e
392
+ raise ::Google::Cloud::Error.from_error(e)
393
+ end
394
+
395
+ ##
396
+ # Configuration class for the Operations API.
397
+ #
398
+ # This class represents the configuration for Operations,
399
+ # providing control over timeouts, retry behavior, logging, transport
400
+ # parameters, and other low-level controls. Certain parameters can also be
401
+ # applied individually to specific RPCs. See
402
+ # {::Google::Longrunning::Operations::Client::Configuration::Rpcs}
403
+ # for a list of RPCs that can be configured independently.
404
+ #
405
+ # Configuration can be applied globally to all clients, or to a single client
406
+ # on construction.
407
+ #
408
+ # # Examples
409
+ #
410
+ # To modify the global config, setting the timeout for list_operations
411
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
412
+ #
413
+ # ::Google::Longrunning::Operations::Client.configure do |config|
414
+ # config.timeout = 10.0
415
+ # config.rpcs.list_operations.timeout = 20.0
416
+ # end
417
+ #
418
+ # To apply the above configuration only to a new client:
419
+ #
420
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
421
+ # config.timeout = 10.0
422
+ # config.rpcs.list_operations.timeout = 20.0
423
+ # end
424
+ #
425
+ # @!attribute [rw] endpoint
426
+ # The hostname or hostname:port of the service endpoint.
427
+ # Defaults to `"spanner.googleapis.com"`.
428
+ # @return [::String]
429
+ # @!attribute [rw] credentials
430
+ # Credentials to send with calls. You may provide any of the following types:
431
+ # * (`String`) The path to a service account key file in JSON format
432
+ # * (`Hash`) A service account key as a Hash
433
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
434
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
435
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
436
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
437
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
438
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
439
+ # * (`nil`) indicating no credentials
440
+ # @return [::Object]
441
+ # @!attribute [rw] scope
442
+ # The OAuth scopes
443
+ # @return [::Array<::String>]
444
+ # @!attribute [rw] lib_name
445
+ # The library name as recorded in instrumentation and logging
446
+ # @return [::String]
447
+ # @!attribute [rw] lib_version
448
+ # The library version as recorded in instrumentation and logging
449
+ # @return [::String]
450
+ # @!attribute [rw] channel_args
451
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
452
+ # `GRPC::Core::Channel` object is provided as the credential.
453
+ # @return [::Hash]
454
+ # @!attribute [rw] interceptors
455
+ # An array of interceptors that are run before calls are executed.
456
+ # @return [::Array<::GRPC::ClientInterceptor>]
457
+ # @!attribute [rw] timeout
458
+ # The call timeout in seconds.
459
+ # @return [::Numeric]
460
+ # @!attribute [rw] metadata
461
+ # Additional gRPC headers to be sent with the call.
462
+ # @return [::Hash{::Symbol=>::String}]
463
+ # @!attribute [rw] retry_policy
464
+ # The retry policy. The value is a hash with the following keys:
465
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
466
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
467
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
468
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
469
+ # trigger a retry.
470
+ # @return [::Hash]
471
+ # @!attribute [rw] quota_project
472
+ # A separate project against which to charge quota.
473
+ # @return [::String]
474
+ #
475
+ class Configuration
476
+ extend ::Gapic::Config
477
+
478
+ config_attr :endpoint, "spanner.googleapis.com", ::String
479
+ config_attr :credentials, nil do |value|
480
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
481
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
482
+ allowed.any? { |klass| klass === value }
483
+ end
484
+ config_attr :scope, nil, ::String, ::Array, nil
485
+ config_attr :lib_name, nil, ::String, nil
486
+ config_attr :lib_version, nil, ::String, nil
487
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
488
+ config_attr :interceptors, nil, ::Array, nil
489
+ config_attr :timeout, nil, ::Numeric, nil
490
+ config_attr :metadata, nil, ::Hash, nil
491
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
492
+ config_attr :quota_project, nil, ::String, nil
493
+
494
+ # @private
495
+ def initialize parent_config = nil
496
+ @parent_config = parent_config unless parent_config.nil?
497
+
498
+ yield self if block_given?
499
+ end
500
+
501
+ ##
502
+ # Configurations for individual RPCs
503
+ # @return [Rpcs]
504
+ #
505
+ def rpcs
506
+ @rpcs ||= begin
507
+ parent_rpcs = nil
508
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
509
+ Rpcs.new parent_rpcs
510
+ end
511
+ end
512
+
513
+ ##
514
+ # Configuration RPC class for the Operations API.
515
+ #
516
+ # Includes fields providing the configuration for each RPC in this service.
517
+ # Each configuration object is of type `Gapic::Config::Method` and includes
518
+ # the following configuration fields:
519
+ #
520
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
521
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
522
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
523
+ # include the following keys:
524
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
525
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
526
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
527
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
528
+ # trigger a retry.
529
+ #
530
+ class Rpcs
531
+ ##
532
+ # RPC-specific configuration for `list_operations`
533
+ # @return [::Gapic::Config::Method]
534
+ #
535
+ attr_reader :list_operations
536
+ ##
537
+ # RPC-specific configuration for `get_operation`
538
+ # @return [::Gapic::Config::Method]
539
+ #
540
+ attr_reader :get_operation
541
+ ##
542
+ # RPC-specific configuration for `delete_operation`
543
+ # @return [::Gapic::Config::Method]
544
+ #
545
+ attr_reader :delete_operation
546
+ ##
547
+ # RPC-specific configuration for `cancel_operation`
548
+ # @return [::Gapic::Config::Method]
549
+ #
550
+ attr_reader :cancel_operation
551
+
552
+ # @private
553
+ def initialize parent_rpcs = nil
554
+ list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
555
+ @list_operations = ::Gapic::Config::Method.new list_operations_config
556
+ get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
557
+ @get_operation = ::Gapic::Config::Method.new get_operation_config
558
+ delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
559
+ @delete_operation = ::Gapic::Config::Method.new delete_operation_config
560
+ cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
561
+ @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
562
+
563
+ yield self if block_given?
564
+ end
565
+ end
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end
571
+ end
572
+ end
573
+ end
574
+ end