google-cloud-parallelstore-v1 0.1.0

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