google-cloud-parallelstore-v1beta 0.a → 0.2.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 (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 +1194 -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 +122 -0
  10. data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest/client.rb +1126 -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 +566 -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,1194 @@
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, service_account: 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
+ # @param service_account [::String]
782
+ # Optional. User-specified Service Account (SA) credentials to be used when
783
+ # performing the transfer.
784
+ # Format: `projects/{project_id}/serviceAccounts/{service_account}`
785
+ # If unspecified, the Parallelstore service agent is used:
786
+ # service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com)
787
+ #
788
+ # @yield [response, operation] Access the result along with the RPC operation
789
+ # @yieldparam response [::Gapic::Operation]
790
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
791
+ #
792
+ # @return [::Gapic::Operation]
793
+ #
794
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
795
+ #
796
+ # @example Basic example
797
+ # require "google/cloud/parallelstore/v1beta"
798
+ #
799
+ # # Create a client object. The client can be reused for multiple calls.
800
+ # client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Client.new
801
+ #
802
+ # # Create a request. To set request fields, pass in keyword arguments.
803
+ # request = Google::Cloud::Parallelstore::V1beta::ImportDataRequest.new
804
+ #
805
+ # # Call the import_data method.
806
+ # result = client.import_data request
807
+ #
808
+ # # The returned object is of type Gapic::Operation. You can use it to
809
+ # # check the status of an operation, cancel it, or wait for results.
810
+ # # Here is how to wait for a response.
811
+ # result.wait_until_done! timeout: 60
812
+ # if result.response?
813
+ # p result.response
814
+ # else
815
+ # puts "No response received."
816
+ # end
817
+ #
818
+ def import_data request, options = nil
819
+ raise ::ArgumentError, "request must be provided" if request.nil?
820
+
821
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::ImportDataRequest
822
+
823
+ # Converts hash and nil to an options object
824
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
825
+
826
+ # Customize the options with defaults
827
+ metadata = @config.rpcs.import_data.metadata.to_h
828
+
829
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
830
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
831
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
832
+ gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION
833
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
834
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
835
+
836
+ header_params = {}
837
+ if request.name
838
+ header_params["name"] = request.name
839
+ end
840
+
841
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
842
+ metadata[:"x-goog-request-params"] ||= request_params_header
843
+
844
+ options.apply_defaults timeout: @config.rpcs.import_data.timeout,
845
+ metadata: metadata,
846
+ retry_policy: @config.rpcs.import_data.retry_policy
847
+
848
+ options.apply_defaults timeout: @config.timeout,
849
+ metadata: @config.metadata,
850
+ retry_policy: @config.retry_policy
851
+
852
+ @parallelstore_stub.call_rpc :import_data, request, options: options do |response, operation|
853
+ response = ::Gapic::Operation.new response, @operations_client, options: options
854
+ yield response, operation if block_given?
855
+ return response
856
+ end
857
+ rescue ::GRPC::BadStatus => e
858
+ raise ::Google::Cloud::Error.from_error(e)
859
+ end
860
+
861
+ ##
862
+ # ExportData copies data from Parallelstore to Cloud Storage
863
+ #
864
+ # @overload export_data(request, options = nil)
865
+ # Pass arguments to `export_data` via a request object, either of type
866
+ # {::Google::Cloud::Parallelstore::V1beta::ExportDataRequest} or an equivalent Hash.
867
+ #
868
+ # @param request [::Google::Cloud::Parallelstore::V1beta::ExportDataRequest, ::Hash]
869
+ # A request object representing the call parameters. Required. To specify no
870
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
871
+ # @param options [::Gapic::CallOptions, ::Hash]
872
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
873
+ #
874
+ # @overload export_data(source_parallelstore: nil, destination_gcs_bucket: nil, name: nil, request_id: nil, service_account: nil)
875
+ # Pass arguments to `export_data` via keyword arguments. Note that at
876
+ # least one keyword argument is required. To specify no parameters, or to keep all
877
+ # the default parameter values, pass an empty Hash as a request object (see above).
878
+ #
879
+ # @param source_parallelstore [::Google::Cloud::Parallelstore::V1beta::SourceParallelstore, ::Hash]
880
+ # Parallelstore source.
881
+ # @param destination_gcs_bucket [::Google::Cloud::Parallelstore::V1beta::DestinationGcsBucket, ::Hash]
882
+ # Cloud Storage destination.
883
+ # @param name [::String]
884
+ # Required. Name of the resource.
885
+ # @param request_id [::String]
886
+ # Optional. An optional request ID to identify requests. Specify a unique
887
+ # request ID so that if you must retry your request, the server will know to
888
+ # ignore the request if it has already been completed. The server will
889
+ # guarantee that for at least 60 minutes since the first request.
890
+ #
891
+ # For example, consider a situation where you make an initial request and t
892
+ # he request times out. If you make the request again with the same request
893
+ # ID, the server can check if original operation with the same request ID
894
+ # was received, and if so, will ignore the second request. This prevents
895
+ # clients from accidentally creating duplicate commitments.
896
+ #
897
+ # The request ID must be a valid UUID with the exception that zero UUID is
898
+ # not supported (00000000-0000-0000-0000-000000000000).
899
+ # @param service_account [::String]
900
+ # Optional. User-specified Service Account (SA) credentials to be used when
901
+ # performing the transfer.
902
+ # Format: `projects/{project_id}/serviceAccounts/{service_account}`
903
+ # If unspecified, the Parallelstore service agent is used:
904
+ # service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com)
905
+ #
906
+ # @yield [response, operation] Access the result along with the RPC operation
907
+ # @yieldparam response [::Gapic::Operation]
908
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
909
+ #
910
+ # @return [::Gapic::Operation]
911
+ #
912
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
913
+ #
914
+ # @example Basic example
915
+ # require "google/cloud/parallelstore/v1beta"
916
+ #
917
+ # # Create a client object. The client can be reused for multiple calls.
918
+ # client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Client.new
919
+ #
920
+ # # Create a request. To set request fields, pass in keyword arguments.
921
+ # request = Google::Cloud::Parallelstore::V1beta::ExportDataRequest.new
922
+ #
923
+ # # Call the export_data method.
924
+ # result = client.export_data request
925
+ #
926
+ # # The returned object is of type Gapic::Operation. You can use it to
927
+ # # check the status of an operation, cancel it, or wait for results.
928
+ # # Here is how to wait for a response.
929
+ # result.wait_until_done! timeout: 60
930
+ # if result.response?
931
+ # p result.response
932
+ # else
933
+ # puts "No response received."
934
+ # end
935
+ #
936
+ def export_data request, options = nil
937
+ raise ::ArgumentError, "request must be provided" if request.nil?
938
+
939
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::ExportDataRequest
940
+
941
+ # Converts hash and nil to an options object
942
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
943
+
944
+ # Customize the options with defaults
945
+ metadata = @config.rpcs.export_data.metadata.to_h
946
+
947
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
948
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
949
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
950
+ gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION
951
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
952
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
953
+
954
+ header_params = {}
955
+ if request.name
956
+ header_params["name"] = request.name
957
+ end
958
+
959
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
960
+ metadata[:"x-goog-request-params"] ||= request_params_header
961
+
962
+ options.apply_defaults timeout: @config.rpcs.export_data.timeout,
963
+ metadata: metadata,
964
+ retry_policy: @config.rpcs.export_data.retry_policy
965
+
966
+ options.apply_defaults timeout: @config.timeout,
967
+ metadata: @config.metadata,
968
+ retry_policy: @config.retry_policy
969
+
970
+ @parallelstore_stub.call_rpc :export_data, request, options: options do |response, operation|
971
+ response = ::Gapic::Operation.new response, @operations_client, options: options
972
+ yield response, operation if block_given?
973
+ return response
974
+ end
975
+ rescue ::GRPC::BadStatus => e
976
+ raise ::Google::Cloud::Error.from_error(e)
977
+ end
978
+
979
+ ##
980
+ # Configuration class for the Parallelstore API.
981
+ #
982
+ # This class represents the configuration for Parallelstore,
983
+ # providing control over timeouts, retry behavior, logging, transport
984
+ # parameters, and other low-level controls. Certain parameters can also be
985
+ # applied individually to specific RPCs. See
986
+ # {::Google::Cloud::Parallelstore::V1beta::Parallelstore::Client::Configuration::Rpcs}
987
+ # for a list of RPCs that can be configured independently.
988
+ #
989
+ # Configuration can be applied globally to all clients, or to a single client
990
+ # on construction.
991
+ #
992
+ # @example
993
+ #
994
+ # # Modify the global config, setting the timeout for
995
+ # # list_instances to 20 seconds,
996
+ # # and all remaining timeouts to 10 seconds.
997
+ # ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Client.configure do |config|
998
+ # config.timeout = 10.0
999
+ # config.rpcs.list_instances.timeout = 20.0
1000
+ # end
1001
+ #
1002
+ # # Apply the above configuration only to a new client.
1003
+ # client = ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Client.new do |config|
1004
+ # config.timeout = 10.0
1005
+ # config.rpcs.list_instances.timeout = 20.0
1006
+ # end
1007
+ #
1008
+ # @!attribute [rw] endpoint
1009
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1010
+ # nil, indicating to use the default endpoint in the current universe domain.
1011
+ # @return [::String,nil]
1012
+ # @!attribute [rw] credentials
1013
+ # Credentials to send with calls. You may provide any of the following types:
1014
+ # * (`String`) The path to a service account key file in JSON format
1015
+ # * (`Hash`) A service account key as a Hash
1016
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1017
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1018
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1019
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1020
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1021
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1022
+ # * (`nil`) indicating no credentials
1023
+ # @return [::Object]
1024
+ # @!attribute [rw] scope
1025
+ # The OAuth scopes
1026
+ # @return [::Array<::String>]
1027
+ # @!attribute [rw] lib_name
1028
+ # The library name as recorded in instrumentation and logging
1029
+ # @return [::String]
1030
+ # @!attribute [rw] lib_version
1031
+ # The library version as recorded in instrumentation and logging
1032
+ # @return [::String]
1033
+ # @!attribute [rw] channel_args
1034
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1035
+ # `GRPC::Core::Channel` object is provided as the credential.
1036
+ # @return [::Hash]
1037
+ # @!attribute [rw] interceptors
1038
+ # An array of interceptors that are run before calls are executed.
1039
+ # @return [::Array<::GRPC::ClientInterceptor>]
1040
+ # @!attribute [rw] timeout
1041
+ # The call timeout in seconds.
1042
+ # @return [::Numeric]
1043
+ # @!attribute [rw] metadata
1044
+ # Additional gRPC headers to be sent with the call.
1045
+ # @return [::Hash{::Symbol=>::String}]
1046
+ # @!attribute [rw] retry_policy
1047
+ # The retry policy. The value is a hash with the following keys:
1048
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1049
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1050
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1051
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1052
+ # trigger a retry.
1053
+ # @return [::Hash]
1054
+ # @!attribute [rw] quota_project
1055
+ # A separate project against which to charge quota.
1056
+ # @return [::String]
1057
+ # @!attribute [rw] universe_domain
1058
+ # The universe domain within which to make requests. This determines the
1059
+ # default endpoint URL. The default value of nil uses the environment
1060
+ # universe (usually the default "googleapis.com" universe).
1061
+ # @return [::String,nil]
1062
+ #
1063
+ class Configuration
1064
+ extend ::Gapic::Config
1065
+
1066
+ # @private
1067
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1068
+ DEFAULT_ENDPOINT = "parallelstore.googleapis.com"
1069
+
1070
+ config_attr :endpoint, nil, ::String, nil
1071
+ config_attr :credentials, nil do |value|
1072
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1073
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1074
+ allowed.any? { |klass| klass === value }
1075
+ end
1076
+ config_attr :scope, nil, ::String, ::Array, nil
1077
+ config_attr :lib_name, nil, ::String, nil
1078
+ config_attr :lib_version, nil, ::String, nil
1079
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1080
+ config_attr :interceptors, nil, ::Array, nil
1081
+ config_attr :timeout, nil, ::Numeric, nil
1082
+ config_attr :metadata, nil, ::Hash, nil
1083
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1084
+ config_attr :quota_project, nil, ::String, nil
1085
+ config_attr :universe_domain, nil, ::String, nil
1086
+
1087
+ # @private
1088
+ def initialize parent_config = nil
1089
+ @parent_config = parent_config unless parent_config.nil?
1090
+
1091
+ yield self if block_given?
1092
+ end
1093
+
1094
+ ##
1095
+ # Configurations for individual RPCs
1096
+ # @return [Rpcs]
1097
+ #
1098
+ def rpcs
1099
+ @rpcs ||= begin
1100
+ parent_rpcs = nil
1101
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1102
+ Rpcs.new parent_rpcs
1103
+ end
1104
+ end
1105
+
1106
+ ##
1107
+ # Configuration for the channel pool
1108
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1109
+ #
1110
+ def channel_pool
1111
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1112
+ end
1113
+
1114
+ ##
1115
+ # Configuration RPC class for the Parallelstore API.
1116
+ #
1117
+ # Includes fields providing the configuration for each RPC in this service.
1118
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1119
+ # the following configuration fields:
1120
+ #
1121
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1122
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1123
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1124
+ # include the following keys:
1125
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1126
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1127
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1128
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1129
+ # trigger a retry.
1130
+ #
1131
+ class Rpcs
1132
+ ##
1133
+ # RPC-specific configuration for `list_instances`
1134
+ # @return [::Gapic::Config::Method]
1135
+ #
1136
+ attr_reader :list_instances
1137
+ ##
1138
+ # RPC-specific configuration for `get_instance`
1139
+ # @return [::Gapic::Config::Method]
1140
+ #
1141
+ attr_reader :get_instance
1142
+ ##
1143
+ # RPC-specific configuration for `create_instance`
1144
+ # @return [::Gapic::Config::Method]
1145
+ #
1146
+ attr_reader :create_instance
1147
+ ##
1148
+ # RPC-specific configuration for `update_instance`
1149
+ # @return [::Gapic::Config::Method]
1150
+ #
1151
+ attr_reader :update_instance
1152
+ ##
1153
+ # RPC-specific configuration for `delete_instance`
1154
+ # @return [::Gapic::Config::Method]
1155
+ #
1156
+ attr_reader :delete_instance
1157
+ ##
1158
+ # RPC-specific configuration for `import_data`
1159
+ # @return [::Gapic::Config::Method]
1160
+ #
1161
+ attr_reader :import_data
1162
+ ##
1163
+ # RPC-specific configuration for `export_data`
1164
+ # @return [::Gapic::Config::Method]
1165
+ #
1166
+ attr_reader :export_data
1167
+
1168
+ # @private
1169
+ def initialize parent_rpcs = nil
1170
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1171
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
1172
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1173
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
1174
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1175
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
1176
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
1177
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
1178
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1179
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1180
+ import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data
1181
+ @import_data = ::Gapic::Config::Method.new import_data_config
1182
+ export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data
1183
+ @export_data = ::Gapic::Config::Method.new export_data_config
1184
+
1185
+ yield self if block_given?
1186
+ end
1187
+ end
1188
+ end
1189
+ end
1190
+ end
1191
+ end
1192
+ end
1193
+ end
1194
+ end