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