google-cloud-parallelstore-v1beta 0.a → 0.1.0

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