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