google-cloud-apigee_registry-v1 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3153 @@
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/registry_service_pb"
21
+ require "google/cloud/apigee_registry/v1/registry/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 Registry
30
+ module Rest
31
+ ##
32
+ # REST client for the Registry service.
33
+ #
34
+ # The Registry service allows teams to manage descriptions of APIs.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :registry_stub
41
+
42
+ ##
43
+ # Configure the Registry Client class.
44
+ #
45
+ # See {::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all Registry clients
51
+ # ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "ApigeeRegistry", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.rpcs.list_apis.timeout = 60.0
72
+ default_config.rpcs.list_apis.retry_policy = {
73
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
74
+ }
75
+
76
+ default_config.rpcs.get_api.timeout = 60.0
77
+ default_config.rpcs.get_api.retry_policy = {
78
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
79
+ }
80
+
81
+ default_config.rpcs.create_api.timeout = 60.0
82
+ default_config.rpcs.create_api.retry_policy = {
83
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
84
+ }
85
+
86
+ default_config.rpcs.update_api.timeout = 60.0
87
+ default_config.rpcs.update_api.retry_policy = {
88
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
89
+ }
90
+
91
+ default_config.rpcs.delete_api.timeout = 60.0
92
+ default_config.rpcs.delete_api.retry_policy = {
93
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
94
+ }
95
+
96
+ default_config.rpcs.list_api_versions.timeout = 60.0
97
+ default_config.rpcs.list_api_versions.retry_policy = {
98
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
99
+ }
100
+
101
+ default_config.rpcs.get_api_version.timeout = 60.0
102
+ default_config.rpcs.get_api_version.retry_policy = {
103
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
104
+ }
105
+
106
+ default_config.rpcs.create_api_version.timeout = 60.0
107
+ default_config.rpcs.create_api_version.retry_policy = {
108
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
109
+ }
110
+
111
+ default_config.rpcs.update_api_version.timeout = 60.0
112
+ default_config.rpcs.update_api_version.retry_policy = {
113
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
114
+ }
115
+
116
+ default_config.rpcs.delete_api_version.timeout = 60.0
117
+ default_config.rpcs.delete_api_version.retry_policy = {
118
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
119
+ }
120
+
121
+ default_config.rpcs.list_api_specs.timeout = 60.0
122
+ default_config.rpcs.list_api_specs.retry_policy = {
123
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
124
+ }
125
+
126
+ default_config.rpcs.get_api_spec.timeout = 60.0
127
+ default_config.rpcs.get_api_spec.retry_policy = {
128
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
129
+ }
130
+
131
+ default_config.rpcs.get_api_spec_contents.timeout = 60.0
132
+ default_config.rpcs.get_api_spec_contents.retry_policy = {
133
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
134
+ }
135
+
136
+ default_config.rpcs.create_api_spec.timeout = 60.0
137
+ default_config.rpcs.create_api_spec.retry_policy = {
138
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
139
+ }
140
+
141
+ default_config.rpcs.update_api_spec.timeout = 60.0
142
+ default_config.rpcs.update_api_spec.retry_policy = {
143
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
144
+ }
145
+
146
+ default_config.rpcs.delete_api_spec.timeout = 60.0
147
+ default_config.rpcs.delete_api_spec.retry_policy = {
148
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
149
+ }
150
+
151
+ default_config.rpcs.tag_api_spec_revision.timeout = 60.0
152
+ default_config.rpcs.tag_api_spec_revision.retry_policy = {
153
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
154
+ }
155
+
156
+ default_config.rpcs.list_api_spec_revisions.timeout = 60.0
157
+ default_config.rpcs.list_api_spec_revisions.retry_policy = {
158
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
159
+ }
160
+
161
+ default_config.rpcs.rollback_api_spec.timeout = 60.0
162
+
163
+ default_config.rpcs.delete_api_spec_revision.timeout = 60.0
164
+ default_config.rpcs.delete_api_spec_revision.retry_policy = {
165
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
166
+ }
167
+
168
+ default_config.rpcs.list_api_deployments.timeout = 60.0
169
+ default_config.rpcs.list_api_deployments.retry_policy = {
170
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
171
+ }
172
+
173
+ default_config.rpcs.get_api_deployment.timeout = 60.0
174
+ default_config.rpcs.get_api_deployment.retry_policy = {
175
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
176
+ }
177
+
178
+ default_config.rpcs.create_api_deployment.timeout = 60.0
179
+ default_config.rpcs.create_api_deployment.retry_policy = {
180
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
181
+ }
182
+
183
+ default_config.rpcs.update_api_deployment.timeout = 60.0
184
+ default_config.rpcs.update_api_deployment.retry_policy = {
185
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
186
+ }
187
+
188
+ default_config.rpcs.delete_api_deployment.timeout = 60.0
189
+ default_config.rpcs.delete_api_deployment.retry_policy = {
190
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
191
+ }
192
+
193
+ default_config.rpcs.tag_api_deployment_revision.timeout = 60.0
194
+ default_config.rpcs.tag_api_deployment_revision.retry_policy = {
195
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
196
+ }
197
+
198
+ default_config.rpcs.list_api_deployment_revisions.timeout = 60.0
199
+ default_config.rpcs.list_api_deployment_revisions.retry_policy = {
200
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
201
+ }
202
+
203
+ default_config.rpcs.rollback_api_deployment.timeout = 60.0
204
+
205
+ default_config.rpcs.delete_api_deployment_revision.timeout = 60.0
206
+ default_config.rpcs.delete_api_deployment_revision.retry_policy = {
207
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
208
+ }
209
+
210
+ default_config.rpcs.list_artifacts.timeout = 60.0
211
+ default_config.rpcs.list_artifacts.retry_policy = {
212
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
213
+ }
214
+
215
+ default_config.rpcs.get_artifact.timeout = 60.0
216
+ default_config.rpcs.get_artifact.retry_policy = {
217
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
218
+ }
219
+
220
+ default_config.rpcs.get_artifact_contents.timeout = 60.0
221
+ default_config.rpcs.get_artifact_contents.retry_policy = {
222
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
223
+ }
224
+
225
+ default_config.rpcs.create_artifact.timeout = 60.0
226
+ default_config.rpcs.create_artifact.retry_policy = {
227
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
228
+ }
229
+
230
+ default_config.rpcs.replace_artifact.timeout = 60.0
231
+ default_config.rpcs.replace_artifact.retry_policy = {
232
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
233
+ }
234
+
235
+ default_config.rpcs.delete_artifact.timeout = 60.0
236
+ default_config.rpcs.delete_artifact.retry_policy = {
237
+ initial_delay: 0.2, max_delay: 60.0, multiplier: 1.3, retry_codes: [10, 1, 4, 14]
238
+ }
239
+
240
+ default_config
241
+ end
242
+ yield @configure if block_given?
243
+ @configure
244
+ end
245
+
246
+ ##
247
+ # Configure the Registry Client instance.
248
+ #
249
+ # The configuration is set to the derived mode, meaning that values can be changed,
250
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
251
+ # should be made on {Client.configure}.
252
+ #
253
+ # See {::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client::Configuration}
254
+ # for a description of the configuration fields.
255
+ #
256
+ # @yield [config] Configure the Client client.
257
+ # @yieldparam config [Client::Configuration]
258
+ #
259
+ # @return [Client::Configuration]
260
+ #
261
+ def configure
262
+ yield @config if block_given?
263
+ @config
264
+ end
265
+
266
+ ##
267
+ # Create a new Registry REST client object.
268
+ #
269
+ # @example
270
+ #
271
+ # # Create a client using the default configuration
272
+ # client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client.new
273
+ #
274
+ # # Create a client using a custom configuration
275
+ # client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client.new do |config|
276
+ # config.timeout = 10.0
277
+ # end
278
+ #
279
+ # @yield [config] Configure the Registry client.
280
+ # @yieldparam config [Client::Configuration]
281
+ #
282
+ def initialize
283
+ # Create the configuration object
284
+ @config = Configuration.new Client.configure
285
+
286
+ # Yield the configuration if needed
287
+ yield @config if block_given?
288
+
289
+ # Create credentials
290
+ credentials = @config.credentials
291
+ # Use self-signed JWT if the endpoint is unchanged from default,
292
+ # but only if the default endpoint does not have a region prefix.
293
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
294
+ !@config.endpoint.split(".").first.include?("-")
295
+ credentials ||= Credentials.default scope: @config.scope,
296
+ enable_self_signed_jwt: enable_self_signed_jwt
297
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
298
+ credentials = Credentials.new credentials, scope: @config.scope
299
+ end
300
+
301
+ @quota_project_id = @config.quota_project
302
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
303
+
304
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
305
+ config.credentials = credentials
306
+ config.quota_project = @quota_project_id
307
+ config.endpoint = @config.endpoint
308
+ config.bindings_override = @config.bindings_override
309
+ end
310
+
311
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
312
+ config.credentials = credentials
313
+ config.quota_project = @quota_project_id
314
+ config.endpoint = @config.endpoint
315
+ config.bindings_override = @config.bindings_override
316
+ end
317
+
318
+ @registry_stub = ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
319
+ end
320
+
321
+ ##
322
+ # Get the associated client for mix-in of the Locations.
323
+ #
324
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
325
+ #
326
+ attr_reader :location_client
327
+
328
+ ##
329
+ # Get the associated client for mix-in of the IAMPolicy.
330
+ #
331
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
332
+ #
333
+ attr_reader :iam_policy_client
334
+
335
+ # Service calls
336
+
337
+ ##
338
+ # Returns matching APIs.
339
+ #
340
+ # @overload list_apis(request, options = nil)
341
+ # Pass arguments to `list_apis` via a request object, either of type
342
+ # {::Google::Cloud::ApigeeRegistry::V1::ListApisRequest} or an equivalent Hash.
343
+ #
344
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ListApisRequest, ::Hash]
345
+ # A request object representing the call parameters. Required. To specify no
346
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
347
+ # @param options [::Gapic::CallOptions, ::Hash]
348
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
349
+ #
350
+ # @overload list_apis(parent: nil, page_size: nil, page_token: nil, filter: nil)
351
+ # Pass arguments to `list_apis` via keyword arguments. Note that at
352
+ # least one keyword argument is required. To specify no parameters, or to keep all
353
+ # the default parameter values, pass an empty Hash as a request object (see above).
354
+ #
355
+ # @param parent [::String]
356
+ # Required. The parent, which owns this collection of APIs.
357
+ # Format: `projects/*/locations/*`
358
+ # @param page_size [::Integer]
359
+ # The maximum number of APIs to return.
360
+ # The service may return fewer than this value.
361
+ # If unspecified, at most 50 values will be returned.
362
+ # The maximum is 1000; values above 1000 will be coerced to 1000.
363
+ # @param page_token [::String]
364
+ # A page token, received from a previous `ListApis` call.
365
+ # Provide this to retrieve the subsequent page.
366
+ #
367
+ # When paginating, all other parameters provided to `ListApis` must match
368
+ # the call that provided the page token.
369
+ # @param filter [::String]
370
+ # An expression that can be used to filter the list. Filters use the Common
371
+ # Expression Language and can refer to all message fields.
372
+ # @yield [result, operation] Access the result along with the TransportOperation object
373
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::Api>]
374
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
375
+ #
376
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::Api>]
377
+ #
378
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
379
+ def list_apis request, options = nil
380
+ raise ::ArgumentError, "request must be provided" if request.nil?
381
+
382
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ListApisRequest
383
+
384
+ # Converts hash and nil to an options object
385
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
386
+
387
+ # Customize the options with defaults
388
+ call_metadata = @config.rpcs.list_apis.metadata.to_h
389
+
390
+ # Set x-goog-api-client and x-goog-user-project headers
391
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
392
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
393
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
394
+ transports_version_send: [:rest]
395
+
396
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
397
+
398
+ options.apply_defaults timeout: @config.rpcs.list_apis.timeout,
399
+ metadata: call_metadata,
400
+ retry_policy: @config.rpcs.list_apis.retry_policy
401
+
402
+ options.apply_defaults timeout: @config.timeout,
403
+ metadata: @config.metadata,
404
+ retry_policy: @config.retry_policy
405
+
406
+ @registry_stub.list_apis request, options do |result, operation|
407
+ result = ::Gapic::Rest::PagedEnumerable.new @registry_stub, :list_apis, "apis", request, result, options
408
+ yield result, operation if block_given?
409
+ return result
410
+ end
411
+ rescue ::Gapic::Rest::Error => e
412
+ raise ::Google::Cloud::Error.from_error(e)
413
+ end
414
+
415
+ ##
416
+ # Returns a specified API.
417
+ #
418
+ # @overload get_api(request, options = nil)
419
+ # Pass arguments to `get_api` via a request object, either of type
420
+ # {::Google::Cloud::ApigeeRegistry::V1::GetApiRequest} or an equivalent Hash.
421
+ #
422
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetApiRequest, ::Hash]
423
+ # A request object representing the call parameters. Required. To specify no
424
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
425
+ # @param options [::Gapic::CallOptions, ::Hash]
426
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
427
+ #
428
+ # @overload get_api(name: nil)
429
+ # Pass arguments to `get_api` via keyword arguments. Note that at
430
+ # least one keyword argument is required. To specify no parameters, or to keep all
431
+ # the default parameter values, pass an empty Hash as a request object (see above).
432
+ #
433
+ # @param name [::String]
434
+ # Required. The name of the API to retrieve.
435
+ # Format: `projects/*/locations/*/apis/*`
436
+ # @yield [result, operation] Access the result along with the TransportOperation object
437
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::Api]
438
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
439
+ #
440
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Api]
441
+ #
442
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
443
+ def get_api request, options = nil
444
+ raise ::ArgumentError, "request must be provided" if request.nil?
445
+
446
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetApiRequest
447
+
448
+ # Converts hash and nil to an options object
449
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
450
+
451
+ # Customize the options with defaults
452
+ call_metadata = @config.rpcs.get_api.metadata.to_h
453
+
454
+ # Set x-goog-api-client and x-goog-user-project headers
455
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
456
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
457
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
458
+ transports_version_send: [:rest]
459
+
460
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
461
+
462
+ options.apply_defaults timeout: @config.rpcs.get_api.timeout,
463
+ metadata: call_metadata,
464
+ retry_policy: @config.rpcs.get_api.retry_policy
465
+
466
+ options.apply_defaults timeout: @config.timeout,
467
+ metadata: @config.metadata,
468
+ retry_policy: @config.retry_policy
469
+
470
+ @registry_stub.get_api request, options do |result, operation|
471
+ yield result, operation if block_given?
472
+ return result
473
+ end
474
+ rescue ::Gapic::Rest::Error => e
475
+ raise ::Google::Cloud::Error.from_error(e)
476
+ end
477
+
478
+ ##
479
+ # Creates a specified API.
480
+ #
481
+ # @overload create_api(request, options = nil)
482
+ # Pass arguments to `create_api` via a request object, either of type
483
+ # {::Google::Cloud::ApigeeRegistry::V1::CreateApiRequest} or an equivalent Hash.
484
+ #
485
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::CreateApiRequest, ::Hash]
486
+ # A request object representing the call parameters. Required. To specify no
487
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
488
+ # @param options [::Gapic::CallOptions, ::Hash]
489
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
490
+ #
491
+ # @overload create_api(parent: nil, api: nil, api_id: nil)
492
+ # Pass arguments to `create_api` via keyword arguments. Note that at
493
+ # least one keyword argument is required. To specify no parameters, or to keep all
494
+ # the default parameter values, pass an empty Hash as a request object (see above).
495
+ #
496
+ # @param parent [::String]
497
+ # Required. The parent, which owns this collection of APIs.
498
+ # Format: `projects/*/locations/*`
499
+ # @param api [::Google::Cloud::ApigeeRegistry::V1::Api, ::Hash]
500
+ # Required. The API to create.
501
+ # @param api_id [::String]
502
+ # Required. The ID to use for the API, which will become the final component of
503
+ # the API's resource name.
504
+ #
505
+ # This value should be 4-63 characters, and valid characters
506
+ # are /[a-z][0-9]-/.
507
+ #
508
+ # Following AIP-162, IDs must not have the form of a UUID.
509
+ # @yield [result, operation] Access the result along with the TransportOperation object
510
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::Api]
511
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
512
+ #
513
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Api]
514
+ #
515
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
516
+ def create_api request, options = nil
517
+ raise ::ArgumentError, "request must be provided" if request.nil?
518
+
519
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::CreateApiRequest
520
+
521
+ # Converts hash and nil to an options object
522
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
523
+
524
+ # Customize the options with defaults
525
+ call_metadata = @config.rpcs.create_api.metadata.to_h
526
+
527
+ # Set x-goog-api-client and x-goog-user-project headers
528
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
529
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
530
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
531
+ transports_version_send: [:rest]
532
+
533
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
534
+
535
+ options.apply_defaults timeout: @config.rpcs.create_api.timeout,
536
+ metadata: call_metadata,
537
+ retry_policy: @config.rpcs.create_api.retry_policy
538
+
539
+ options.apply_defaults timeout: @config.timeout,
540
+ metadata: @config.metadata,
541
+ retry_policy: @config.retry_policy
542
+
543
+ @registry_stub.create_api request, options do |result, operation|
544
+ yield result, operation if block_given?
545
+ return result
546
+ end
547
+ rescue ::Gapic::Rest::Error => e
548
+ raise ::Google::Cloud::Error.from_error(e)
549
+ end
550
+
551
+ ##
552
+ # Used to modify a specified API.
553
+ #
554
+ # @overload update_api(request, options = nil)
555
+ # Pass arguments to `update_api` via a request object, either of type
556
+ # {::Google::Cloud::ApigeeRegistry::V1::UpdateApiRequest} or an equivalent Hash.
557
+ #
558
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::UpdateApiRequest, ::Hash]
559
+ # A request object representing the call parameters. Required. To specify no
560
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
561
+ # @param options [::Gapic::CallOptions, ::Hash]
562
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
563
+ #
564
+ # @overload update_api(api: nil, update_mask: nil, allow_missing: nil)
565
+ # Pass arguments to `update_api` via keyword arguments. Note that at
566
+ # least one keyword argument is required. To specify no parameters, or to keep all
567
+ # the default parameter values, pass an empty Hash as a request object (see above).
568
+ #
569
+ # @param api [::Google::Cloud::ApigeeRegistry::V1::Api, ::Hash]
570
+ # Required. The API to update.
571
+ #
572
+ # The `name` field is used to identify the API to update.
573
+ # Format: `projects/*/locations/*/apis/*`
574
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
575
+ # The list of fields to be updated. If omitted, all fields are updated that
576
+ # are set in the request message (fields set to default values are ignored).
577
+ # If an asterisk "*" is specified, all fields are updated, including fields
578
+ # that are unspecified/default in the request.
579
+ # @param allow_missing [::Boolean]
580
+ # If set to true, and the API is not found, a new API will be created.
581
+ # In this situation, `update_mask` is ignored.
582
+ # @yield [result, operation] Access the result along with the TransportOperation object
583
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::Api]
584
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
585
+ #
586
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Api]
587
+ #
588
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
589
+ def update_api request, options = nil
590
+ raise ::ArgumentError, "request must be provided" if request.nil?
591
+
592
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::UpdateApiRequest
593
+
594
+ # Converts hash and nil to an options object
595
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
596
+
597
+ # Customize the options with defaults
598
+ call_metadata = @config.rpcs.update_api.metadata.to_h
599
+
600
+ # Set x-goog-api-client and x-goog-user-project headers
601
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
602
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
603
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
604
+ transports_version_send: [:rest]
605
+
606
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
607
+
608
+ options.apply_defaults timeout: @config.rpcs.update_api.timeout,
609
+ metadata: call_metadata,
610
+ retry_policy: @config.rpcs.update_api.retry_policy
611
+
612
+ options.apply_defaults timeout: @config.timeout,
613
+ metadata: @config.metadata,
614
+ retry_policy: @config.retry_policy
615
+
616
+ @registry_stub.update_api request, options do |result, operation|
617
+ yield result, operation if block_given?
618
+ return result
619
+ end
620
+ rescue ::Gapic::Rest::Error => e
621
+ raise ::Google::Cloud::Error.from_error(e)
622
+ end
623
+
624
+ ##
625
+ # Removes a specified API and all of the resources that it
626
+ # owns.
627
+ #
628
+ # @overload delete_api(request, options = nil)
629
+ # Pass arguments to `delete_api` via a request object, either of type
630
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteApiRequest} or an equivalent Hash.
631
+ #
632
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteApiRequest, ::Hash]
633
+ # A request object representing the call parameters. Required. To specify no
634
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
635
+ # @param options [::Gapic::CallOptions, ::Hash]
636
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
637
+ #
638
+ # @overload delete_api(name: nil, force: nil)
639
+ # Pass arguments to `delete_api` via keyword arguments. Note that at
640
+ # least one keyword argument is required. To specify no parameters, or to keep all
641
+ # the default parameter values, pass an empty Hash as a request object (see above).
642
+ #
643
+ # @param name [::String]
644
+ # Required. The name of the API to delete.
645
+ # Format: `projects/*/locations/*/apis/*`
646
+ # @param force [::Boolean]
647
+ # If set to true, any child resources will also be deleted.
648
+ # (Otherwise, the request will only work if there are no child resources.)
649
+ # @yield [result, operation] Access the result along with the TransportOperation object
650
+ # @yieldparam result [::Google::Protobuf::Empty]
651
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
652
+ #
653
+ # @return [::Google::Protobuf::Empty]
654
+ #
655
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
656
+ def delete_api request, options = nil
657
+ raise ::ArgumentError, "request must be provided" if request.nil?
658
+
659
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteApiRequest
660
+
661
+ # Converts hash and nil to an options object
662
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
663
+
664
+ # Customize the options with defaults
665
+ call_metadata = @config.rpcs.delete_api.metadata.to_h
666
+
667
+ # Set x-goog-api-client and x-goog-user-project headers
668
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
669
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
670
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
671
+ transports_version_send: [:rest]
672
+
673
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
674
+
675
+ options.apply_defaults timeout: @config.rpcs.delete_api.timeout,
676
+ metadata: call_metadata,
677
+ retry_policy: @config.rpcs.delete_api.retry_policy
678
+
679
+ options.apply_defaults timeout: @config.timeout,
680
+ metadata: @config.metadata,
681
+ retry_policy: @config.retry_policy
682
+
683
+ @registry_stub.delete_api request, options do |result, operation|
684
+ yield result, operation if block_given?
685
+ return result
686
+ end
687
+ rescue ::Gapic::Rest::Error => e
688
+ raise ::Google::Cloud::Error.from_error(e)
689
+ end
690
+
691
+ ##
692
+ # Returns matching versions.
693
+ #
694
+ # @overload list_api_versions(request, options = nil)
695
+ # Pass arguments to `list_api_versions` via a request object, either of type
696
+ # {::Google::Cloud::ApigeeRegistry::V1::ListApiVersionsRequest} or an equivalent Hash.
697
+ #
698
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ListApiVersionsRequest, ::Hash]
699
+ # A request object representing the call parameters. Required. To specify no
700
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
701
+ # @param options [::Gapic::CallOptions, ::Hash]
702
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
703
+ #
704
+ # @overload list_api_versions(parent: nil, page_size: nil, page_token: nil, filter: nil)
705
+ # Pass arguments to `list_api_versions` via keyword arguments. Note that at
706
+ # least one keyword argument is required. To specify no parameters, or to keep all
707
+ # the default parameter values, pass an empty Hash as a request object (see above).
708
+ #
709
+ # @param parent [::String]
710
+ # Required. The parent, which owns this collection of versions.
711
+ # Format: `projects/*/locations/*/apis/*`
712
+ # @param page_size [::Integer]
713
+ # The maximum number of versions to return.
714
+ # The service may return fewer than this value.
715
+ # If unspecified, at most 50 values will be returned.
716
+ # The maximum is 1000; values above 1000 will be coerced to 1000.
717
+ # @param page_token [::String]
718
+ # A page token, received from a previous `ListApiVersions` call.
719
+ # Provide this to retrieve the subsequent page.
720
+ #
721
+ # When paginating, all other parameters provided to `ListApiVersions` must
722
+ # match the call that provided the page token.
723
+ # @param filter [::String]
724
+ # An expression that can be used to filter the list. Filters use the Common
725
+ # Expression Language and can refer to all message fields.
726
+ # @yield [result, operation] Access the result along with the TransportOperation object
727
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiVersion>]
728
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
729
+ #
730
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiVersion>]
731
+ #
732
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
733
+ def list_api_versions request, options = nil
734
+ raise ::ArgumentError, "request must be provided" if request.nil?
735
+
736
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ListApiVersionsRequest
737
+
738
+ # Converts hash and nil to an options object
739
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
740
+
741
+ # Customize the options with defaults
742
+ call_metadata = @config.rpcs.list_api_versions.metadata.to_h
743
+
744
+ # Set x-goog-api-client and x-goog-user-project headers
745
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
746
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
747
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
748
+ transports_version_send: [:rest]
749
+
750
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
751
+
752
+ options.apply_defaults timeout: @config.rpcs.list_api_versions.timeout,
753
+ metadata: call_metadata,
754
+ retry_policy: @config.rpcs.list_api_versions.retry_policy
755
+
756
+ options.apply_defaults timeout: @config.timeout,
757
+ metadata: @config.metadata,
758
+ retry_policy: @config.retry_policy
759
+
760
+ @registry_stub.list_api_versions request, options do |result, operation|
761
+ result = ::Gapic::Rest::PagedEnumerable.new @registry_stub, :list_api_versions, "api_versions", request, result, options
762
+ yield result, operation if block_given?
763
+ return result
764
+ end
765
+ rescue ::Gapic::Rest::Error => e
766
+ raise ::Google::Cloud::Error.from_error(e)
767
+ end
768
+
769
+ ##
770
+ # Returns a specified version.
771
+ #
772
+ # @overload get_api_version(request, options = nil)
773
+ # Pass arguments to `get_api_version` via a request object, either of type
774
+ # {::Google::Cloud::ApigeeRegistry::V1::GetApiVersionRequest} or an equivalent Hash.
775
+ #
776
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetApiVersionRequest, ::Hash]
777
+ # A request object representing the call parameters. Required. To specify no
778
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
779
+ # @param options [::Gapic::CallOptions, ::Hash]
780
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
781
+ #
782
+ # @overload get_api_version(name: nil)
783
+ # Pass arguments to `get_api_version` via keyword arguments. Note that at
784
+ # least one keyword argument is required. To specify no parameters, or to keep all
785
+ # the default parameter values, pass an empty Hash as a request object (see above).
786
+ #
787
+ # @param name [::String]
788
+ # Required. The name of the version to retrieve.
789
+ # Format: `projects/*/locations/*/apis/*/versions/*`
790
+ # @yield [result, operation] Access the result along with the TransportOperation object
791
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiVersion]
792
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
793
+ #
794
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiVersion]
795
+ #
796
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
797
+ def get_api_version request, options = nil
798
+ raise ::ArgumentError, "request must be provided" if request.nil?
799
+
800
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetApiVersionRequest
801
+
802
+ # Converts hash and nil to an options object
803
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
804
+
805
+ # Customize the options with defaults
806
+ call_metadata = @config.rpcs.get_api_version.metadata.to_h
807
+
808
+ # Set x-goog-api-client and x-goog-user-project headers
809
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
810
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
811
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
812
+ transports_version_send: [:rest]
813
+
814
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
815
+
816
+ options.apply_defaults timeout: @config.rpcs.get_api_version.timeout,
817
+ metadata: call_metadata,
818
+ retry_policy: @config.rpcs.get_api_version.retry_policy
819
+
820
+ options.apply_defaults timeout: @config.timeout,
821
+ metadata: @config.metadata,
822
+ retry_policy: @config.retry_policy
823
+
824
+ @registry_stub.get_api_version request, options do |result, operation|
825
+ yield result, operation if block_given?
826
+ return result
827
+ end
828
+ rescue ::Gapic::Rest::Error => e
829
+ raise ::Google::Cloud::Error.from_error(e)
830
+ end
831
+
832
+ ##
833
+ # Creates a specified version.
834
+ #
835
+ # @overload create_api_version(request, options = nil)
836
+ # Pass arguments to `create_api_version` via a request object, either of type
837
+ # {::Google::Cloud::ApigeeRegistry::V1::CreateApiVersionRequest} or an equivalent Hash.
838
+ #
839
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::CreateApiVersionRequest, ::Hash]
840
+ # A request object representing the call parameters. Required. To specify no
841
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
842
+ # @param options [::Gapic::CallOptions, ::Hash]
843
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
844
+ #
845
+ # @overload create_api_version(parent: nil, api_version: nil, api_version_id: nil)
846
+ # Pass arguments to `create_api_version` via keyword arguments. Note that at
847
+ # least one keyword argument is required. To specify no parameters, or to keep all
848
+ # the default parameter values, pass an empty Hash as a request object (see above).
849
+ #
850
+ # @param parent [::String]
851
+ # Required. The parent, which owns this collection of versions.
852
+ # Format: `projects/*/locations/*/apis/*`
853
+ # @param api_version [::Google::Cloud::ApigeeRegistry::V1::ApiVersion, ::Hash]
854
+ # Required. The version to create.
855
+ # @param api_version_id [::String]
856
+ # Required. The ID to use for the version, which will become the final component of
857
+ # the version's resource name.
858
+ #
859
+ # This value should be 1-63 characters, and valid characters
860
+ # are /[a-z][0-9]-/.
861
+ #
862
+ # Following AIP-162, IDs must not have the form of a UUID.
863
+ # @yield [result, operation] Access the result along with the TransportOperation object
864
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiVersion]
865
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
866
+ #
867
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiVersion]
868
+ #
869
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
870
+ def create_api_version request, options = nil
871
+ raise ::ArgumentError, "request must be provided" if request.nil?
872
+
873
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::CreateApiVersionRequest
874
+
875
+ # Converts hash and nil to an options object
876
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
877
+
878
+ # Customize the options with defaults
879
+ call_metadata = @config.rpcs.create_api_version.metadata.to_h
880
+
881
+ # Set x-goog-api-client and x-goog-user-project headers
882
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
883
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
884
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
885
+ transports_version_send: [:rest]
886
+
887
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
888
+
889
+ options.apply_defaults timeout: @config.rpcs.create_api_version.timeout,
890
+ metadata: call_metadata,
891
+ retry_policy: @config.rpcs.create_api_version.retry_policy
892
+
893
+ options.apply_defaults timeout: @config.timeout,
894
+ metadata: @config.metadata,
895
+ retry_policy: @config.retry_policy
896
+
897
+ @registry_stub.create_api_version request, options do |result, operation|
898
+ yield result, operation if block_given?
899
+ return result
900
+ end
901
+ rescue ::Gapic::Rest::Error => e
902
+ raise ::Google::Cloud::Error.from_error(e)
903
+ end
904
+
905
+ ##
906
+ # Used to modify a specified version.
907
+ #
908
+ # @overload update_api_version(request, options = nil)
909
+ # Pass arguments to `update_api_version` via a request object, either of type
910
+ # {::Google::Cloud::ApigeeRegistry::V1::UpdateApiVersionRequest} or an equivalent Hash.
911
+ #
912
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::UpdateApiVersionRequest, ::Hash]
913
+ # A request object representing the call parameters. Required. To specify no
914
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
915
+ # @param options [::Gapic::CallOptions, ::Hash]
916
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
917
+ #
918
+ # @overload update_api_version(api_version: nil, update_mask: nil, allow_missing: nil)
919
+ # Pass arguments to `update_api_version` via keyword arguments. Note that at
920
+ # least one keyword argument is required. To specify no parameters, or to keep all
921
+ # the default parameter values, pass an empty Hash as a request object (see above).
922
+ #
923
+ # @param api_version [::Google::Cloud::ApigeeRegistry::V1::ApiVersion, ::Hash]
924
+ # Required. The version to update.
925
+ #
926
+ # The `name` field is used to identify the version to update.
927
+ # Format: `projects/*/locations/*/apis/*/versions/*`
928
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
929
+ # The list of fields to be updated. If omitted, all fields are updated that
930
+ # are set in the request message (fields set to default values are ignored).
931
+ # If an asterisk "*" is specified, all fields are updated, including fields
932
+ # that are unspecified/default in the request.
933
+ # @param allow_missing [::Boolean]
934
+ # If set to true, and the version is not found, a new version will be
935
+ # created. In this situation, `update_mask` is ignored.
936
+ # @yield [result, operation] Access the result along with the TransportOperation object
937
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiVersion]
938
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
939
+ #
940
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiVersion]
941
+ #
942
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
943
+ def update_api_version request, options = nil
944
+ raise ::ArgumentError, "request must be provided" if request.nil?
945
+
946
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::UpdateApiVersionRequest
947
+
948
+ # Converts hash and nil to an options object
949
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
950
+
951
+ # Customize the options with defaults
952
+ call_metadata = @config.rpcs.update_api_version.metadata.to_h
953
+
954
+ # Set x-goog-api-client and x-goog-user-project headers
955
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
956
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
957
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
958
+ transports_version_send: [:rest]
959
+
960
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
961
+
962
+ options.apply_defaults timeout: @config.rpcs.update_api_version.timeout,
963
+ metadata: call_metadata,
964
+ retry_policy: @config.rpcs.update_api_version.retry_policy
965
+
966
+ options.apply_defaults timeout: @config.timeout,
967
+ metadata: @config.metadata,
968
+ retry_policy: @config.retry_policy
969
+
970
+ @registry_stub.update_api_version request, options do |result, operation|
971
+ yield result, operation if block_given?
972
+ return result
973
+ end
974
+ rescue ::Gapic::Rest::Error => e
975
+ raise ::Google::Cloud::Error.from_error(e)
976
+ end
977
+
978
+ ##
979
+ # Removes a specified version and all of the resources that
980
+ # it owns.
981
+ #
982
+ # @overload delete_api_version(request, options = nil)
983
+ # Pass arguments to `delete_api_version` via a request object, either of type
984
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteApiVersionRequest} or an equivalent Hash.
985
+ #
986
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteApiVersionRequest, ::Hash]
987
+ # A request object representing the call parameters. Required. To specify no
988
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
989
+ # @param options [::Gapic::CallOptions, ::Hash]
990
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
991
+ #
992
+ # @overload delete_api_version(name: nil, force: nil)
993
+ # Pass arguments to `delete_api_version` via keyword arguments. Note that at
994
+ # least one keyword argument is required. To specify no parameters, or to keep all
995
+ # the default parameter values, pass an empty Hash as a request object (see above).
996
+ #
997
+ # @param name [::String]
998
+ # Required. The name of the version to delete.
999
+ # Format: `projects/*/locations/*/apis/*/versions/*`
1000
+ # @param force [::Boolean]
1001
+ # If set to true, any child resources will also be deleted.
1002
+ # (Otherwise, the request will only work if there are no child resources.)
1003
+ # @yield [result, operation] Access the result along with the TransportOperation object
1004
+ # @yieldparam result [::Google::Protobuf::Empty]
1005
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1006
+ #
1007
+ # @return [::Google::Protobuf::Empty]
1008
+ #
1009
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1010
+ def delete_api_version request, options = nil
1011
+ raise ::ArgumentError, "request must be provided" if request.nil?
1012
+
1013
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteApiVersionRequest
1014
+
1015
+ # Converts hash and nil to an options object
1016
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1017
+
1018
+ # Customize the options with defaults
1019
+ call_metadata = @config.rpcs.delete_api_version.metadata.to_h
1020
+
1021
+ # Set x-goog-api-client and x-goog-user-project headers
1022
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1023
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1024
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1025
+ transports_version_send: [:rest]
1026
+
1027
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1028
+
1029
+ options.apply_defaults timeout: @config.rpcs.delete_api_version.timeout,
1030
+ metadata: call_metadata,
1031
+ retry_policy: @config.rpcs.delete_api_version.retry_policy
1032
+
1033
+ options.apply_defaults timeout: @config.timeout,
1034
+ metadata: @config.metadata,
1035
+ retry_policy: @config.retry_policy
1036
+
1037
+ @registry_stub.delete_api_version request, options do |result, operation|
1038
+ yield result, operation if block_given?
1039
+ return result
1040
+ end
1041
+ rescue ::Gapic::Rest::Error => e
1042
+ raise ::Google::Cloud::Error.from_error(e)
1043
+ end
1044
+
1045
+ ##
1046
+ # Returns matching specs.
1047
+ #
1048
+ # @overload list_api_specs(request, options = nil)
1049
+ # Pass arguments to `list_api_specs` via a request object, either of type
1050
+ # {::Google::Cloud::ApigeeRegistry::V1::ListApiSpecsRequest} or an equivalent Hash.
1051
+ #
1052
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ListApiSpecsRequest, ::Hash]
1053
+ # A request object representing the call parameters. Required. To specify no
1054
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1055
+ # @param options [::Gapic::CallOptions, ::Hash]
1056
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1057
+ #
1058
+ # @overload list_api_specs(parent: nil, page_size: nil, page_token: nil, filter: nil)
1059
+ # Pass arguments to `list_api_specs` via keyword arguments. Note that at
1060
+ # least one keyword argument is required. To specify no parameters, or to keep all
1061
+ # the default parameter values, pass an empty Hash as a request object (see above).
1062
+ #
1063
+ # @param parent [::String]
1064
+ # Required. The parent, which owns this collection of specs.
1065
+ # Format: `projects/*/locations/*/apis/*/versions/*`
1066
+ # @param page_size [::Integer]
1067
+ # The maximum number of specs to return.
1068
+ # The service may return fewer than this value.
1069
+ # If unspecified, at most 50 values will be returned.
1070
+ # The maximum is 1000; values above 1000 will be coerced to 1000.
1071
+ # @param page_token [::String]
1072
+ # A page token, received from a previous `ListApiSpecs` call.
1073
+ # Provide this to retrieve the subsequent page.
1074
+ #
1075
+ # When paginating, all other parameters provided to `ListApiSpecs` must match
1076
+ # the call that provided the page token.
1077
+ # @param filter [::String]
1078
+ # An expression that can be used to filter the list. Filters use the Common
1079
+ # Expression Language and can refer to all message fields except contents.
1080
+ # @yield [result, operation] Access the result along with the TransportOperation object
1081
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiSpec>]
1082
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1083
+ #
1084
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiSpec>]
1085
+ #
1086
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1087
+ def list_api_specs request, options = nil
1088
+ raise ::ArgumentError, "request must be provided" if request.nil?
1089
+
1090
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ListApiSpecsRequest
1091
+
1092
+ # Converts hash and nil to an options object
1093
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1094
+
1095
+ # Customize the options with defaults
1096
+ call_metadata = @config.rpcs.list_api_specs.metadata.to_h
1097
+
1098
+ # Set x-goog-api-client and x-goog-user-project headers
1099
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1100
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1101
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1102
+ transports_version_send: [:rest]
1103
+
1104
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1105
+
1106
+ options.apply_defaults timeout: @config.rpcs.list_api_specs.timeout,
1107
+ metadata: call_metadata,
1108
+ retry_policy: @config.rpcs.list_api_specs.retry_policy
1109
+
1110
+ options.apply_defaults timeout: @config.timeout,
1111
+ metadata: @config.metadata,
1112
+ retry_policy: @config.retry_policy
1113
+
1114
+ @registry_stub.list_api_specs request, options do |result, operation|
1115
+ result = ::Gapic::Rest::PagedEnumerable.new @registry_stub, :list_api_specs, "api_specs", request, result, options
1116
+ yield result, operation if block_given?
1117
+ return result
1118
+ end
1119
+ rescue ::Gapic::Rest::Error => e
1120
+ raise ::Google::Cloud::Error.from_error(e)
1121
+ end
1122
+
1123
+ ##
1124
+ # Returns a specified spec.
1125
+ #
1126
+ # @overload get_api_spec(request, options = nil)
1127
+ # Pass arguments to `get_api_spec` via a request object, either of type
1128
+ # {::Google::Cloud::ApigeeRegistry::V1::GetApiSpecRequest} or an equivalent Hash.
1129
+ #
1130
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetApiSpecRequest, ::Hash]
1131
+ # A request object representing the call parameters. Required. To specify no
1132
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1133
+ # @param options [::Gapic::CallOptions, ::Hash]
1134
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1135
+ #
1136
+ # @overload get_api_spec(name: nil)
1137
+ # Pass arguments to `get_api_spec` via keyword arguments. Note that at
1138
+ # least one keyword argument is required. To specify no parameters, or to keep all
1139
+ # the default parameter values, pass an empty Hash as a request object (see above).
1140
+ #
1141
+ # @param name [::String]
1142
+ # Required. The name of the spec to retrieve.
1143
+ # Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
1144
+ # @yield [result, operation] Access the result along with the TransportOperation object
1145
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1146
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1147
+ #
1148
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1149
+ #
1150
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1151
+ def get_api_spec request, options = nil
1152
+ raise ::ArgumentError, "request must be provided" if request.nil?
1153
+
1154
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetApiSpecRequest
1155
+
1156
+ # Converts hash and nil to an options object
1157
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1158
+
1159
+ # Customize the options with defaults
1160
+ call_metadata = @config.rpcs.get_api_spec.metadata.to_h
1161
+
1162
+ # Set x-goog-api-client and x-goog-user-project headers
1163
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1164
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1165
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1166
+ transports_version_send: [:rest]
1167
+
1168
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1169
+
1170
+ options.apply_defaults timeout: @config.rpcs.get_api_spec.timeout,
1171
+ metadata: call_metadata,
1172
+ retry_policy: @config.rpcs.get_api_spec.retry_policy
1173
+
1174
+ options.apply_defaults timeout: @config.timeout,
1175
+ metadata: @config.metadata,
1176
+ retry_policy: @config.retry_policy
1177
+
1178
+ @registry_stub.get_api_spec request, options do |result, operation|
1179
+ yield result, operation if block_given?
1180
+ return result
1181
+ end
1182
+ rescue ::Gapic::Rest::Error => e
1183
+ raise ::Google::Cloud::Error.from_error(e)
1184
+ end
1185
+
1186
+ ##
1187
+ # Returns the contents of a specified spec.
1188
+ # If specs are stored with GZip compression, the default behavior
1189
+ # is to return the spec uncompressed (the mime_type response field
1190
+ # indicates the exact format returned).
1191
+ #
1192
+ # @overload get_api_spec_contents(request, options = nil)
1193
+ # Pass arguments to `get_api_spec_contents` via a request object, either of type
1194
+ # {::Google::Cloud::ApigeeRegistry::V1::GetApiSpecContentsRequest} or an equivalent Hash.
1195
+ #
1196
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetApiSpecContentsRequest, ::Hash]
1197
+ # A request object representing the call parameters. Required. To specify no
1198
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1199
+ # @param options [::Gapic::CallOptions, ::Hash]
1200
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1201
+ #
1202
+ # @overload get_api_spec_contents(name: nil)
1203
+ # Pass arguments to `get_api_spec_contents` via keyword arguments. Note that at
1204
+ # least one keyword argument is required. To specify no parameters, or to keep all
1205
+ # the default parameter values, pass an empty Hash as a request object (see above).
1206
+ #
1207
+ # @param name [::String]
1208
+ # Required. The name of the spec whose contents should be retrieved.
1209
+ # Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
1210
+ # @yield [result, operation] Access the result along with the TransportOperation object
1211
+ # @yieldparam result [::Google::Api::HttpBody]
1212
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1213
+ #
1214
+ # @return [::Google::Api::HttpBody]
1215
+ #
1216
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1217
+ def get_api_spec_contents request, options = nil
1218
+ raise ::ArgumentError, "request must be provided" if request.nil?
1219
+
1220
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetApiSpecContentsRequest
1221
+
1222
+ # Converts hash and nil to an options object
1223
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1224
+
1225
+ # Customize the options with defaults
1226
+ call_metadata = @config.rpcs.get_api_spec_contents.metadata.to_h
1227
+
1228
+ # Set x-goog-api-client and x-goog-user-project headers
1229
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1230
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1231
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1232
+ transports_version_send: [:rest]
1233
+
1234
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1235
+
1236
+ options.apply_defaults timeout: @config.rpcs.get_api_spec_contents.timeout,
1237
+ metadata: call_metadata,
1238
+ retry_policy: @config.rpcs.get_api_spec_contents.retry_policy
1239
+
1240
+ options.apply_defaults timeout: @config.timeout,
1241
+ metadata: @config.metadata,
1242
+ retry_policy: @config.retry_policy
1243
+
1244
+ @registry_stub.get_api_spec_contents request, options do |result, operation|
1245
+ yield result, operation if block_given?
1246
+ return result
1247
+ end
1248
+ rescue ::Gapic::Rest::Error => e
1249
+ raise ::Google::Cloud::Error.from_error(e)
1250
+ end
1251
+
1252
+ ##
1253
+ # Creates a specified spec.
1254
+ #
1255
+ # @overload create_api_spec(request, options = nil)
1256
+ # Pass arguments to `create_api_spec` via a request object, either of type
1257
+ # {::Google::Cloud::ApigeeRegistry::V1::CreateApiSpecRequest} or an equivalent Hash.
1258
+ #
1259
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::CreateApiSpecRequest, ::Hash]
1260
+ # A request object representing the call parameters. Required. To specify no
1261
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1262
+ # @param options [::Gapic::CallOptions, ::Hash]
1263
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1264
+ #
1265
+ # @overload create_api_spec(parent: nil, api_spec: nil, api_spec_id: nil)
1266
+ # Pass arguments to `create_api_spec` via keyword arguments. Note that at
1267
+ # least one keyword argument is required. To specify no parameters, or to keep all
1268
+ # the default parameter values, pass an empty Hash as a request object (see above).
1269
+ #
1270
+ # @param parent [::String]
1271
+ # Required. The parent, which owns this collection of specs.
1272
+ # Format: `projects/*/locations/*/apis/*/versions/*`
1273
+ # @param api_spec [::Google::Cloud::ApigeeRegistry::V1::ApiSpec, ::Hash]
1274
+ # Required. The spec to create.
1275
+ # @param api_spec_id [::String]
1276
+ # Required. The ID to use for the spec, which will become the final component of
1277
+ # the spec's resource name.
1278
+ #
1279
+ # This value should be 4-63 characters, and valid characters
1280
+ # are /[a-z][0-9]-/.
1281
+ #
1282
+ # Following AIP-162, IDs must not have the form of a UUID.
1283
+ # @yield [result, operation] Access the result along with the TransportOperation object
1284
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1285
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1286
+ #
1287
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1288
+ #
1289
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1290
+ def create_api_spec request, options = nil
1291
+ raise ::ArgumentError, "request must be provided" if request.nil?
1292
+
1293
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::CreateApiSpecRequest
1294
+
1295
+ # Converts hash and nil to an options object
1296
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1297
+
1298
+ # Customize the options with defaults
1299
+ call_metadata = @config.rpcs.create_api_spec.metadata.to_h
1300
+
1301
+ # Set x-goog-api-client and x-goog-user-project headers
1302
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1303
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1304
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1305
+ transports_version_send: [:rest]
1306
+
1307
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1308
+
1309
+ options.apply_defaults timeout: @config.rpcs.create_api_spec.timeout,
1310
+ metadata: call_metadata,
1311
+ retry_policy: @config.rpcs.create_api_spec.retry_policy
1312
+
1313
+ options.apply_defaults timeout: @config.timeout,
1314
+ metadata: @config.metadata,
1315
+ retry_policy: @config.retry_policy
1316
+
1317
+ @registry_stub.create_api_spec request, options do |result, operation|
1318
+ yield result, operation if block_given?
1319
+ return result
1320
+ end
1321
+ rescue ::Gapic::Rest::Error => e
1322
+ raise ::Google::Cloud::Error.from_error(e)
1323
+ end
1324
+
1325
+ ##
1326
+ # Used to modify a specified spec.
1327
+ #
1328
+ # @overload update_api_spec(request, options = nil)
1329
+ # Pass arguments to `update_api_spec` via a request object, either of type
1330
+ # {::Google::Cloud::ApigeeRegistry::V1::UpdateApiSpecRequest} or an equivalent Hash.
1331
+ #
1332
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::UpdateApiSpecRequest, ::Hash]
1333
+ # A request object representing the call parameters. Required. To specify no
1334
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1335
+ # @param options [::Gapic::CallOptions, ::Hash]
1336
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1337
+ #
1338
+ # @overload update_api_spec(api_spec: nil, update_mask: nil, allow_missing: nil)
1339
+ # Pass arguments to `update_api_spec` via keyword arguments. Note that at
1340
+ # least one keyword argument is required. To specify no parameters, or to keep all
1341
+ # the default parameter values, pass an empty Hash as a request object (see above).
1342
+ #
1343
+ # @param api_spec [::Google::Cloud::ApigeeRegistry::V1::ApiSpec, ::Hash]
1344
+ # Required. The spec to update.
1345
+ #
1346
+ # The `name` field is used to identify the spec to update.
1347
+ # Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
1348
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1349
+ # The list of fields to be updated. If omitted, all fields are updated that
1350
+ # are set in the request message (fields set to default values are ignored).
1351
+ # If an asterisk "*" is specified, all fields are updated, including fields
1352
+ # that are unspecified/default in the request.
1353
+ # @param allow_missing [::Boolean]
1354
+ # If set to true, and the spec is not found, a new spec will be created.
1355
+ # In this situation, `update_mask` is ignored.
1356
+ # @yield [result, operation] Access the result along with the TransportOperation object
1357
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1359
+ #
1360
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1361
+ #
1362
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1363
+ def update_api_spec request, options = nil
1364
+ raise ::ArgumentError, "request must be provided" if request.nil?
1365
+
1366
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::UpdateApiSpecRequest
1367
+
1368
+ # Converts hash and nil to an options object
1369
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1370
+
1371
+ # Customize the options with defaults
1372
+ call_metadata = @config.rpcs.update_api_spec.metadata.to_h
1373
+
1374
+ # Set x-goog-api-client and x-goog-user-project headers
1375
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1376
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1377
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1378
+ transports_version_send: [:rest]
1379
+
1380
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1381
+
1382
+ options.apply_defaults timeout: @config.rpcs.update_api_spec.timeout,
1383
+ metadata: call_metadata,
1384
+ retry_policy: @config.rpcs.update_api_spec.retry_policy
1385
+
1386
+ options.apply_defaults timeout: @config.timeout,
1387
+ metadata: @config.metadata,
1388
+ retry_policy: @config.retry_policy
1389
+
1390
+ @registry_stub.update_api_spec request, options do |result, operation|
1391
+ yield result, operation if block_given?
1392
+ return result
1393
+ end
1394
+ rescue ::Gapic::Rest::Error => e
1395
+ raise ::Google::Cloud::Error.from_error(e)
1396
+ end
1397
+
1398
+ ##
1399
+ # Removes a specified spec, all revisions, and all child
1400
+ # resources (e.g., artifacts).
1401
+ #
1402
+ # @overload delete_api_spec(request, options = nil)
1403
+ # Pass arguments to `delete_api_spec` via a request object, either of type
1404
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRequest} or an equivalent Hash.
1405
+ #
1406
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRequest, ::Hash]
1407
+ # A request object representing the call parameters. Required. To specify no
1408
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1409
+ # @param options [::Gapic::CallOptions, ::Hash]
1410
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1411
+ #
1412
+ # @overload delete_api_spec(name: nil, force: nil)
1413
+ # Pass arguments to `delete_api_spec` via keyword arguments. Note that at
1414
+ # least one keyword argument is required. To specify no parameters, or to keep all
1415
+ # the default parameter values, pass an empty Hash as a request object (see above).
1416
+ #
1417
+ # @param name [::String]
1418
+ # Required. The name of the spec to delete.
1419
+ # Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
1420
+ # @param force [::Boolean]
1421
+ # If set to true, any child resources will also be deleted.
1422
+ # (Otherwise, the request will only work if there are no child resources.)
1423
+ # @yield [result, operation] Access the result along with the TransportOperation object
1424
+ # @yieldparam result [::Google::Protobuf::Empty]
1425
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1426
+ #
1427
+ # @return [::Google::Protobuf::Empty]
1428
+ #
1429
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1430
+ def delete_api_spec request, options = nil
1431
+ raise ::ArgumentError, "request must be provided" if request.nil?
1432
+
1433
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRequest
1434
+
1435
+ # Converts hash and nil to an options object
1436
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1437
+
1438
+ # Customize the options with defaults
1439
+ call_metadata = @config.rpcs.delete_api_spec.metadata.to_h
1440
+
1441
+ # Set x-goog-api-client and x-goog-user-project headers
1442
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1443
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1444
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1445
+ transports_version_send: [:rest]
1446
+
1447
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1448
+
1449
+ options.apply_defaults timeout: @config.rpcs.delete_api_spec.timeout,
1450
+ metadata: call_metadata,
1451
+ retry_policy: @config.rpcs.delete_api_spec.retry_policy
1452
+
1453
+ options.apply_defaults timeout: @config.timeout,
1454
+ metadata: @config.metadata,
1455
+ retry_policy: @config.retry_policy
1456
+
1457
+ @registry_stub.delete_api_spec request, options do |result, operation|
1458
+ yield result, operation if block_given?
1459
+ return result
1460
+ end
1461
+ rescue ::Gapic::Rest::Error => e
1462
+ raise ::Google::Cloud::Error.from_error(e)
1463
+ end
1464
+
1465
+ ##
1466
+ # Adds a tag to a specified revision of a spec.
1467
+ #
1468
+ # @overload tag_api_spec_revision(request, options = nil)
1469
+ # Pass arguments to `tag_api_spec_revision` via a request object, either of type
1470
+ # {::Google::Cloud::ApigeeRegistry::V1::TagApiSpecRevisionRequest} or an equivalent Hash.
1471
+ #
1472
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::TagApiSpecRevisionRequest, ::Hash]
1473
+ # A request object representing the call parameters. Required. To specify no
1474
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1475
+ # @param options [::Gapic::CallOptions, ::Hash]
1476
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1477
+ #
1478
+ # @overload tag_api_spec_revision(name: nil, tag: nil)
1479
+ # Pass arguments to `tag_api_spec_revision` via keyword arguments. Note that at
1480
+ # least one keyword argument is required. To specify no parameters, or to keep all
1481
+ # the default parameter values, pass an empty Hash as a request object (see above).
1482
+ #
1483
+ # @param name [::String]
1484
+ # Required. The name of the spec to be tagged, including the revision ID.
1485
+ # @param tag [::String]
1486
+ # Required. The tag to apply.
1487
+ # The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`.
1488
+ # @yield [result, operation] Access the result along with the TransportOperation object
1489
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1490
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1491
+ #
1492
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1493
+ #
1494
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1495
+ def tag_api_spec_revision request, options = nil
1496
+ raise ::ArgumentError, "request must be provided" if request.nil?
1497
+
1498
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::TagApiSpecRevisionRequest
1499
+
1500
+ # Converts hash and nil to an options object
1501
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1502
+
1503
+ # Customize the options with defaults
1504
+ call_metadata = @config.rpcs.tag_api_spec_revision.metadata.to_h
1505
+
1506
+ # Set x-goog-api-client and x-goog-user-project headers
1507
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1508
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1509
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1510
+ transports_version_send: [:rest]
1511
+
1512
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1513
+
1514
+ options.apply_defaults timeout: @config.rpcs.tag_api_spec_revision.timeout,
1515
+ metadata: call_metadata,
1516
+ retry_policy: @config.rpcs.tag_api_spec_revision.retry_policy
1517
+
1518
+ options.apply_defaults timeout: @config.timeout,
1519
+ metadata: @config.metadata,
1520
+ retry_policy: @config.retry_policy
1521
+
1522
+ @registry_stub.tag_api_spec_revision request, options do |result, operation|
1523
+ yield result, operation if block_given?
1524
+ return result
1525
+ end
1526
+ rescue ::Gapic::Rest::Error => e
1527
+ raise ::Google::Cloud::Error.from_error(e)
1528
+ end
1529
+
1530
+ ##
1531
+ # Lists all revisions of a spec.
1532
+ # Revisions are returned in descending order of revision creation time.
1533
+ #
1534
+ # @overload list_api_spec_revisions(request, options = nil)
1535
+ # Pass arguments to `list_api_spec_revisions` via a request object, either of type
1536
+ # {::Google::Cloud::ApigeeRegistry::V1::ListApiSpecRevisionsRequest} or an equivalent Hash.
1537
+ #
1538
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ListApiSpecRevisionsRequest, ::Hash]
1539
+ # A request object representing the call parameters. Required. To specify no
1540
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1541
+ # @param options [::Gapic::CallOptions, ::Hash]
1542
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1543
+ #
1544
+ # @overload list_api_spec_revisions(name: nil, page_size: nil, page_token: nil)
1545
+ # Pass arguments to `list_api_spec_revisions` via keyword arguments. Note that at
1546
+ # least one keyword argument is required. To specify no parameters, or to keep all
1547
+ # the default parameter values, pass an empty Hash as a request object (see above).
1548
+ #
1549
+ # @param name [::String]
1550
+ # Required. The name of the spec to list revisions for.
1551
+ # @param page_size [::Integer]
1552
+ # The maximum number of revisions to return per page.
1553
+ # @param page_token [::String]
1554
+ # The page token, received from a previous ListApiSpecRevisions call.
1555
+ # Provide this to retrieve the subsequent page.
1556
+ # @yield [result, operation] Access the result along with the TransportOperation object
1557
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiSpec>]
1558
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1559
+ #
1560
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiSpec>]
1561
+ #
1562
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1563
+ def list_api_spec_revisions request, options = nil
1564
+ raise ::ArgumentError, "request must be provided" if request.nil?
1565
+
1566
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ListApiSpecRevisionsRequest
1567
+
1568
+ # Converts hash and nil to an options object
1569
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1570
+
1571
+ # Customize the options with defaults
1572
+ call_metadata = @config.rpcs.list_api_spec_revisions.metadata.to_h
1573
+
1574
+ # Set x-goog-api-client and x-goog-user-project headers
1575
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1576
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1577
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1578
+ transports_version_send: [:rest]
1579
+
1580
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1581
+
1582
+ options.apply_defaults timeout: @config.rpcs.list_api_spec_revisions.timeout,
1583
+ metadata: call_metadata,
1584
+ retry_policy: @config.rpcs.list_api_spec_revisions.retry_policy
1585
+
1586
+ options.apply_defaults timeout: @config.timeout,
1587
+ metadata: @config.metadata,
1588
+ retry_policy: @config.retry_policy
1589
+
1590
+ @registry_stub.list_api_spec_revisions request, options do |result, operation|
1591
+ result = ::Gapic::Rest::PagedEnumerable.new @registry_stub, :list_api_spec_revisions, "api_specs", request, result, options
1592
+ yield result, operation if block_given?
1593
+ return result
1594
+ end
1595
+ rescue ::Gapic::Rest::Error => e
1596
+ raise ::Google::Cloud::Error.from_error(e)
1597
+ end
1598
+
1599
+ ##
1600
+ # Sets the current revision to a specified prior revision.
1601
+ # Note that this creates a new revision with a new revision ID.
1602
+ #
1603
+ # @overload rollback_api_spec(request, options = nil)
1604
+ # Pass arguments to `rollback_api_spec` via a request object, either of type
1605
+ # {::Google::Cloud::ApigeeRegistry::V1::RollbackApiSpecRequest} or an equivalent Hash.
1606
+ #
1607
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::RollbackApiSpecRequest, ::Hash]
1608
+ # A request object representing the call parameters. Required. To specify no
1609
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1610
+ # @param options [::Gapic::CallOptions, ::Hash]
1611
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1612
+ #
1613
+ # @overload rollback_api_spec(name: nil, revision_id: nil)
1614
+ # Pass arguments to `rollback_api_spec` via keyword arguments. Note that at
1615
+ # least one keyword argument is required. To specify no parameters, or to keep all
1616
+ # the default parameter values, pass an empty Hash as a request object (see above).
1617
+ #
1618
+ # @param name [::String]
1619
+ # Required. The spec being rolled back.
1620
+ # @param revision_id [::String]
1621
+ # Required. The revision ID to roll back to.
1622
+ # It must be a revision of the same spec.
1623
+ #
1624
+ # Example: `c7cfa2a8`
1625
+ # @yield [result, operation] Access the result along with the TransportOperation object
1626
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1627
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1628
+ #
1629
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1630
+ #
1631
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1632
+ def rollback_api_spec request, options = nil
1633
+ raise ::ArgumentError, "request must be provided" if request.nil?
1634
+
1635
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::RollbackApiSpecRequest
1636
+
1637
+ # Converts hash and nil to an options object
1638
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1639
+
1640
+ # Customize the options with defaults
1641
+ call_metadata = @config.rpcs.rollback_api_spec.metadata.to_h
1642
+
1643
+ # Set x-goog-api-client and x-goog-user-project headers
1644
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1645
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1646
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1647
+ transports_version_send: [:rest]
1648
+
1649
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1650
+
1651
+ options.apply_defaults timeout: @config.rpcs.rollback_api_spec.timeout,
1652
+ metadata: call_metadata,
1653
+ retry_policy: @config.rpcs.rollback_api_spec.retry_policy
1654
+
1655
+ options.apply_defaults timeout: @config.timeout,
1656
+ metadata: @config.metadata,
1657
+ retry_policy: @config.retry_policy
1658
+
1659
+ @registry_stub.rollback_api_spec request, options do |result, operation|
1660
+ yield result, operation if block_given?
1661
+ return result
1662
+ end
1663
+ rescue ::Gapic::Rest::Error => e
1664
+ raise ::Google::Cloud::Error.from_error(e)
1665
+ end
1666
+
1667
+ ##
1668
+ # Deletes a revision of a spec.
1669
+ #
1670
+ # @overload delete_api_spec_revision(request, options = nil)
1671
+ # Pass arguments to `delete_api_spec_revision` via a request object, either of type
1672
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRevisionRequest} or an equivalent Hash.
1673
+ #
1674
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRevisionRequest, ::Hash]
1675
+ # A request object representing the call parameters. Required. To specify no
1676
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1677
+ # @param options [::Gapic::CallOptions, ::Hash]
1678
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1679
+ #
1680
+ # @overload delete_api_spec_revision(name: nil)
1681
+ # Pass arguments to `delete_api_spec_revision` via keyword arguments. Note that at
1682
+ # least one keyword argument is required. To specify no parameters, or to keep all
1683
+ # the default parameter values, pass an empty Hash as a request object (see above).
1684
+ #
1685
+ # @param name [::String]
1686
+ # Required. The name of the spec revision to be deleted,
1687
+ # with a revision ID explicitly included.
1688
+ #
1689
+ # Example:
1690
+ # `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8`
1691
+ # @yield [result, operation] Access the result along with the TransportOperation object
1692
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1693
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1694
+ #
1695
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiSpec]
1696
+ #
1697
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1698
+ def delete_api_spec_revision request, options = nil
1699
+ raise ::ArgumentError, "request must be provided" if request.nil?
1700
+
1701
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRevisionRequest
1702
+
1703
+ # Converts hash and nil to an options object
1704
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1705
+
1706
+ # Customize the options with defaults
1707
+ call_metadata = @config.rpcs.delete_api_spec_revision.metadata.to_h
1708
+
1709
+ # Set x-goog-api-client and x-goog-user-project headers
1710
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1711
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1712
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1713
+ transports_version_send: [:rest]
1714
+
1715
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1716
+
1717
+ options.apply_defaults timeout: @config.rpcs.delete_api_spec_revision.timeout,
1718
+ metadata: call_metadata,
1719
+ retry_policy: @config.rpcs.delete_api_spec_revision.retry_policy
1720
+
1721
+ options.apply_defaults timeout: @config.timeout,
1722
+ metadata: @config.metadata,
1723
+ retry_policy: @config.retry_policy
1724
+
1725
+ @registry_stub.delete_api_spec_revision request, options do |result, operation|
1726
+ yield result, operation if block_given?
1727
+ return result
1728
+ end
1729
+ rescue ::Gapic::Rest::Error => e
1730
+ raise ::Google::Cloud::Error.from_error(e)
1731
+ end
1732
+
1733
+ ##
1734
+ # Returns matching deployments.
1735
+ #
1736
+ # @overload list_api_deployments(request, options = nil)
1737
+ # Pass arguments to `list_api_deployments` via a request object, either of type
1738
+ # {::Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentsRequest} or an equivalent Hash.
1739
+ #
1740
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentsRequest, ::Hash]
1741
+ # A request object representing the call parameters. Required. To specify no
1742
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1743
+ # @param options [::Gapic::CallOptions, ::Hash]
1744
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1745
+ #
1746
+ # @overload list_api_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil)
1747
+ # Pass arguments to `list_api_deployments` via keyword arguments. Note that at
1748
+ # least one keyword argument is required. To specify no parameters, or to keep all
1749
+ # the default parameter values, pass an empty Hash as a request object (see above).
1750
+ #
1751
+ # @param parent [::String]
1752
+ # Required. The parent, which owns this collection of deployments.
1753
+ # Format: `projects/*/locations/*/apis/*`
1754
+ # @param page_size [::Integer]
1755
+ # The maximum number of deployments to return.
1756
+ # The service may return fewer than this value.
1757
+ # If unspecified, at most 50 values will be returned.
1758
+ # The maximum is 1000; values above 1000 will be coerced to 1000.
1759
+ # @param page_token [::String]
1760
+ # A page token, received from a previous `ListApiDeployments` call.
1761
+ # Provide this to retrieve the subsequent page.
1762
+ #
1763
+ # When paginating, all other parameters provided to `ListApiDeployments` must
1764
+ # match the call that provided the page token.
1765
+ # @param filter [::String]
1766
+ # An expression that can be used to filter the list. Filters use the Common
1767
+ # Expression Language and can refer to all message fields.
1768
+ # @yield [result, operation] Access the result along with the TransportOperation object
1769
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiDeployment>]
1770
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1771
+ #
1772
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiDeployment>]
1773
+ #
1774
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1775
+ def list_api_deployments request, options = nil
1776
+ raise ::ArgumentError, "request must be provided" if request.nil?
1777
+
1778
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentsRequest
1779
+
1780
+ # Converts hash and nil to an options object
1781
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1782
+
1783
+ # Customize the options with defaults
1784
+ call_metadata = @config.rpcs.list_api_deployments.metadata.to_h
1785
+
1786
+ # Set x-goog-api-client and x-goog-user-project headers
1787
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1788
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1789
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1790
+ transports_version_send: [:rest]
1791
+
1792
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1793
+
1794
+ options.apply_defaults timeout: @config.rpcs.list_api_deployments.timeout,
1795
+ metadata: call_metadata,
1796
+ retry_policy: @config.rpcs.list_api_deployments.retry_policy
1797
+
1798
+ options.apply_defaults timeout: @config.timeout,
1799
+ metadata: @config.metadata,
1800
+ retry_policy: @config.retry_policy
1801
+
1802
+ @registry_stub.list_api_deployments request, options do |result, operation|
1803
+ result = ::Gapic::Rest::PagedEnumerable.new @registry_stub, :list_api_deployments, "api_deployments", request, result, options
1804
+ yield result, operation if block_given?
1805
+ return result
1806
+ end
1807
+ rescue ::Gapic::Rest::Error => e
1808
+ raise ::Google::Cloud::Error.from_error(e)
1809
+ end
1810
+
1811
+ ##
1812
+ # Returns a specified deployment.
1813
+ #
1814
+ # @overload get_api_deployment(request, options = nil)
1815
+ # Pass arguments to `get_api_deployment` via a request object, either of type
1816
+ # {::Google::Cloud::ApigeeRegistry::V1::GetApiDeploymentRequest} or an equivalent Hash.
1817
+ #
1818
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetApiDeploymentRequest, ::Hash]
1819
+ # A request object representing the call parameters. Required. To specify no
1820
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1821
+ # @param options [::Gapic::CallOptions, ::Hash]
1822
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1823
+ #
1824
+ # @overload get_api_deployment(name: nil)
1825
+ # Pass arguments to `get_api_deployment` via keyword arguments. Note that at
1826
+ # least one keyword argument is required. To specify no parameters, or to keep all
1827
+ # the default parameter values, pass an empty Hash as a request object (see above).
1828
+ #
1829
+ # @param name [::String]
1830
+ # Required. The name of the deployment to retrieve.
1831
+ # Format: `projects/*/locations/*/apis/*/deployments/*`
1832
+ # @yield [result, operation] Access the result along with the TransportOperation object
1833
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
1834
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1835
+ #
1836
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
1837
+ #
1838
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1839
+ def get_api_deployment request, options = nil
1840
+ raise ::ArgumentError, "request must be provided" if request.nil?
1841
+
1842
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetApiDeploymentRequest
1843
+
1844
+ # Converts hash and nil to an options object
1845
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1846
+
1847
+ # Customize the options with defaults
1848
+ call_metadata = @config.rpcs.get_api_deployment.metadata.to_h
1849
+
1850
+ # Set x-goog-api-client and x-goog-user-project headers
1851
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1852
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1853
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1854
+ transports_version_send: [:rest]
1855
+
1856
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1857
+
1858
+ options.apply_defaults timeout: @config.rpcs.get_api_deployment.timeout,
1859
+ metadata: call_metadata,
1860
+ retry_policy: @config.rpcs.get_api_deployment.retry_policy
1861
+
1862
+ options.apply_defaults timeout: @config.timeout,
1863
+ metadata: @config.metadata,
1864
+ retry_policy: @config.retry_policy
1865
+
1866
+ @registry_stub.get_api_deployment request, options do |result, operation|
1867
+ yield result, operation if block_given?
1868
+ return result
1869
+ end
1870
+ rescue ::Gapic::Rest::Error => e
1871
+ raise ::Google::Cloud::Error.from_error(e)
1872
+ end
1873
+
1874
+ ##
1875
+ # Creates a specified deployment.
1876
+ #
1877
+ # @overload create_api_deployment(request, options = nil)
1878
+ # Pass arguments to `create_api_deployment` via a request object, either of type
1879
+ # {::Google::Cloud::ApigeeRegistry::V1::CreateApiDeploymentRequest} or an equivalent Hash.
1880
+ #
1881
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::CreateApiDeploymentRequest, ::Hash]
1882
+ # A request object representing the call parameters. Required. To specify no
1883
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1884
+ # @param options [::Gapic::CallOptions, ::Hash]
1885
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1886
+ #
1887
+ # @overload create_api_deployment(parent: nil, api_deployment: nil, api_deployment_id: nil)
1888
+ # Pass arguments to `create_api_deployment` via keyword arguments. Note that at
1889
+ # least one keyword argument is required. To specify no parameters, or to keep all
1890
+ # the default parameter values, pass an empty Hash as a request object (see above).
1891
+ #
1892
+ # @param parent [::String]
1893
+ # Required. The parent, which owns this collection of deployments.
1894
+ # Format: `projects/*/locations/*/apis/*`
1895
+ # @param api_deployment [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment, ::Hash]
1896
+ # Required. The deployment to create.
1897
+ # @param api_deployment_id [::String]
1898
+ # Required. The ID to use for the deployment, which will become the final component of
1899
+ # the deployment's resource name.
1900
+ #
1901
+ # This value should be 4-63 characters, and valid characters
1902
+ # are /[a-z][0-9]-/.
1903
+ #
1904
+ # Following AIP-162, IDs must not have the form of a UUID.
1905
+ # @yield [result, operation] Access the result along with the TransportOperation object
1906
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
1907
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1908
+ #
1909
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
1910
+ #
1911
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1912
+ def create_api_deployment request, options = nil
1913
+ raise ::ArgumentError, "request must be provided" if request.nil?
1914
+
1915
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::CreateApiDeploymentRequest
1916
+
1917
+ # Converts hash and nil to an options object
1918
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1919
+
1920
+ # Customize the options with defaults
1921
+ call_metadata = @config.rpcs.create_api_deployment.metadata.to_h
1922
+
1923
+ # Set x-goog-api-client and x-goog-user-project headers
1924
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1925
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1926
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
1927
+ transports_version_send: [:rest]
1928
+
1929
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1930
+
1931
+ options.apply_defaults timeout: @config.rpcs.create_api_deployment.timeout,
1932
+ metadata: call_metadata,
1933
+ retry_policy: @config.rpcs.create_api_deployment.retry_policy
1934
+
1935
+ options.apply_defaults timeout: @config.timeout,
1936
+ metadata: @config.metadata,
1937
+ retry_policy: @config.retry_policy
1938
+
1939
+ @registry_stub.create_api_deployment request, options do |result, operation|
1940
+ yield result, operation if block_given?
1941
+ return result
1942
+ end
1943
+ rescue ::Gapic::Rest::Error => e
1944
+ raise ::Google::Cloud::Error.from_error(e)
1945
+ end
1946
+
1947
+ ##
1948
+ # Used to modify a specified deployment.
1949
+ #
1950
+ # @overload update_api_deployment(request, options = nil)
1951
+ # Pass arguments to `update_api_deployment` via a request object, either of type
1952
+ # {::Google::Cloud::ApigeeRegistry::V1::UpdateApiDeploymentRequest} or an equivalent Hash.
1953
+ #
1954
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::UpdateApiDeploymentRequest, ::Hash]
1955
+ # A request object representing the call parameters. Required. To specify no
1956
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1957
+ # @param options [::Gapic::CallOptions, ::Hash]
1958
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1959
+ #
1960
+ # @overload update_api_deployment(api_deployment: nil, update_mask: nil, allow_missing: nil)
1961
+ # Pass arguments to `update_api_deployment` via keyword arguments. Note that at
1962
+ # least one keyword argument is required. To specify no parameters, or to keep all
1963
+ # the default parameter values, pass an empty Hash as a request object (see above).
1964
+ #
1965
+ # @param api_deployment [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment, ::Hash]
1966
+ # Required. The deployment to update.
1967
+ #
1968
+ # The `name` field is used to identify the deployment to update.
1969
+ # Format: `projects/*/locations/*/apis/*/deployments/*`
1970
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1971
+ # The list of fields to be updated. If omitted, all fields are updated that
1972
+ # are set in the request message (fields set to default values are ignored).
1973
+ # If an asterisk "*" is specified, all fields are updated, including fields
1974
+ # that are unspecified/default in the request.
1975
+ # @param allow_missing [::Boolean]
1976
+ # If set to true, and the deployment is not found, a new deployment will be
1977
+ # created. In this situation, `update_mask` is ignored.
1978
+ # @yield [result, operation] Access the result along with the TransportOperation object
1979
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
1980
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1981
+ #
1982
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
1983
+ #
1984
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1985
+ def update_api_deployment request, options = nil
1986
+ raise ::ArgumentError, "request must be provided" if request.nil?
1987
+
1988
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::UpdateApiDeploymentRequest
1989
+
1990
+ # Converts hash and nil to an options object
1991
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1992
+
1993
+ # Customize the options with defaults
1994
+ call_metadata = @config.rpcs.update_api_deployment.metadata.to_h
1995
+
1996
+ # Set x-goog-api-client and x-goog-user-project headers
1997
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1998
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1999
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2000
+ transports_version_send: [:rest]
2001
+
2002
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2003
+
2004
+ options.apply_defaults timeout: @config.rpcs.update_api_deployment.timeout,
2005
+ metadata: call_metadata,
2006
+ retry_policy: @config.rpcs.update_api_deployment.retry_policy
2007
+
2008
+ options.apply_defaults timeout: @config.timeout,
2009
+ metadata: @config.metadata,
2010
+ retry_policy: @config.retry_policy
2011
+
2012
+ @registry_stub.update_api_deployment request, options do |result, operation|
2013
+ yield result, operation if block_given?
2014
+ return result
2015
+ end
2016
+ rescue ::Gapic::Rest::Error => e
2017
+ raise ::Google::Cloud::Error.from_error(e)
2018
+ end
2019
+
2020
+ ##
2021
+ # Removes a specified deployment, all revisions, and all
2022
+ # child resources (e.g., artifacts).
2023
+ #
2024
+ # @overload delete_api_deployment(request, options = nil)
2025
+ # Pass arguments to `delete_api_deployment` via a request object, either of type
2026
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRequest} or an equivalent Hash.
2027
+ #
2028
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRequest, ::Hash]
2029
+ # A request object representing the call parameters. Required. To specify no
2030
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2031
+ # @param options [::Gapic::CallOptions, ::Hash]
2032
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2033
+ #
2034
+ # @overload delete_api_deployment(name: nil, force: nil)
2035
+ # Pass arguments to `delete_api_deployment` via keyword arguments. Note that at
2036
+ # least one keyword argument is required. To specify no parameters, or to keep all
2037
+ # the default parameter values, pass an empty Hash as a request object (see above).
2038
+ #
2039
+ # @param name [::String]
2040
+ # Required. The name of the deployment to delete.
2041
+ # Format: `projects/*/locations/*/apis/*/deployments/*`
2042
+ # @param force [::Boolean]
2043
+ # If set to true, any child resources will also be deleted.
2044
+ # (Otherwise, the request will only work if there are no child resources.)
2045
+ # @yield [result, operation] Access the result along with the TransportOperation object
2046
+ # @yieldparam result [::Google::Protobuf::Empty]
2047
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2048
+ #
2049
+ # @return [::Google::Protobuf::Empty]
2050
+ #
2051
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2052
+ def delete_api_deployment request, options = nil
2053
+ raise ::ArgumentError, "request must be provided" if request.nil?
2054
+
2055
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRequest
2056
+
2057
+ # Converts hash and nil to an options object
2058
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2059
+
2060
+ # Customize the options with defaults
2061
+ call_metadata = @config.rpcs.delete_api_deployment.metadata.to_h
2062
+
2063
+ # Set x-goog-api-client and x-goog-user-project headers
2064
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2065
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2066
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2067
+ transports_version_send: [:rest]
2068
+
2069
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2070
+
2071
+ options.apply_defaults timeout: @config.rpcs.delete_api_deployment.timeout,
2072
+ metadata: call_metadata,
2073
+ retry_policy: @config.rpcs.delete_api_deployment.retry_policy
2074
+
2075
+ options.apply_defaults timeout: @config.timeout,
2076
+ metadata: @config.metadata,
2077
+ retry_policy: @config.retry_policy
2078
+
2079
+ @registry_stub.delete_api_deployment request, options do |result, operation|
2080
+ yield result, operation if block_given?
2081
+ return result
2082
+ end
2083
+ rescue ::Gapic::Rest::Error => e
2084
+ raise ::Google::Cloud::Error.from_error(e)
2085
+ end
2086
+
2087
+ ##
2088
+ # Adds a tag to a specified revision of a
2089
+ # deployment.
2090
+ #
2091
+ # @overload tag_api_deployment_revision(request, options = nil)
2092
+ # Pass arguments to `tag_api_deployment_revision` via a request object, either of type
2093
+ # {::Google::Cloud::ApigeeRegistry::V1::TagApiDeploymentRevisionRequest} or an equivalent Hash.
2094
+ #
2095
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::TagApiDeploymentRevisionRequest, ::Hash]
2096
+ # A request object representing the call parameters. Required. To specify no
2097
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2098
+ # @param options [::Gapic::CallOptions, ::Hash]
2099
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2100
+ #
2101
+ # @overload tag_api_deployment_revision(name: nil, tag: nil)
2102
+ # Pass arguments to `tag_api_deployment_revision` via keyword arguments. Note that at
2103
+ # least one keyword argument is required. To specify no parameters, or to keep all
2104
+ # the default parameter values, pass an empty Hash as a request object (see above).
2105
+ #
2106
+ # @param name [::String]
2107
+ # Required. The name of the deployment to be tagged, including the revision ID.
2108
+ # @param tag [::String]
2109
+ # Required. The tag to apply.
2110
+ # The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`.
2111
+ # @yield [result, operation] Access the result along with the TransportOperation object
2112
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
2113
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2114
+ #
2115
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
2116
+ #
2117
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2118
+ def tag_api_deployment_revision request, options = nil
2119
+ raise ::ArgumentError, "request must be provided" if request.nil?
2120
+
2121
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::TagApiDeploymentRevisionRequest
2122
+
2123
+ # Converts hash and nil to an options object
2124
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2125
+
2126
+ # Customize the options with defaults
2127
+ call_metadata = @config.rpcs.tag_api_deployment_revision.metadata.to_h
2128
+
2129
+ # Set x-goog-api-client and x-goog-user-project headers
2130
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2131
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2132
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2133
+ transports_version_send: [:rest]
2134
+
2135
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2136
+
2137
+ options.apply_defaults timeout: @config.rpcs.tag_api_deployment_revision.timeout,
2138
+ metadata: call_metadata,
2139
+ retry_policy: @config.rpcs.tag_api_deployment_revision.retry_policy
2140
+
2141
+ options.apply_defaults timeout: @config.timeout,
2142
+ metadata: @config.metadata,
2143
+ retry_policy: @config.retry_policy
2144
+
2145
+ @registry_stub.tag_api_deployment_revision request, options do |result, operation|
2146
+ yield result, operation if block_given?
2147
+ return result
2148
+ end
2149
+ rescue ::Gapic::Rest::Error => e
2150
+ raise ::Google::Cloud::Error.from_error(e)
2151
+ end
2152
+
2153
+ ##
2154
+ # Lists all revisions of a deployment.
2155
+ # Revisions are returned in descending order of revision creation time.
2156
+ #
2157
+ # @overload list_api_deployment_revisions(request, options = nil)
2158
+ # Pass arguments to `list_api_deployment_revisions` via a request object, either of type
2159
+ # {::Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentRevisionsRequest} or an equivalent Hash.
2160
+ #
2161
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentRevisionsRequest, ::Hash]
2162
+ # A request object representing the call parameters. Required. To specify no
2163
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2164
+ # @param options [::Gapic::CallOptions, ::Hash]
2165
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2166
+ #
2167
+ # @overload list_api_deployment_revisions(name: nil, page_size: nil, page_token: nil)
2168
+ # Pass arguments to `list_api_deployment_revisions` via keyword arguments. Note that at
2169
+ # least one keyword argument is required. To specify no parameters, or to keep all
2170
+ # the default parameter values, pass an empty Hash as a request object (see above).
2171
+ #
2172
+ # @param name [::String]
2173
+ # Required. The name of the deployment to list revisions for.
2174
+ # @param page_size [::Integer]
2175
+ # The maximum number of revisions to return per page.
2176
+ # @param page_token [::String]
2177
+ # The page token, received from a previous ListApiDeploymentRevisions call.
2178
+ # Provide this to retrieve the subsequent page.
2179
+ # @yield [result, operation] Access the result along with the TransportOperation object
2180
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiDeployment>]
2181
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2182
+ #
2183
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::ApiDeployment>]
2184
+ #
2185
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2186
+ def list_api_deployment_revisions request, options = nil
2187
+ raise ::ArgumentError, "request must be provided" if request.nil?
2188
+
2189
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentRevisionsRequest
2190
+
2191
+ # Converts hash and nil to an options object
2192
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2193
+
2194
+ # Customize the options with defaults
2195
+ call_metadata = @config.rpcs.list_api_deployment_revisions.metadata.to_h
2196
+
2197
+ # Set x-goog-api-client and x-goog-user-project headers
2198
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2199
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2200
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2201
+ transports_version_send: [:rest]
2202
+
2203
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2204
+
2205
+ options.apply_defaults timeout: @config.rpcs.list_api_deployment_revisions.timeout,
2206
+ metadata: call_metadata,
2207
+ retry_policy: @config.rpcs.list_api_deployment_revisions.retry_policy
2208
+
2209
+ options.apply_defaults timeout: @config.timeout,
2210
+ metadata: @config.metadata,
2211
+ retry_policy: @config.retry_policy
2212
+
2213
+ @registry_stub.list_api_deployment_revisions request, options do |result, operation|
2214
+ result = ::Gapic::Rest::PagedEnumerable.new @registry_stub, :list_api_deployment_revisions, "api_deployments", request, result, options
2215
+ yield result, operation if block_given?
2216
+ return result
2217
+ end
2218
+ rescue ::Gapic::Rest::Error => e
2219
+ raise ::Google::Cloud::Error.from_error(e)
2220
+ end
2221
+
2222
+ ##
2223
+ # Sets the current revision to a specified prior
2224
+ # revision. Note that this creates a new revision with a new revision ID.
2225
+ #
2226
+ # @overload rollback_api_deployment(request, options = nil)
2227
+ # Pass arguments to `rollback_api_deployment` via a request object, either of type
2228
+ # {::Google::Cloud::ApigeeRegistry::V1::RollbackApiDeploymentRequest} or an equivalent Hash.
2229
+ #
2230
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::RollbackApiDeploymentRequest, ::Hash]
2231
+ # A request object representing the call parameters. Required. To specify no
2232
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2233
+ # @param options [::Gapic::CallOptions, ::Hash]
2234
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2235
+ #
2236
+ # @overload rollback_api_deployment(name: nil, revision_id: nil)
2237
+ # Pass arguments to `rollback_api_deployment` via keyword arguments. Note that at
2238
+ # least one keyword argument is required. To specify no parameters, or to keep all
2239
+ # the default parameter values, pass an empty Hash as a request object (see above).
2240
+ #
2241
+ # @param name [::String]
2242
+ # Required. The deployment being rolled back.
2243
+ # @param revision_id [::String]
2244
+ # Required. The revision ID to roll back to.
2245
+ # It must be a revision of the same deployment.
2246
+ #
2247
+ # Example: `c7cfa2a8`
2248
+ # @yield [result, operation] Access the result along with the TransportOperation object
2249
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
2250
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2251
+ #
2252
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
2253
+ #
2254
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2255
+ def rollback_api_deployment request, options = nil
2256
+ raise ::ArgumentError, "request must be provided" if request.nil?
2257
+
2258
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::RollbackApiDeploymentRequest
2259
+
2260
+ # Converts hash and nil to an options object
2261
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2262
+
2263
+ # Customize the options with defaults
2264
+ call_metadata = @config.rpcs.rollback_api_deployment.metadata.to_h
2265
+
2266
+ # Set x-goog-api-client and x-goog-user-project headers
2267
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2269
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2270
+ transports_version_send: [:rest]
2271
+
2272
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2273
+
2274
+ options.apply_defaults timeout: @config.rpcs.rollback_api_deployment.timeout,
2275
+ metadata: call_metadata,
2276
+ retry_policy: @config.rpcs.rollback_api_deployment.retry_policy
2277
+
2278
+ options.apply_defaults timeout: @config.timeout,
2279
+ metadata: @config.metadata,
2280
+ retry_policy: @config.retry_policy
2281
+
2282
+ @registry_stub.rollback_api_deployment request, options do |result, operation|
2283
+ yield result, operation if block_given?
2284
+ return result
2285
+ end
2286
+ rescue ::Gapic::Rest::Error => e
2287
+ raise ::Google::Cloud::Error.from_error(e)
2288
+ end
2289
+
2290
+ ##
2291
+ # Deletes a revision of a deployment.
2292
+ #
2293
+ # @overload delete_api_deployment_revision(request, options = nil)
2294
+ # Pass arguments to `delete_api_deployment_revision` via a request object, either of type
2295
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRevisionRequest} or an equivalent Hash.
2296
+ #
2297
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRevisionRequest, ::Hash]
2298
+ # A request object representing the call parameters. Required. To specify no
2299
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2300
+ # @param options [::Gapic::CallOptions, ::Hash]
2301
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2302
+ #
2303
+ # @overload delete_api_deployment_revision(name: nil)
2304
+ # Pass arguments to `delete_api_deployment_revision` via keyword arguments. Note that at
2305
+ # least one keyword argument is required. To specify no parameters, or to keep all
2306
+ # the default parameter values, pass an empty Hash as a request object (see above).
2307
+ #
2308
+ # @param name [::String]
2309
+ # Required. The name of the deployment revision to be deleted,
2310
+ # with a revision ID explicitly included.
2311
+ #
2312
+ # Example:
2313
+ # `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8`
2314
+ # @yield [result, operation] Access the result along with the TransportOperation object
2315
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
2316
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2317
+ #
2318
+ # @return [::Google::Cloud::ApigeeRegistry::V1::ApiDeployment]
2319
+ #
2320
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2321
+ def delete_api_deployment_revision request, options = nil
2322
+ raise ::ArgumentError, "request must be provided" if request.nil?
2323
+
2324
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRevisionRequest
2325
+
2326
+ # Converts hash and nil to an options object
2327
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2328
+
2329
+ # Customize the options with defaults
2330
+ call_metadata = @config.rpcs.delete_api_deployment_revision.metadata.to_h
2331
+
2332
+ # Set x-goog-api-client and x-goog-user-project headers
2333
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2334
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2335
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2336
+ transports_version_send: [:rest]
2337
+
2338
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2339
+
2340
+ options.apply_defaults timeout: @config.rpcs.delete_api_deployment_revision.timeout,
2341
+ metadata: call_metadata,
2342
+ retry_policy: @config.rpcs.delete_api_deployment_revision.retry_policy
2343
+
2344
+ options.apply_defaults timeout: @config.timeout,
2345
+ metadata: @config.metadata,
2346
+ retry_policy: @config.retry_policy
2347
+
2348
+ @registry_stub.delete_api_deployment_revision request, options do |result, operation|
2349
+ yield result, operation if block_given?
2350
+ return result
2351
+ end
2352
+ rescue ::Gapic::Rest::Error => e
2353
+ raise ::Google::Cloud::Error.from_error(e)
2354
+ end
2355
+
2356
+ ##
2357
+ # Returns matching artifacts.
2358
+ #
2359
+ # @overload list_artifacts(request, options = nil)
2360
+ # Pass arguments to `list_artifacts` via a request object, either of type
2361
+ # {::Google::Cloud::ApigeeRegistry::V1::ListArtifactsRequest} or an equivalent Hash.
2362
+ #
2363
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ListArtifactsRequest, ::Hash]
2364
+ # A request object representing the call parameters. Required. To specify no
2365
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2366
+ # @param options [::Gapic::CallOptions, ::Hash]
2367
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2368
+ #
2369
+ # @overload list_artifacts(parent: nil, page_size: nil, page_token: nil, filter: nil)
2370
+ # Pass arguments to `list_artifacts` via keyword arguments. Note that at
2371
+ # least one keyword argument is required. To specify no parameters, or to keep all
2372
+ # the default parameter values, pass an empty Hash as a request object (see above).
2373
+ #
2374
+ # @param parent [::String]
2375
+ # Required. The parent, which owns this collection of artifacts.
2376
+ # Format: `{parent}`
2377
+ # @param page_size [::Integer]
2378
+ # The maximum number of artifacts to return.
2379
+ # The service may return fewer than this value.
2380
+ # If unspecified, at most 50 values will be returned.
2381
+ # The maximum is 1000; values above 1000 will be coerced to 1000.
2382
+ # @param page_token [::String]
2383
+ # A page token, received from a previous `ListArtifacts` call.
2384
+ # Provide this to retrieve the subsequent page.
2385
+ #
2386
+ # When paginating, all other parameters provided to `ListArtifacts` must
2387
+ # match the call that provided the page token.
2388
+ # @param filter [::String]
2389
+ # An expression that can be used to filter the list. Filters use the Common
2390
+ # Expression Language and can refer to all message fields except contents.
2391
+ # @yield [result, operation] Access the result along with the TransportOperation object
2392
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::Artifact>]
2393
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2394
+ #
2395
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApigeeRegistry::V1::Artifact>]
2396
+ #
2397
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2398
+ def list_artifacts request, options = nil
2399
+ raise ::ArgumentError, "request must be provided" if request.nil?
2400
+
2401
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ListArtifactsRequest
2402
+
2403
+ # Converts hash and nil to an options object
2404
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2405
+
2406
+ # Customize the options with defaults
2407
+ call_metadata = @config.rpcs.list_artifacts.metadata.to_h
2408
+
2409
+ # Set x-goog-api-client and x-goog-user-project headers
2410
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2411
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2412
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2413
+ transports_version_send: [:rest]
2414
+
2415
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2416
+
2417
+ options.apply_defaults timeout: @config.rpcs.list_artifacts.timeout,
2418
+ metadata: call_metadata,
2419
+ retry_policy: @config.rpcs.list_artifacts.retry_policy
2420
+
2421
+ options.apply_defaults timeout: @config.timeout,
2422
+ metadata: @config.metadata,
2423
+ retry_policy: @config.retry_policy
2424
+
2425
+ @registry_stub.list_artifacts request, options do |result, operation|
2426
+ result = ::Gapic::Rest::PagedEnumerable.new @registry_stub, :list_artifacts, "artifacts", request, result, options
2427
+ yield result, operation if block_given?
2428
+ return result
2429
+ end
2430
+ rescue ::Gapic::Rest::Error => e
2431
+ raise ::Google::Cloud::Error.from_error(e)
2432
+ end
2433
+
2434
+ ##
2435
+ # Returns a specified artifact.
2436
+ #
2437
+ # @overload get_artifact(request, options = nil)
2438
+ # Pass arguments to `get_artifact` via a request object, either of type
2439
+ # {::Google::Cloud::ApigeeRegistry::V1::GetArtifactRequest} or an equivalent Hash.
2440
+ #
2441
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetArtifactRequest, ::Hash]
2442
+ # A request object representing the call parameters. Required. To specify no
2443
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2444
+ # @param options [::Gapic::CallOptions, ::Hash]
2445
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2446
+ #
2447
+ # @overload get_artifact(name: nil)
2448
+ # Pass arguments to `get_artifact` via keyword arguments. Note that at
2449
+ # least one keyword argument is required. To specify no parameters, or to keep all
2450
+ # the default parameter values, pass an empty Hash as a request object (see above).
2451
+ #
2452
+ # @param name [::String]
2453
+ # Required. The name of the artifact to retrieve.
2454
+ # Format: `{parent}/artifacts/*`
2455
+ # @yield [result, operation] Access the result along with the TransportOperation object
2456
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::Artifact]
2457
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2458
+ #
2459
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Artifact]
2460
+ #
2461
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2462
+ def get_artifact request, options = nil
2463
+ raise ::ArgumentError, "request must be provided" if request.nil?
2464
+
2465
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetArtifactRequest
2466
+
2467
+ # Converts hash and nil to an options object
2468
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2469
+
2470
+ # Customize the options with defaults
2471
+ call_metadata = @config.rpcs.get_artifact.metadata.to_h
2472
+
2473
+ # Set x-goog-api-client and x-goog-user-project headers
2474
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2475
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2476
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2477
+ transports_version_send: [:rest]
2478
+
2479
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2480
+
2481
+ options.apply_defaults timeout: @config.rpcs.get_artifact.timeout,
2482
+ metadata: call_metadata,
2483
+ retry_policy: @config.rpcs.get_artifact.retry_policy
2484
+
2485
+ options.apply_defaults timeout: @config.timeout,
2486
+ metadata: @config.metadata,
2487
+ retry_policy: @config.retry_policy
2488
+
2489
+ @registry_stub.get_artifact request, options do |result, operation|
2490
+ yield result, operation if block_given?
2491
+ return result
2492
+ end
2493
+ rescue ::Gapic::Rest::Error => e
2494
+ raise ::Google::Cloud::Error.from_error(e)
2495
+ end
2496
+
2497
+ ##
2498
+ # Returns the contents of a specified artifact.
2499
+ # If artifacts are stored with GZip compression, the default behavior
2500
+ # is to return the artifact uncompressed (the mime_type response field
2501
+ # indicates the exact format returned).
2502
+ #
2503
+ # @overload get_artifact_contents(request, options = nil)
2504
+ # Pass arguments to `get_artifact_contents` via a request object, either of type
2505
+ # {::Google::Cloud::ApigeeRegistry::V1::GetArtifactContentsRequest} or an equivalent Hash.
2506
+ #
2507
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::GetArtifactContentsRequest, ::Hash]
2508
+ # A request object representing the call parameters. Required. To specify no
2509
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2510
+ # @param options [::Gapic::CallOptions, ::Hash]
2511
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2512
+ #
2513
+ # @overload get_artifact_contents(name: nil)
2514
+ # Pass arguments to `get_artifact_contents` via keyword arguments. Note that at
2515
+ # least one keyword argument is required. To specify no parameters, or to keep all
2516
+ # the default parameter values, pass an empty Hash as a request object (see above).
2517
+ #
2518
+ # @param name [::String]
2519
+ # Required. The name of the artifact whose contents should be retrieved.
2520
+ # Format: `{parent}/artifacts/*`
2521
+ # @yield [result, operation] Access the result along with the TransportOperation object
2522
+ # @yieldparam result [::Google::Api::HttpBody]
2523
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2524
+ #
2525
+ # @return [::Google::Api::HttpBody]
2526
+ #
2527
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2528
+ def get_artifact_contents request, options = nil
2529
+ raise ::ArgumentError, "request must be provided" if request.nil?
2530
+
2531
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::GetArtifactContentsRequest
2532
+
2533
+ # Converts hash and nil to an options object
2534
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2535
+
2536
+ # Customize the options with defaults
2537
+ call_metadata = @config.rpcs.get_artifact_contents.metadata.to_h
2538
+
2539
+ # Set x-goog-api-client and x-goog-user-project headers
2540
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2541
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2542
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2543
+ transports_version_send: [:rest]
2544
+
2545
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2546
+
2547
+ options.apply_defaults timeout: @config.rpcs.get_artifact_contents.timeout,
2548
+ metadata: call_metadata,
2549
+ retry_policy: @config.rpcs.get_artifact_contents.retry_policy
2550
+
2551
+ options.apply_defaults timeout: @config.timeout,
2552
+ metadata: @config.metadata,
2553
+ retry_policy: @config.retry_policy
2554
+
2555
+ @registry_stub.get_artifact_contents request, options do |result, operation|
2556
+ yield result, operation if block_given?
2557
+ return result
2558
+ end
2559
+ rescue ::Gapic::Rest::Error => e
2560
+ raise ::Google::Cloud::Error.from_error(e)
2561
+ end
2562
+
2563
+ ##
2564
+ # Creates a specified artifact.
2565
+ #
2566
+ # @overload create_artifact(request, options = nil)
2567
+ # Pass arguments to `create_artifact` via a request object, either of type
2568
+ # {::Google::Cloud::ApigeeRegistry::V1::CreateArtifactRequest} or an equivalent Hash.
2569
+ #
2570
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::CreateArtifactRequest, ::Hash]
2571
+ # A request object representing the call parameters. Required. To specify no
2572
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2573
+ # @param options [::Gapic::CallOptions, ::Hash]
2574
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2575
+ #
2576
+ # @overload create_artifact(parent: nil, artifact: nil, artifact_id: nil)
2577
+ # Pass arguments to `create_artifact` via keyword arguments. Note that at
2578
+ # least one keyword argument is required. To specify no parameters, or to keep all
2579
+ # the default parameter values, pass an empty Hash as a request object (see above).
2580
+ #
2581
+ # @param parent [::String]
2582
+ # Required. The parent, which owns this collection of artifacts.
2583
+ # Format: `{parent}`
2584
+ # @param artifact [::Google::Cloud::ApigeeRegistry::V1::Artifact, ::Hash]
2585
+ # Required. The artifact to create.
2586
+ # @param artifact_id [::String]
2587
+ # Required. The ID to use for the artifact, which will become the final component of
2588
+ # the artifact's resource name.
2589
+ #
2590
+ # This value should be 4-63 characters, and valid characters
2591
+ # are /[a-z][0-9]-/.
2592
+ #
2593
+ # Following AIP-162, IDs must not have the form of a UUID.
2594
+ # @yield [result, operation] Access the result along with the TransportOperation object
2595
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::Artifact]
2596
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2597
+ #
2598
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Artifact]
2599
+ #
2600
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2601
+ def create_artifact request, options = nil
2602
+ raise ::ArgumentError, "request must be provided" if request.nil?
2603
+
2604
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::CreateArtifactRequest
2605
+
2606
+ # Converts hash and nil to an options object
2607
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2608
+
2609
+ # Customize the options with defaults
2610
+ call_metadata = @config.rpcs.create_artifact.metadata.to_h
2611
+
2612
+ # Set x-goog-api-client and x-goog-user-project headers
2613
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2614
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2615
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2616
+ transports_version_send: [:rest]
2617
+
2618
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2619
+
2620
+ options.apply_defaults timeout: @config.rpcs.create_artifact.timeout,
2621
+ metadata: call_metadata,
2622
+ retry_policy: @config.rpcs.create_artifact.retry_policy
2623
+
2624
+ options.apply_defaults timeout: @config.timeout,
2625
+ metadata: @config.metadata,
2626
+ retry_policy: @config.retry_policy
2627
+
2628
+ @registry_stub.create_artifact request, options do |result, operation|
2629
+ yield result, operation if block_given?
2630
+ return result
2631
+ end
2632
+ rescue ::Gapic::Rest::Error => e
2633
+ raise ::Google::Cloud::Error.from_error(e)
2634
+ end
2635
+
2636
+ ##
2637
+ # Used to replace a specified artifact.
2638
+ #
2639
+ # @overload replace_artifact(request, options = nil)
2640
+ # Pass arguments to `replace_artifact` via a request object, either of type
2641
+ # {::Google::Cloud::ApigeeRegistry::V1::ReplaceArtifactRequest} or an equivalent Hash.
2642
+ #
2643
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::ReplaceArtifactRequest, ::Hash]
2644
+ # A request object representing the call parameters. Required. To specify no
2645
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2646
+ # @param options [::Gapic::CallOptions, ::Hash]
2647
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2648
+ #
2649
+ # @overload replace_artifact(artifact: nil)
2650
+ # Pass arguments to `replace_artifact` via keyword arguments. Note that at
2651
+ # least one keyword argument is required. To specify no parameters, or to keep all
2652
+ # the default parameter values, pass an empty Hash as a request object (see above).
2653
+ #
2654
+ # @param artifact [::Google::Cloud::ApigeeRegistry::V1::Artifact, ::Hash]
2655
+ # Required. The artifact to replace.
2656
+ #
2657
+ # The `name` field is used to identify the artifact to replace.
2658
+ # Format: `{parent}/artifacts/*`
2659
+ # @yield [result, operation] Access the result along with the TransportOperation object
2660
+ # @yieldparam result [::Google::Cloud::ApigeeRegistry::V1::Artifact]
2661
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2662
+ #
2663
+ # @return [::Google::Cloud::ApigeeRegistry::V1::Artifact]
2664
+ #
2665
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2666
+ def replace_artifact request, options = nil
2667
+ raise ::ArgumentError, "request must be provided" if request.nil?
2668
+
2669
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::ReplaceArtifactRequest
2670
+
2671
+ # Converts hash and nil to an options object
2672
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2673
+
2674
+ # Customize the options with defaults
2675
+ call_metadata = @config.rpcs.replace_artifact.metadata.to_h
2676
+
2677
+ # Set x-goog-api-client and x-goog-user-project headers
2678
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2679
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2680
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2681
+ transports_version_send: [:rest]
2682
+
2683
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2684
+
2685
+ options.apply_defaults timeout: @config.rpcs.replace_artifact.timeout,
2686
+ metadata: call_metadata,
2687
+ retry_policy: @config.rpcs.replace_artifact.retry_policy
2688
+
2689
+ options.apply_defaults timeout: @config.timeout,
2690
+ metadata: @config.metadata,
2691
+ retry_policy: @config.retry_policy
2692
+
2693
+ @registry_stub.replace_artifact request, options do |result, operation|
2694
+ yield result, operation if block_given?
2695
+ return result
2696
+ end
2697
+ rescue ::Gapic::Rest::Error => e
2698
+ raise ::Google::Cloud::Error.from_error(e)
2699
+ end
2700
+
2701
+ ##
2702
+ # Removes a specified artifact.
2703
+ #
2704
+ # @overload delete_artifact(request, options = nil)
2705
+ # Pass arguments to `delete_artifact` via a request object, either of type
2706
+ # {::Google::Cloud::ApigeeRegistry::V1::DeleteArtifactRequest} or an equivalent Hash.
2707
+ #
2708
+ # @param request [::Google::Cloud::ApigeeRegistry::V1::DeleteArtifactRequest, ::Hash]
2709
+ # A request object representing the call parameters. Required. To specify no
2710
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2711
+ # @param options [::Gapic::CallOptions, ::Hash]
2712
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2713
+ #
2714
+ # @overload delete_artifact(name: nil)
2715
+ # Pass arguments to `delete_artifact` via keyword arguments. Note that at
2716
+ # least one keyword argument is required. To specify no parameters, or to keep all
2717
+ # the default parameter values, pass an empty Hash as a request object (see above).
2718
+ #
2719
+ # @param name [::String]
2720
+ # Required. The name of the artifact to delete.
2721
+ # Format: `{parent}/artifacts/*`
2722
+ # @yield [result, operation] Access the result along with the TransportOperation object
2723
+ # @yieldparam result [::Google::Protobuf::Empty]
2724
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2725
+ #
2726
+ # @return [::Google::Protobuf::Empty]
2727
+ #
2728
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2729
+ def delete_artifact request, options = nil
2730
+ raise ::ArgumentError, "request must be provided" if request.nil?
2731
+
2732
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApigeeRegistry::V1::DeleteArtifactRequest
2733
+
2734
+ # Converts hash and nil to an options object
2735
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2736
+
2737
+ # Customize the options with defaults
2738
+ call_metadata = @config.rpcs.delete_artifact.metadata.to_h
2739
+
2740
+ # Set x-goog-api-client and x-goog-user-project headers
2741
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2742
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2743
+ gapic_version: ::Google::Cloud::ApigeeRegistry::V1::VERSION,
2744
+ transports_version_send: [:rest]
2745
+
2746
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2747
+
2748
+ options.apply_defaults timeout: @config.rpcs.delete_artifact.timeout,
2749
+ metadata: call_metadata,
2750
+ retry_policy: @config.rpcs.delete_artifact.retry_policy
2751
+
2752
+ options.apply_defaults timeout: @config.timeout,
2753
+ metadata: @config.metadata,
2754
+ retry_policy: @config.retry_policy
2755
+
2756
+ @registry_stub.delete_artifact request, options do |result, operation|
2757
+ yield result, operation if block_given?
2758
+ return result
2759
+ end
2760
+ rescue ::Gapic::Rest::Error => e
2761
+ raise ::Google::Cloud::Error.from_error(e)
2762
+ end
2763
+
2764
+ ##
2765
+ # Configuration class for the Registry REST API.
2766
+ #
2767
+ # This class represents the configuration for Registry REST,
2768
+ # providing control over timeouts, retry behavior, logging, transport
2769
+ # parameters, and other low-level controls. Certain parameters can also be
2770
+ # applied individually to specific RPCs. See
2771
+ # {::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client::Configuration::Rpcs}
2772
+ # for a list of RPCs that can be configured independently.
2773
+ #
2774
+ # Configuration can be applied globally to all clients, or to a single client
2775
+ # on construction.
2776
+ #
2777
+ # @example
2778
+ #
2779
+ # # Modify the global config, setting the timeout for
2780
+ # # list_apis to 20 seconds,
2781
+ # # and all remaining timeouts to 10 seconds.
2782
+ # ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client.configure do |config|
2783
+ # config.timeout = 10.0
2784
+ # config.rpcs.list_apis.timeout = 20.0
2785
+ # end
2786
+ #
2787
+ # # Apply the above configuration only to a new client.
2788
+ # client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client.new do |config|
2789
+ # config.timeout = 10.0
2790
+ # config.rpcs.list_apis.timeout = 20.0
2791
+ # end
2792
+ #
2793
+ # @!attribute [rw] endpoint
2794
+ # The hostname or hostname:port of the service endpoint.
2795
+ # Defaults to `"apigeeregistry.googleapis.com"`.
2796
+ # @return [::String]
2797
+ # @!attribute [rw] credentials
2798
+ # Credentials to send with calls. You may provide any of the following types:
2799
+ # * (`String`) The path to a service account key file in JSON format
2800
+ # * (`Hash`) A service account key as a Hash
2801
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2802
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2803
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2804
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2805
+ # * (`nil`) indicating no credentials
2806
+ # @return [::Object]
2807
+ # @!attribute [rw] scope
2808
+ # The OAuth scopes
2809
+ # @return [::Array<::String>]
2810
+ # @!attribute [rw] lib_name
2811
+ # The library name as recorded in instrumentation and logging
2812
+ # @return [::String]
2813
+ # @!attribute [rw] lib_version
2814
+ # The library version as recorded in instrumentation and logging
2815
+ # @return [::String]
2816
+ # @!attribute [rw] timeout
2817
+ # The call timeout in seconds.
2818
+ # @return [::Numeric]
2819
+ # @!attribute [rw] metadata
2820
+ # Additional headers to be sent with the call.
2821
+ # @return [::Hash{::Symbol=>::String}]
2822
+ # @!attribute [rw] retry_policy
2823
+ # The retry policy. The value is a hash with the following keys:
2824
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2825
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2826
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2827
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2828
+ # trigger a retry.
2829
+ # @return [::Hash]
2830
+ # @!attribute [rw] quota_project
2831
+ # A separate project against which to charge quota.
2832
+ # @return [::String]
2833
+ #
2834
+ class Configuration
2835
+ extend ::Gapic::Config
2836
+
2837
+ config_attr :endpoint, "apigeeregistry.googleapis.com", ::String
2838
+ config_attr :credentials, nil do |value|
2839
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2840
+ allowed.any? { |klass| klass === value }
2841
+ end
2842
+ config_attr :scope, nil, ::String, ::Array, nil
2843
+ config_attr :lib_name, nil, ::String, nil
2844
+ config_attr :lib_version, nil, ::String, nil
2845
+ config_attr :timeout, nil, ::Numeric, nil
2846
+ config_attr :metadata, nil, ::Hash, nil
2847
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2848
+ config_attr :quota_project, nil, ::String, nil
2849
+
2850
+ # @private
2851
+ # Overrides for http bindings for the RPCs of this service
2852
+ # are only used when this service is used as mixin, and only
2853
+ # by the host service.
2854
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2855
+ config_attr :bindings_override, {}, ::Hash, nil
2856
+
2857
+ # @private
2858
+ def initialize parent_config = nil
2859
+ @parent_config = parent_config unless parent_config.nil?
2860
+
2861
+ yield self if block_given?
2862
+ end
2863
+
2864
+ ##
2865
+ # Configurations for individual RPCs
2866
+ # @return [Rpcs]
2867
+ #
2868
+ def rpcs
2869
+ @rpcs ||= begin
2870
+ parent_rpcs = nil
2871
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2872
+ Rpcs.new parent_rpcs
2873
+ end
2874
+ end
2875
+
2876
+ ##
2877
+ # Configuration RPC class for the Registry API.
2878
+ #
2879
+ # Includes fields providing the configuration for each RPC in this service.
2880
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2881
+ # the following configuration fields:
2882
+ #
2883
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2884
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2885
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2886
+ # include the following keys:
2887
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2888
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2889
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2890
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2891
+ # trigger a retry.
2892
+ #
2893
+ class Rpcs
2894
+ ##
2895
+ # RPC-specific configuration for `list_apis`
2896
+ # @return [::Gapic::Config::Method]
2897
+ #
2898
+ attr_reader :list_apis
2899
+ ##
2900
+ # RPC-specific configuration for `get_api`
2901
+ # @return [::Gapic::Config::Method]
2902
+ #
2903
+ attr_reader :get_api
2904
+ ##
2905
+ # RPC-specific configuration for `create_api`
2906
+ # @return [::Gapic::Config::Method]
2907
+ #
2908
+ attr_reader :create_api
2909
+ ##
2910
+ # RPC-specific configuration for `update_api`
2911
+ # @return [::Gapic::Config::Method]
2912
+ #
2913
+ attr_reader :update_api
2914
+ ##
2915
+ # RPC-specific configuration for `delete_api`
2916
+ # @return [::Gapic::Config::Method]
2917
+ #
2918
+ attr_reader :delete_api
2919
+ ##
2920
+ # RPC-specific configuration for `list_api_versions`
2921
+ # @return [::Gapic::Config::Method]
2922
+ #
2923
+ attr_reader :list_api_versions
2924
+ ##
2925
+ # RPC-specific configuration for `get_api_version`
2926
+ # @return [::Gapic::Config::Method]
2927
+ #
2928
+ attr_reader :get_api_version
2929
+ ##
2930
+ # RPC-specific configuration for `create_api_version`
2931
+ # @return [::Gapic::Config::Method]
2932
+ #
2933
+ attr_reader :create_api_version
2934
+ ##
2935
+ # RPC-specific configuration for `update_api_version`
2936
+ # @return [::Gapic::Config::Method]
2937
+ #
2938
+ attr_reader :update_api_version
2939
+ ##
2940
+ # RPC-specific configuration for `delete_api_version`
2941
+ # @return [::Gapic::Config::Method]
2942
+ #
2943
+ attr_reader :delete_api_version
2944
+ ##
2945
+ # RPC-specific configuration for `list_api_specs`
2946
+ # @return [::Gapic::Config::Method]
2947
+ #
2948
+ attr_reader :list_api_specs
2949
+ ##
2950
+ # RPC-specific configuration for `get_api_spec`
2951
+ # @return [::Gapic::Config::Method]
2952
+ #
2953
+ attr_reader :get_api_spec
2954
+ ##
2955
+ # RPC-specific configuration for `get_api_spec_contents`
2956
+ # @return [::Gapic::Config::Method]
2957
+ #
2958
+ attr_reader :get_api_spec_contents
2959
+ ##
2960
+ # RPC-specific configuration for `create_api_spec`
2961
+ # @return [::Gapic::Config::Method]
2962
+ #
2963
+ attr_reader :create_api_spec
2964
+ ##
2965
+ # RPC-specific configuration for `update_api_spec`
2966
+ # @return [::Gapic::Config::Method]
2967
+ #
2968
+ attr_reader :update_api_spec
2969
+ ##
2970
+ # RPC-specific configuration for `delete_api_spec`
2971
+ # @return [::Gapic::Config::Method]
2972
+ #
2973
+ attr_reader :delete_api_spec
2974
+ ##
2975
+ # RPC-specific configuration for `tag_api_spec_revision`
2976
+ # @return [::Gapic::Config::Method]
2977
+ #
2978
+ attr_reader :tag_api_spec_revision
2979
+ ##
2980
+ # RPC-specific configuration for `list_api_spec_revisions`
2981
+ # @return [::Gapic::Config::Method]
2982
+ #
2983
+ attr_reader :list_api_spec_revisions
2984
+ ##
2985
+ # RPC-specific configuration for `rollback_api_spec`
2986
+ # @return [::Gapic::Config::Method]
2987
+ #
2988
+ attr_reader :rollback_api_spec
2989
+ ##
2990
+ # RPC-specific configuration for `delete_api_spec_revision`
2991
+ # @return [::Gapic::Config::Method]
2992
+ #
2993
+ attr_reader :delete_api_spec_revision
2994
+ ##
2995
+ # RPC-specific configuration for `list_api_deployments`
2996
+ # @return [::Gapic::Config::Method]
2997
+ #
2998
+ attr_reader :list_api_deployments
2999
+ ##
3000
+ # RPC-specific configuration for `get_api_deployment`
3001
+ # @return [::Gapic::Config::Method]
3002
+ #
3003
+ attr_reader :get_api_deployment
3004
+ ##
3005
+ # RPC-specific configuration for `create_api_deployment`
3006
+ # @return [::Gapic::Config::Method]
3007
+ #
3008
+ attr_reader :create_api_deployment
3009
+ ##
3010
+ # RPC-specific configuration for `update_api_deployment`
3011
+ # @return [::Gapic::Config::Method]
3012
+ #
3013
+ attr_reader :update_api_deployment
3014
+ ##
3015
+ # RPC-specific configuration for `delete_api_deployment`
3016
+ # @return [::Gapic::Config::Method]
3017
+ #
3018
+ attr_reader :delete_api_deployment
3019
+ ##
3020
+ # RPC-specific configuration for `tag_api_deployment_revision`
3021
+ # @return [::Gapic::Config::Method]
3022
+ #
3023
+ attr_reader :tag_api_deployment_revision
3024
+ ##
3025
+ # RPC-specific configuration for `list_api_deployment_revisions`
3026
+ # @return [::Gapic::Config::Method]
3027
+ #
3028
+ attr_reader :list_api_deployment_revisions
3029
+ ##
3030
+ # RPC-specific configuration for `rollback_api_deployment`
3031
+ # @return [::Gapic::Config::Method]
3032
+ #
3033
+ attr_reader :rollback_api_deployment
3034
+ ##
3035
+ # RPC-specific configuration for `delete_api_deployment_revision`
3036
+ # @return [::Gapic::Config::Method]
3037
+ #
3038
+ attr_reader :delete_api_deployment_revision
3039
+ ##
3040
+ # RPC-specific configuration for `list_artifacts`
3041
+ # @return [::Gapic::Config::Method]
3042
+ #
3043
+ attr_reader :list_artifacts
3044
+ ##
3045
+ # RPC-specific configuration for `get_artifact`
3046
+ # @return [::Gapic::Config::Method]
3047
+ #
3048
+ attr_reader :get_artifact
3049
+ ##
3050
+ # RPC-specific configuration for `get_artifact_contents`
3051
+ # @return [::Gapic::Config::Method]
3052
+ #
3053
+ attr_reader :get_artifact_contents
3054
+ ##
3055
+ # RPC-specific configuration for `create_artifact`
3056
+ # @return [::Gapic::Config::Method]
3057
+ #
3058
+ attr_reader :create_artifact
3059
+ ##
3060
+ # RPC-specific configuration for `replace_artifact`
3061
+ # @return [::Gapic::Config::Method]
3062
+ #
3063
+ attr_reader :replace_artifact
3064
+ ##
3065
+ # RPC-specific configuration for `delete_artifact`
3066
+ # @return [::Gapic::Config::Method]
3067
+ #
3068
+ attr_reader :delete_artifact
3069
+
3070
+ # @private
3071
+ def initialize parent_rpcs = nil
3072
+ list_apis_config = parent_rpcs.list_apis if parent_rpcs.respond_to? :list_apis
3073
+ @list_apis = ::Gapic::Config::Method.new list_apis_config
3074
+ get_api_config = parent_rpcs.get_api if parent_rpcs.respond_to? :get_api
3075
+ @get_api = ::Gapic::Config::Method.new get_api_config
3076
+ create_api_config = parent_rpcs.create_api if parent_rpcs.respond_to? :create_api
3077
+ @create_api = ::Gapic::Config::Method.new create_api_config
3078
+ update_api_config = parent_rpcs.update_api if parent_rpcs.respond_to? :update_api
3079
+ @update_api = ::Gapic::Config::Method.new update_api_config
3080
+ delete_api_config = parent_rpcs.delete_api if parent_rpcs.respond_to? :delete_api
3081
+ @delete_api = ::Gapic::Config::Method.new delete_api_config
3082
+ list_api_versions_config = parent_rpcs.list_api_versions if parent_rpcs.respond_to? :list_api_versions
3083
+ @list_api_versions = ::Gapic::Config::Method.new list_api_versions_config
3084
+ get_api_version_config = parent_rpcs.get_api_version if parent_rpcs.respond_to? :get_api_version
3085
+ @get_api_version = ::Gapic::Config::Method.new get_api_version_config
3086
+ create_api_version_config = parent_rpcs.create_api_version if parent_rpcs.respond_to? :create_api_version
3087
+ @create_api_version = ::Gapic::Config::Method.new create_api_version_config
3088
+ update_api_version_config = parent_rpcs.update_api_version if parent_rpcs.respond_to? :update_api_version
3089
+ @update_api_version = ::Gapic::Config::Method.new update_api_version_config
3090
+ delete_api_version_config = parent_rpcs.delete_api_version if parent_rpcs.respond_to? :delete_api_version
3091
+ @delete_api_version = ::Gapic::Config::Method.new delete_api_version_config
3092
+ list_api_specs_config = parent_rpcs.list_api_specs if parent_rpcs.respond_to? :list_api_specs
3093
+ @list_api_specs = ::Gapic::Config::Method.new list_api_specs_config
3094
+ get_api_spec_config = parent_rpcs.get_api_spec if parent_rpcs.respond_to? :get_api_spec
3095
+ @get_api_spec = ::Gapic::Config::Method.new get_api_spec_config
3096
+ get_api_spec_contents_config = parent_rpcs.get_api_spec_contents if parent_rpcs.respond_to? :get_api_spec_contents
3097
+ @get_api_spec_contents = ::Gapic::Config::Method.new get_api_spec_contents_config
3098
+ create_api_spec_config = parent_rpcs.create_api_spec if parent_rpcs.respond_to? :create_api_spec
3099
+ @create_api_spec = ::Gapic::Config::Method.new create_api_spec_config
3100
+ update_api_spec_config = parent_rpcs.update_api_spec if parent_rpcs.respond_to? :update_api_spec
3101
+ @update_api_spec = ::Gapic::Config::Method.new update_api_spec_config
3102
+ delete_api_spec_config = parent_rpcs.delete_api_spec if parent_rpcs.respond_to? :delete_api_spec
3103
+ @delete_api_spec = ::Gapic::Config::Method.new delete_api_spec_config
3104
+ tag_api_spec_revision_config = parent_rpcs.tag_api_spec_revision if parent_rpcs.respond_to? :tag_api_spec_revision
3105
+ @tag_api_spec_revision = ::Gapic::Config::Method.new tag_api_spec_revision_config
3106
+ list_api_spec_revisions_config = parent_rpcs.list_api_spec_revisions if parent_rpcs.respond_to? :list_api_spec_revisions
3107
+ @list_api_spec_revisions = ::Gapic::Config::Method.new list_api_spec_revisions_config
3108
+ rollback_api_spec_config = parent_rpcs.rollback_api_spec if parent_rpcs.respond_to? :rollback_api_spec
3109
+ @rollback_api_spec = ::Gapic::Config::Method.new rollback_api_spec_config
3110
+ delete_api_spec_revision_config = parent_rpcs.delete_api_spec_revision if parent_rpcs.respond_to? :delete_api_spec_revision
3111
+ @delete_api_spec_revision = ::Gapic::Config::Method.new delete_api_spec_revision_config
3112
+ list_api_deployments_config = parent_rpcs.list_api_deployments if parent_rpcs.respond_to? :list_api_deployments
3113
+ @list_api_deployments = ::Gapic::Config::Method.new list_api_deployments_config
3114
+ get_api_deployment_config = parent_rpcs.get_api_deployment if parent_rpcs.respond_to? :get_api_deployment
3115
+ @get_api_deployment = ::Gapic::Config::Method.new get_api_deployment_config
3116
+ create_api_deployment_config = parent_rpcs.create_api_deployment if parent_rpcs.respond_to? :create_api_deployment
3117
+ @create_api_deployment = ::Gapic::Config::Method.new create_api_deployment_config
3118
+ update_api_deployment_config = parent_rpcs.update_api_deployment if parent_rpcs.respond_to? :update_api_deployment
3119
+ @update_api_deployment = ::Gapic::Config::Method.new update_api_deployment_config
3120
+ delete_api_deployment_config = parent_rpcs.delete_api_deployment if parent_rpcs.respond_to? :delete_api_deployment
3121
+ @delete_api_deployment = ::Gapic::Config::Method.new delete_api_deployment_config
3122
+ tag_api_deployment_revision_config = parent_rpcs.tag_api_deployment_revision if parent_rpcs.respond_to? :tag_api_deployment_revision
3123
+ @tag_api_deployment_revision = ::Gapic::Config::Method.new tag_api_deployment_revision_config
3124
+ list_api_deployment_revisions_config = parent_rpcs.list_api_deployment_revisions if parent_rpcs.respond_to? :list_api_deployment_revisions
3125
+ @list_api_deployment_revisions = ::Gapic::Config::Method.new list_api_deployment_revisions_config
3126
+ rollback_api_deployment_config = parent_rpcs.rollback_api_deployment if parent_rpcs.respond_to? :rollback_api_deployment
3127
+ @rollback_api_deployment = ::Gapic::Config::Method.new rollback_api_deployment_config
3128
+ delete_api_deployment_revision_config = parent_rpcs.delete_api_deployment_revision if parent_rpcs.respond_to? :delete_api_deployment_revision
3129
+ @delete_api_deployment_revision = ::Gapic::Config::Method.new delete_api_deployment_revision_config
3130
+ list_artifacts_config = parent_rpcs.list_artifacts if parent_rpcs.respond_to? :list_artifacts
3131
+ @list_artifacts = ::Gapic::Config::Method.new list_artifacts_config
3132
+ get_artifact_config = parent_rpcs.get_artifact if parent_rpcs.respond_to? :get_artifact
3133
+ @get_artifact = ::Gapic::Config::Method.new get_artifact_config
3134
+ get_artifact_contents_config = parent_rpcs.get_artifact_contents if parent_rpcs.respond_to? :get_artifact_contents
3135
+ @get_artifact_contents = ::Gapic::Config::Method.new get_artifact_contents_config
3136
+ create_artifact_config = parent_rpcs.create_artifact if parent_rpcs.respond_to? :create_artifact
3137
+ @create_artifact = ::Gapic::Config::Method.new create_artifact_config
3138
+ replace_artifact_config = parent_rpcs.replace_artifact if parent_rpcs.respond_to? :replace_artifact
3139
+ @replace_artifact = ::Gapic::Config::Method.new replace_artifact_config
3140
+ delete_artifact_config = parent_rpcs.delete_artifact if parent_rpcs.respond_to? :delete_artifact
3141
+ @delete_artifact = ::Gapic::Config::Method.new delete_artifact_config
3142
+
3143
+ yield self if block_given?
3144
+ end
3145
+ end
3146
+ end
3147
+ end
3148
+ end
3149
+ end
3150
+ end
3151
+ end
3152
+ end
3153
+ end