google-cloud-apigee_registry-v1 0.3.1 → 0.5.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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +2 -2
  4. data/lib/google/cloud/apigee_registry/v1/bindings_override.rb +351 -0
  5. data/lib/google/cloud/apigee_registry/v1/provisioning/client.rb +14 -12
  6. data/lib/google/cloud/apigee_registry/v1/provisioning/operations.rb +17 -17
  7. data/lib/google/cloud/apigee_registry/v1/provisioning/rest/client.rb +544 -0
  8. data/lib/google/cloud/apigee_registry/v1/provisioning/rest/operations.rb +795 -0
  9. data/lib/google/cloud/apigee_registry/v1/provisioning/rest/service_stub.rb +226 -0
  10. data/lib/google/cloud/apigee_registry/v1/provisioning/rest.rb +55 -0
  11. data/lib/google/cloud/apigee_registry/v1/provisioning.rb +7 -1
  12. data/lib/google/cloud/apigee_registry/v1/registry/client.rb +34 -46
  13. data/lib/google/cloud/apigee_registry/v1/registry/rest/client.rb +3155 -0
  14. data/lib/google/cloud/apigee_registry/v1/registry/rest/service_stub.rb +2303 -0
  15. data/lib/google/cloud/apigee_registry/v1/registry/rest.rb +53 -0
  16. data/lib/google/cloud/apigee_registry/v1/registry.rb +7 -1
  17. data/lib/google/cloud/apigee_registry/v1/rest.rb +39 -0
  18. data/lib/google/cloud/apigee_registry/v1/version.rb +1 -1
  19. data/lib/google/cloud/apigee_registry/v1.rb +7 -2
  20. data/lib/google/cloud/apigeeregistry/v1/provisioning_service_pb.rb +25 -42
  21. data/lib/google/cloud/apigeeregistry/v1/registry_models_pb.rb +25 -64
  22. data/lib/google/cloud/apigeeregistry/v1/registry_service_pb.rb +26 -179
  23. data/proto_docs/google/api/client.rb +381 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/protobuf/any.rb +7 -4
  26. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  27. data/proto_docs/google/rpc/status.rb +4 -2
  28. metadata +22 -11
@@ -0,0 +1,544 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/apigeeregistry/v1/provisioning_service_pb"
21
+ require "google/cloud/apigee_registry/v1/provisioning/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module ApigeeRegistry
28
+ module V1
29
+ module Provisioning
30
+ module Rest
31
+ ##
32
+ # REST client for the Provisioning service.
33
+ #
34
+ # The service that is used for managing the data plane provisioning of the
35
+ # Registry.
36
+ #
37
+ class Client
38
+ include Paths
39
+
40
+ # @private
41
+ attr_reader :provisioning_stub
42
+
43
+ ##
44
+ # Configure the Provisioning Client class.
45
+ #
46
+ # See {::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all Provisioning clients
52
+ # ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "ApigeeRegistry", "V1"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config
73
+ end
74
+ yield @configure if block_given?
75
+ @configure
76
+ end
77
+
78
+ ##
79
+ # Configure the Provisioning Client instance.
80
+ #
81
+ # The configuration is set to the derived mode, meaning that values can be changed,
82
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
83
+ # should be made on {Client.configure}.
84
+ #
85
+ # See {::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client::Configuration}
86
+ # for a description of the configuration fields.
87
+ #
88
+ # @yield [config] Configure the Client client.
89
+ # @yieldparam config [Client::Configuration]
90
+ #
91
+ # @return [Client::Configuration]
92
+ #
93
+ def configure
94
+ yield @config if block_given?
95
+ @config
96
+ end
97
+
98
+ ##
99
+ # Create a new Provisioning REST client object.
100
+ #
101
+ # @example
102
+ #
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client.new
105
+ #
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
110
+ #
111
+ # @yield [config] Configure the Provisioning client.
112
+ # @yieldparam config [Client::Configuration]
113
+ #
114
+ def initialize
115
+ # Create the configuration object
116
+ @config = Configuration.new Client.configure
117
+
118
+ # Yield the configuration if needed
119
+ yield @config if block_given?
120
+
121
+ # Create credentials
122
+ credentials = @config.credentials
123
+ # Use self-signed JWT if the endpoint is unchanged from default,
124
+ # but only if the default endpoint does not have a region prefix.
125
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
126
+ !@config.endpoint.split(".").first.include?("-")
127
+ credentials ||= Credentials.default scope: @config.scope,
128
+ enable_self_signed_jwt: enable_self_signed_jwt
129
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
130
+ credentials = Credentials.new credentials, scope: @config.scope
131
+ end
132
+
133
+ @quota_project_id = @config.quota_project
134
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
135
+
136
+ @operations_client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Operations.new do |config|
137
+ config.credentials = credentials
138
+ config.quota_project = @quota_project_id
139
+ config.endpoint = @config.endpoint
140
+ end
141
+
142
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
143
+ config.credentials = credentials
144
+ config.quota_project = @quota_project_id
145
+ config.endpoint = @config.endpoint
146
+ config.bindings_override = @config.bindings_override
147
+ end
148
+
149
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
150
+ config.credentials = credentials
151
+ config.quota_project = @quota_project_id
152
+ config.endpoint = @config.endpoint
153
+ config.bindings_override = @config.bindings_override
154
+ end
155
+
156
+ @provisioning_stub = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
157
+ end
158
+
159
+ ##
160
+ # Get the associated client for long-running operations.
161
+ #
162
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Operations]
163
+ #
164
+ attr_reader :operations_client
165
+
166
+ ##
167
+ # Get the associated client for mix-in of the Locations.
168
+ #
169
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
170
+ #
171
+ attr_reader :location_client
172
+
173
+ ##
174
+ # Get the associated client for mix-in of the IAMPolicy.
175
+ #
176
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
177
+ #
178
+ attr_reader :iam_policy_client
179
+
180
+ # Service calls
181
+
182
+ ##
183
+ # Provisions instance resources for the Registry.
184
+ #
185
+ # @overload create_instance(request, options = nil)
186
+ # Pass arguments to `create_instance` via a request object, either of type
187
+ # {::Google::Cloud::ApigeeRegistry::V1::CreateInstanceRequest} or an equivalent Hash.
188
+ #
189
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::CreateInstanceRequest, ::Hash]
190
+ # A request object representing the call parameters. Required. To specify no
191
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
192
+ # @param options [::Gapic::CallOptions, ::Hash]
193
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
194
+ #
195
+ # @overload create_instance(parent: nil, instance_id: nil, instance: nil)
196
+ # Pass arguments to `create_instance` via keyword arguments. Note that at
197
+ # least one keyword argument is required. To specify no parameters, or to keep all
198
+ # the default parameter values, pass an empty Hash as a request object (see above).
199
+ #
200
+ # @param parent [::String]
201
+ # Required. Parent resource of the Instance, of the form: `projects/*/locations/*`
202
+ # @param instance_id [::String]
203
+ # Required. Identifier to assign to the Instance. Must be unique within scope of the
204
+ # parent resource.
205
+ # @param instance [::Google::Cloud::ApigeeRegistry::V1::Instance, ::Hash]
206
+ # Required. The Instance.
207
+ # @yield [result, operation] Access the result along with the TransportOperation object
208
+ # @yieldparam result [::Gapic::Operation]
209
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
210
+ #
211
+ # @return [::Gapic::Operation]
212
+ #
213
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
214
+ def create_instance request, options = nil
215
+ raise ::ArgumentError, "request must be provided" if request.nil?
216
+
217
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::CreateInstanceRequest
218
+
219
+ # Converts hash and nil to an options object
220
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
221
+
222
+ # Customize the options with defaults
223
+ call_metadata = @config.rpcs.create_instance.metadata.to_h
224
+
225
+ # Set x-goog-api-client and x-goog-user-project headers
226
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
227
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
228
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
229
+ transports_version_send: [:rest]
230
+
231
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
232
+
233
+ options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
234
+ metadata: call_metadata,
235
+ retry_policy: @config.rpcs.create_instance.retry_policy
236
+
237
+ options.apply_defaults timeout: @config.timeout,
238
+ metadata: @config.metadata,
239
+ retry_policy: @config.retry_policy
240
+
241
+ @provisioning_stub.create_instance request, options do |result, operation|
242
+ result = ::Gapic::Operation.new result, @operations_client, options: options
243
+ yield result, operation if block_given?
244
+ return result
245
+ end
246
+ rescue ::Gapic::Rest::Error => e
247
+ raise ::Google::Cloud::Error.from_error(e)
248
+ end
249
+
250
+ ##
251
+ # Deletes the Registry instance.
252
+ #
253
+ # @overload delete_instance(request, options = nil)
254
+ # Pass arguments to `delete_instance` via a request object, either of type
255
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteInstanceRequest} or an equivalent Hash.
256
+ #
257
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteInstanceRequest, ::Hash]
258
+ # A request object representing the call parameters. Required. To specify no
259
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
260
+ # @param options [::Gapic::CallOptions, ::Hash]
261
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
262
+ #
263
+ # @overload delete_instance(name: nil)
264
+ # Pass arguments to `delete_instance` via keyword arguments. Note that at
265
+ # least one keyword argument is required. To specify no parameters, or to keep all
266
+ # the default parameter values, pass an empty Hash as a request object (see above).
267
+ #
268
+ # @param name [::String]
269
+ # Required. The name of the Instance to delete.
270
+ # Format: `projects/*/locations/*/instances/*`.
271
+ # @yield [result, operation] Access the result along with the TransportOperation object
272
+ # @yieldparam result [::Gapic::Operation]
273
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
274
+ #
275
+ # @return [::Gapic::Operation]
276
+ #
277
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
278
+ def delete_instance request, options = nil
279
+ raise ::ArgumentError, "request must be provided" if request.nil?
280
+
281
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteInstanceRequest
282
+
283
+ # Converts hash and nil to an options object
284
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
285
+
286
+ # Customize the options with defaults
287
+ call_metadata = @config.rpcs.delete_instance.metadata.to_h
288
+
289
+ # Set x-goog-api-client and x-goog-user-project headers
290
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
291
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
292
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
293
+ transports_version_send: [:rest]
294
+
295
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
296
+
297
+ options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
298
+ metadata: call_metadata,
299
+ retry_policy: @config.rpcs.delete_instance.retry_policy
300
+
301
+ options.apply_defaults timeout: @config.timeout,
302
+ metadata: @config.metadata,
303
+ retry_policy: @config.retry_policy
304
+
305
+ @provisioning_stub.delete_instance request, options do |result, operation|
306
+ result = ::Gapic::Operation.new result, @operations_client, options: options
307
+ yield result, operation if block_given?
308
+ return result
309
+ end
310
+ rescue ::Gapic::Rest::Error => e
311
+ raise ::Google::Cloud::Error.from_error(e)
312
+ end
313
+
314
+ ##
315
+ # Gets details of a single Instance.
316
+ #
317
+ # @overload get_instance(request, options = nil)
318
+ # Pass arguments to `get_instance` via a request object, either of type
319
+ # {::Google::Cloud::ApigeeRegistry::V1::GetInstanceRequest} or an equivalent Hash.
320
+ #
321
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetInstanceRequest, ::Hash]
322
+ # A request object representing the call parameters. Required. To specify no
323
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
324
+ # @param options [::Gapic::CallOptions, ::Hash]
325
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
326
+ #
327
+ # @overload get_instance(name: nil)
328
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
329
+ # least one keyword argument is required. To specify no parameters, or to keep all
330
+ # the default parameter values, pass an empty Hash as a request object (see above).
331
+ #
332
+ # @param name [::String]
333
+ # Required. The name of the Instance to retrieve.
334
+ # Format: `projects/*/locations/*/instances/*`.
335
+ # @yield [result, operation] Access the result along with the TransportOperation object
336
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::Instance]
337
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
338
+ #
339
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Instance]
340
+ #
341
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
342
+ def get_instance request, options = nil
343
+ raise ::ArgumentError, "request must be provided" if request.nil?
344
+
345
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetInstanceRequest
346
+
347
+ # Converts hash and nil to an options object
348
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
349
+
350
+ # Customize the options with defaults
351
+ call_metadata = @config.rpcs.get_instance.metadata.to_h
352
+
353
+ # Set x-goog-api-client and x-goog-user-project headers
354
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
355
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
356
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
357
+ transports_version_send: [:rest]
358
+
359
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
360
+
361
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
362
+ metadata: call_metadata,
363
+ retry_policy: @config.rpcs.get_instance.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @provisioning_stub.get_instance request, options do |result, operation|
370
+ yield result, operation if block_given?
371
+ return result
372
+ end
373
+ rescue ::Gapic::Rest::Error => e
374
+ raise ::Google::Cloud::Error.from_error(e)
375
+ end
376
+
377
+ ##
378
+ # Configuration class for the Provisioning REST API.
379
+ #
380
+ # This class represents the configuration for Provisioning REST,
381
+ # providing control over timeouts, retry behavior, logging, transport
382
+ # parameters, and other low-level controls. Certain parameters can also be
383
+ # applied individually to specific RPCs. See
384
+ # {::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client::Configuration::Rpcs}
385
+ # for a list of RPCs that can be configured independently.
386
+ #
387
+ # Configuration can be applied globally to all clients, or to a single client
388
+ # on construction.
389
+ #
390
+ # @example
391
+ #
392
+ # # Modify the global config, setting the timeout for
393
+ # # create_instance to 20 seconds,
394
+ # # and all remaining timeouts to 10 seconds.
395
+ # ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client.configure do |config|
396
+ # config.timeout = 10.0
397
+ # config.rpcs.create_instance.timeout = 20.0
398
+ # end
399
+ #
400
+ # # Apply the above configuration only to a new client.
401
+ # client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client.new do |config|
402
+ # config.timeout = 10.0
403
+ # config.rpcs.create_instance.timeout = 20.0
404
+ # end
405
+ #
406
+ # @!attribute [rw] endpoint
407
+ # The hostname or hostname:port of the service endpoint.
408
+ # Defaults to `"apigeeregistry.googleapis.com"`.
409
+ # @return [::String]
410
+ # @!attribute [rw] credentials
411
+ # Credentials to send with calls. You may provide any of the following types:
412
+ # * (`String`) The path to a service account key file in JSON format
413
+ # * (`Hash`) A service account key as a Hash
414
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
415
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
416
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
417
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
418
+ # * (`nil`) indicating no credentials
419
+ # @return [::Object]
420
+ # @!attribute [rw] scope
421
+ # The OAuth scopes
422
+ # @return [::Array<::String>]
423
+ # @!attribute [rw] lib_name
424
+ # The library name as recorded in instrumentation and logging
425
+ # @return [::String]
426
+ # @!attribute [rw] lib_version
427
+ # The library version as recorded in instrumentation and logging
428
+ # @return [::String]
429
+ # @!attribute [rw] timeout
430
+ # The call timeout in seconds.
431
+ # @return [::Numeric]
432
+ # @!attribute [rw] metadata
433
+ # Additional headers to be sent with the call.
434
+ # @return [::Hash{::Symbol=>::String}]
435
+ # @!attribute [rw] retry_policy
436
+ # The retry policy. The value is a hash with the following keys:
437
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
438
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
439
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
440
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
441
+ # trigger a retry.
442
+ # @return [::Hash]
443
+ # @!attribute [rw] quota_project
444
+ # A separate project against which to charge quota.
445
+ # @return [::String]
446
+ #
447
+ class Configuration
448
+ extend ::Gapic::Config
449
+
450
+ DEFAULT_ENDPOINT = "apigeeregistry.googleapis.com"
451
+
452
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
453
+ config_attr :credentials, nil do |value|
454
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
455
+ allowed.any? { |klass| klass === value }
456
+ end
457
+ config_attr :scope, nil, ::String, ::Array, nil
458
+ config_attr :lib_name, nil, ::String, nil
459
+ config_attr :lib_version, nil, ::String, nil
460
+ config_attr :timeout, nil, ::Numeric, nil
461
+ config_attr :metadata, nil, ::Hash, nil
462
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
463
+ config_attr :quota_project, nil, ::String, nil
464
+
465
+ # @private
466
+ # Overrides for http bindings for the RPCs of this service
467
+ # are only used when this service is used as mixin, and only
468
+ # by the host service.
469
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
470
+ config_attr :bindings_override, {}, ::Hash, nil
471
+
472
+ # @private
473
+ def initialize parent_config = nil
474
+ @parent_config = parent_config unless parent_config.nil?
475
+
476
+ yield self if block_given?
477
+ end
478
+
479
+ ##
480
+ # Configurations for individual RPCs
481
+ # @return [Rpcs]
482
+ #
483
+ def rpcs
484
+ @rpcs ||= begin
485
+ parent_rpcs = nil
486
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
487
+ Rpcs.new parent_rpcs
488
+ end
489
+ end
490
+
491
+ ##
492
+ # Configuration RPC class for the Provisioning API.
493
+ #
494
+ # Includes fields providing the configuration for each RPC in this service.
495
+ # Each configuration object is of type `Gapic::Config::Method` and includes
496
+ # the following configuration fields:
497
+ #
498
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
499
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
500
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
501
+ # include the following keys:
502
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
503
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
504
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
505
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
506
+ # trigger a retry.
507
+ #
508
+ class Rpcs
509
+ ##
510
+ # RPC-specific configuration for `create_instance`
511
+ # @return [::Gapic::Config::Method]
512
+ #
513
+ attr_reader :create_instance
514
+ ##
515
+ # RPC-specific configuration for `delete_instance`
516
+ # @return [::Gapic::Config::Method]
517
+ #
518
+ attr_reader :delete_instance
519
+ ##
520
+ # RPC-specific configuration for `get_instance`
521
+ # @return [::Gapic::Config::Method]
522
+ #
523
+ attr_reader :get_instance
524
+
525
+ # @private
526
+ def initialize parent_rpcs = nil
527
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
528
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
529
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
530
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
531
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
532
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
533
+
534
+ yield self if block_given?
535
+ end
536
+ end
537
+ end
538
+ end
539
+ end
540
+ end
541
+ end
542
+ end
543
+ end
544
+ end