google-cloud-artifact_registry-v1beta2 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +2 -2
  4. data/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb +58 -54
  5. data/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/operations.rb +12 -14
  6. data/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/client.rb +2252 -0
  7. data/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/operations.rb +793 -0
  8. data/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/service_stub.rb +1532 -0
  9. data/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest.rb +66 -0
  10. data/lib/google/cloud/artifact_registry/v1beta2/artifact_registry.rb +7 -1
  11. data/lib/google/cloud/artifact_registry/v1beta2/bindings_override.rb +102 -0
  12. data/lib/google/cloud/artifact_registry/v1beta2/rest.rb +38 -0
  13. data/lib/google/cloud/artifact_registry/v1beta2/version.rb +1 -1
  14. data/lib/google/cloud/artifact_registry/v1beta2.rb +7 -2
  15. data/lib/google/devtools/artifactregistry/v1beta2/apt_artifact_pb.rb +0 -2
  16. data/lib/google/devtools/artifactregistry/v1beta2/file_pb.rb +0 -1
  17. data/lib/google/devtools/artifactregistry/v1beta2/package_pb.rb +0 -1
  18. data/lib/google/devtools/artifactregistry/v1beta2/repository_pb.rb +0 -1
  19. data/lib/google/devtools/artifactregistry/v1beta2/settings_pb.rb +0 -1
  20. data/lib/google/devtools/artifactregistry/v1beta2/tag_pb.rb +0 -1
  21. data/lib/google/devtools/artifactregistry/v1beta2/version_pb.rb +0 -1
  22. data/lib/google/devtools/artifactregistry/v1beta2/yum_artifact_pb.rb +0 -2
  23. data/proto_docs/google/api/client.rb +318 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/protobuf/empty.rb +0 -2
  26. data/proto_docs/google/rpc/status.rb +4 -2
  27. metadata +37 -8
@@ -0,0 +1,2252 @@
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/devtools/artifactregistry/v1beta2/service_pb"
21
+ require "google/cloud/artifact_registry/v1beta2/artifact_registry/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module ArtifactRegistry
27
+ module V1beta2
28
+ module ArtifactRegistry
29
+ module Rest
30
+ ##
31
+ # REST client for the ArtifactRegistry service.
32
+ #
33
+ # The Artifact Registry API service.
34
+ #
35
+ # Artifact Registry is an artifact management system for storing artifacts
36
+ # from different package management systems.
37
+ #
38
+ # The resources managed by this API are:
39
+ #
40
+ # * Repositories, which group packages and their data.
41
+ # * Packages, which group versions and their tags.
42
+ # * Versions, which are specific forms of a package.
43
+ # * Tags, which represent alternative names for versions.
44
+ # * Files, which contain content and are optionally associated with a Package
45
+ # or Version.
46
+ #
47
+ class Client
48
+ include Paths
49
+
50
+ # @private
51
+ attr_reader :artifact_registry_stub
52
+
53
+ ##
54
+ # Configure the ArtifactRegistry Client class.
55
+ #
56
+ # See {::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client::Configuration}
57
+ # for a description of the configuration fields.
58
+ #
59
+ # @example
60
+ #
61
+ # # Modify the configuration for all ArtifactRegistry clients
62
+ # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client.configure do |config|
63
+ # config.timeout = 10.0
64
+ # end
65
+ #
66
+ # @yield [config] Configure the Client client.
67
+ # @yieldparam config [Client::Configuration]
68
+ #
69
+ # @return [Client::Configuration]
70
+ #
71
+ def self.configure
72
+ @configure ||= begin
73
+ namespace = ["Google", "Cloud", "ArtifactRegistry", "V1beta2"]
74
+ parent_config = while namespace.any?
75
+ parent_name = namespace.join "::"
76
+ parent_const = const_get parent_name
77
+ break parent_const.configure if parent_const.respond_to? :configure
78
+ namespace.pop
79
+ end
80
+ default_config = Client::Configuration.new parent_config
81
+
82
+ default_config.rpcs.list_repositories.timeout = 30.0
83
+ default_config.rpcs.list_repositories.retry_policy = {
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
85
+ }
86
+
87
+ default_config.rpcs.get_repository.timeout = 30.0
88
+ default_config.rpcs.get_repository.retry_policy = {
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
90
+ }
91
+
92
+ default_config.rpcs.create_repository.timeout = 30.0
93
+
94
+ default_config.rpcs.update_repository.timeout = 30.0
95
+
96
+ default_config.rpcs.delete_repository.timeout = 30.0
97
+ default_config.rpcs.delete_repository.retry_policy = {
98
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
99
+ }
100
+
101
+ default_config.rpcs.list_packages.timeout = 30.0
102
+ default_config.rpcs.list_packages.retry_policy = {
103
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
104
+ }
105
+
106
+ default_config.rpcs.get_package.timeout = 30.0
107
+ default_config.rpcs.get_package.retry_policy = {
108
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
109
+ }
110
+
111
+ default_config.rpcs.delete_package.timeout = 30.0
112
+ default_config.rpcs.delete_package.retry_policy = {
113
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
114
+ }
115
+
116
+ default_config.rpcs.list_versions.timeout = 30.0
117
+ default_config.rpcs.list_versions.retry_policy = {
118
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
119
+ }
120
+
121
+ default_config.rpcs.get_version.timeout = 30.0
122
+ default_config.rpcs.get_version.retry_policy = {
123
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
124
+ }
125
+
126
+ default_config.rpcs.delete_version.timeout = 30.0
127
+ default_config.rpcs.delete_version.retry_policy = {
128
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
129
+ }
130
+
131
+ default_config.rpcs.list_files.timeout = 30.0
132
+ default_config.rpcs.list_files.retry_policy = {
133
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
134
+ }
135
+
136
+ default_config.rpcs.get_file.timeout = 30.0
137
+ default_config.rpcs.get_file.retry_policy = {
138
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
139
+ }
140
+
141
+ default_config.rpcs.list_tags.timeout = 30.0
142
+ default_config.rpcs.list_tags.retry_policy = {
143
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
144
+ }
145
+
146
+ default_config.rpcs.get_tag.timeout = 30.0
147
+ default_config.rpcs.get_tag.retry_policy = {
148
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
149
+ }
150
+
151
+ default_config.rpcs.create_tag.timeout = 30.0
152
+
153
+ default_config.rpcs.update_tag.timeout = 30.0
154
+
155
+ default_config.rpcs.delete_tag.timeout = 30.0
156
+ default_config.rpcs.delete_tag.retry_policy = {
157
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
158
+ }
159
+
160
+ default_config.rpcs.get_iam_policy.timeout = 30.0
161
+ default_config.rpcs.get_iam_policy.retry_policy = {
162
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
163
+ }
164
+
165
+ default_config.rpcs.test_iam_permissions.timeout = 30.0
166
+
167
+ default_config
168
+ end
169
+ yield @configure if block_given?
170
+ @configure
171
+ end
172
+
173
+ ##
174
+ # Configure the ArtifactRegistry Client instance.
175
+ #
176
+ # The configuration is set to the derived mode, meaning that values can be changed,
177
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
178
+ # should be made on {Client.configure}.
179
+ #
180
+ # See {::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client::Configuration}
181
+ # for a description of the configuration fields.
182
+ #
183
+ # @yield [config] Configure the Client client.
184
+ # @yieldparam config [Client::Configuration]
185
+ #
186
+ # @return [Client::Configuration]
187
+ #
188
+ def configure
189
+ yield @config if block_given?
190
+ @config
191
+ end
192
+
193
+ ##
194
+ # Create a new ArtifactRegistry REST client object.
195
+ #
196
+ # @example
197
+ #
198
+ # # Create a client using the default configuration
199
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client.new
200
+ #
201
+ # # Create a client using a custom configuration
202
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client.new do |config|
203
+ # config.timeout = 10.0
204
+ # end
205
+ #
206
+ # @yield [config] Configure the ArtifactRegistry client.
207
+ # @yieldparam config [Client::Configuration]
208
+ #
209
+ def initialize
210
+ # Create the configuration object
211
+ @config = Configuration.new Client.configure
212
+
213
+ # Yield the configuration if needed
214
+ yield @config if block_given?
215
+
216
+ # Create credentials
217
+ credentials = @config.credentials
218
+ # Use self-signed JWT if the endpoint is unchanged from default,
219
+ # but only if the default endpoint does not have a region prefix.
220
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
221
+ !@config.endpoint.split(".").first.include?("-")
222
+ credentials ||= Credentials.default scope: @config.scope,
223
+ enable_self_signed_jwt: enable_self_signed_jwt
224
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
225
+ credentials = Credentials.new credentials, scope: @config.scope
226
+ end
227
+
228
+ @quota_project_id = @config.quota_project
229
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
230
+
231
+ @operations_client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Operations.new do |config|
232
+ config.credentials = credentials
233
+ config.quota_project = @quota_project_id
234
+ config.endpoint = @config.endpoint
235
+ end
236
+
237
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
238
+ config.credentials = credentials
239
+ config.quota_project = @quota_project_id
240
+ config.endpoint = @config.endpoint
241
+ config.bindings_override = @config.bindings_override
242
+ end
243
+
244
+ @artifact_registry_stub = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
245
+ end
246
+
247
+ ##
248
+ # Get the associated client for long-running operations.
249
+ #
250
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Operations]
251
+ #
252
+ attr_reader :operations_client
253
+
254
+ ##
255
+ # Get the associated client for mix-in of the Locations.
256
+ #
257
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
258
+ #
259
+ attr_reader :location_client
260
+
261
+ # Service calls
262
+
263
+ ##
264
+ # Imports Apt artifacts. The returned Operation will complete once the
265
+ # resources are imported. Package, Version, and File resources are created
266
+ # based on the imported artifacts. Imported artifacts that conflict with
267
+ # existing resources are ignored.
268
+ #
269
+ # @overload import_apt_artifacts(request, options = nil)
270
+ # Pass arguments to `import_apt_artifacts` via a request object, either of type
271
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ImportAptArtifactsRequest} or an equivalent Hash.
272
+ #
273
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::ImportAptArtifactsRequest, ::Hash]
274
+ # A request object representing the call parameters. Required. To specify no
275
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
276
+ # @param options [::Gapic::CallOptions, ::Hash]
277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
278
+ #
279
+ # @overload import_apt_artifacts(gcs_source: nil, parent: nil)
280
+ # Pass arguments to `import_apt_artifacts` via keyword arguments. Note that at
281
+ # least one keyword argument is required. To specify no parameters, or to keep all
282
+ # the default parameter values, pass an empty Hash as a request object (see above).
283
+ #
284
+ # @param gcs_source [::Google::Cloud::ArtifactRegistry::V1beta2::ImportAptArtifactsGcsSource, ::Hash]
285
+ # Google Cloud Storage location where input content is located.
286
+ # @param parent [::String]
287
+ # The name of the parent resource where the artifacts will be imported.
288
+ # @yield [result, operation] Access the result along with the TransportOperation object
289
+ # @yieldparam result [::Gapic::Operation]
290
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
291
+ #
292
+ # @return [::Gapic::Operation]
293
+ #
294
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
295
+ def import_apt_artifacts request, options = nil
296
+ raise ::ArgumentError, "request must be provided" if request.nil?
297
+
298
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::ImportAptArtifactsRequest
299
+
300
+ # Converts hash and nil to an options object
301
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
302
+
303
+ # Customize the options with defaults
304
+ call_metadata = @config.rpcs.import_apt_artifacts.metadata.to_h
305
+
306
+ # Set x-goog-api-client and x-goog-user-project headers
307
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
308
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
309
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
310
+ transports_version_send: [:rest]
311
+
312
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
313
+
314
+ options.apply_defaults timeout: @config.rpcs.import_apt_artifacts.timeout,
315
+ metadata: call_metadata,
316
+ retry_policy: @config.rpcs.import_apt_artifacts.retry_policy
317
+
318
+ options.apply_defaults timeout: @config.timeout,
319
+ metadata: @config.metadata,
320
+ retry_policy: @config.retry_policy
321
+
322
+ @artifact_registry_stub.import_apt_artifacts request, options do |result, operation|
323
+ result = ::Gapic::Operation.new result, @operations_client, options: options
324
+ yield result, operation if block_given?
325
+ return result
326
+ end
327
+ rescue ::Gapic::Rest::Error => e
328
+ raise ::Google::Cloud::Error.from_error(e)
329
+ end
330
+
331
+ ##
332
+ # Imports Yum (RPM) artifacts. The returned Operation will complete once the
333
+ # resources are imported. Package, Version, and File resources are created
334
+ # based on the imported artifacts. Imported artifacts that conflict with
335
+ # existing resources are ignored.
336
+ #
337
+ # @overload import_yum_artifacts(request, options = nil)
338
+ # Pass arguments to `import_yum_artifacts` via a request object, either of type
339
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ImportYumArtifactsRequest} or an equivalent Hash.
340
+ #
341
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::ImportYumArtifactsRequest, ::Hash]
342
+ # A request object representing the call parameters. Required. To specify no
343
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
344
+ # @param options [::Gapic::CallOptions, ::Hash]
345
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
346
+ #
347
+ # @overload import_yum_artifacts(gcs_source: nil, parent: nil)
348
+ # Pass arguments to `import_yum_artifacts` via keyword arguments. Note that at
349
+ # least one keyword argument is required. To specify no parameters, or to keep all
350
+ # the default parameter values, pass an empty Hash as a request object (see above).
351
+ #
352
+ # @param gcs_source [::Google::Cloud::ArtifactRegistry::V1beta2::ImportYumArtifactsGcsSource, ::Hash]
353
+ # Google Cloud Storage location where input content is located.
354
+ # @param parent [::String]
355
+ # The name of the parent resource where the artifacts will be imported.
356
+ # @yield [result, operation] Access the result along with the TransportOperation object
357
+ # @yieldparam result [::Gapic::Operation]
358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
359
+ #
360
+ # @return [::Gapic::Operation]
361
+ #
362
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
363
+ def import_yum_artifacts request, options = nil
364
+ raise ::ArgumentError, "request must be provided" if request.nil?
365
+
366
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::ImportYumArtifactsRequest
367
+
368
+ # Converts hash and nil to an options object
369
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
370
+
371
+ # Customize the options with defaults
372
+ call_metadata = @config.rpcs.import_yum_artifacts.metadata.to_h
373
+
374
+ # Set x-goog-api-client and x-goog-user-project headers
375
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
376
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
377
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
378
+ transports_version_send: [:rest]
379
+
380
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
381
+
382
+ options.apply_defaults timeout: @config.rpcs.import_yum_artifacts.timeout,
383
+ metadata: call_metadata,
384
+ retry_policy: @config.rpcs.import_yum_artifacts.retry_policy
385
+
386
+ options.apply_defaults timeout: @config.timeout,
387
+ metadata: @config.metadata,
388
+ retry_policy: @config.retry_policy
389
+
390
+ @artifact_registry_stub.import_yum_artifacts request, options do |result, operation|
391
+ result = ::Gapic::Operation.new result, @operations_client, options: options
392
+ yield result, operation if block_given?
393
+ return result
394
+ end
395
+ rescue ::Gapic::Rest::Error => e
396
+ raise ::Google::Cloud::Error.from_error(e)
397
+ end
398
+
399
+ ##
400
+ # Lists repositories.
401
+ #
402
+ # @overload list_repositories(request, options = nil)
403
+ # Pass arguments to `list_repositories` via a request object, either of type
404
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ListRepositoriesRequest} or an equivalent Hash.
405
+ #
406
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::ListRepositoriesRequest, ::Hash]
407
+ # A request object representing the call parameters. Required. To specify no
408
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
409
+ # @param options [::Gapic::CallOptions, ::Hash]
410
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
411
+ #
412
+ # @overload list_repositories(parent: nil, page_size: nil, page_token: nil)
413
+ # Pass arguments to `list_repositories` via keyword arguments. Note that at
414
+ # least one keyword argument is required. To specify no parameters, or to keep all
415
+ # the default parameter values, pass an empty Hash as a request object (see above).
416
+ #
417
+ # @param parent [::String]
418
+ # Required. The name of the parent resource whose repositories will be listed.
419
+ # @param page_size [::Integer]
420
+ # The maximum number of repositories to return. Maximum page size is 1,000.
421
+ # @param page_token [::String]
422
+ # The next_page_token value returned from a previous list request, if any.
423
+ # @yield [result, operation] Access the result along with the TransportOperation object
424
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Repository>]
425
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
426
+ #
427
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Repository>]
428
+ #
429
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
430
+ def list_repositories request, options = nil
431
+ raise ::ArgumentError, "request must be provided" if request.nil?
432
+
433
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::ListRepositoriesRequest
434
+
435
+ # Converts hash and nil to an options object
436
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
437
+
438
+ # Customize the options with defaults
439
+ call_metadata = @config.rpcs.list_repositories.metadata.to_h
440
+
441
+ # Set x-goog-api-client and x-goog-user-project headers
442
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
443
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
444
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
445
+ transports_version_send: [:rest]
446
+
447
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
448
+
449
+ options.apply_defaults timeout: @config.rpcs.list_repositories.timeout,
450
+ metadata: call_metadata,
451
+ retry_policy: @config.rpcs.list_repositories.retry_policy
452
+
453
+ options.apply_defaults timeout: @config.timeout,
454
+ metadata: @config.metadata,
455
+ retry_policy: @config.retry_policy
456
+
457
+ @artifact_registry_stub.list_repositories request, options do |result, operation|
458
+ result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_repositories, "repositories", request, result, options
459
+ yield result, operation if block_given?
460
+ return result
461
+ end
462
+ rescue ::Gapic::Rest::Error => e
463
+ raise ::Google::Cloud::Error.from_error(e)
464
+ end
465
+
466
+ ##
467
+ # Gets a repository.
468
+ #
469
+ # @overload get_repository(request, options = nil)
470
+ # Pass arguments to `get_repository` via a request object, either of type
471
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::GetRepositoryRequest} or an equivalent Hash.
472
+ #
473
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::GetRepositoryRequest, ::Hash]
474
+ # A request object representing the call parameters. Required. To specify no
475
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
476
+ # @param options [::Gapic::CallOptions, ::Hash]
477
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
478
+ #
479
+ # @overload get_repository(name: nil)
480
+ # Pass arguments to `get_repository` via keyword arguments. Note that at
481
+ # least one keyword argument is required. To specify no parameters, or to keep all
482
+ # the default parameter values, pass an empty Hash as a request object (see above).
483
+ #
484
+ # @param name [::String]
485
+ # Required. The name of the repository to retrieve.
486
+ # @yield [result, operation] Access the result along with the TransportOperation object
487
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::Repository]
488
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
489
+ #
490
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::Repository]
491
+ #
492
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
493
+ def get_repository request, options = nil
494
+ raise ::ArgumentError, "request must be provided" if request.nil?
495
+
496
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::GetRepositoryRequest
497
+
498
+ # Converts hash and nil to an options object
499
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
500
+
501
+ # Customize the options with defaults
502
+ call_metadata = @config.rpcs.get_repository.metadata.to_h
503
+
504
+ # Set x-goog-api-client and x-goog-user-project headers
505
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
506
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
507
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
508
+ transports_version_send: [:rest]
509
+
510
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
511
+
512
+ options.apply_defaults timeout: @config.rpcs.get_repository.timeout,
513
+ metadata: call_metadata,
514
+ retry_policy: @config.rpcs.get_repository.retry_policy
515
+
516
+ options.apply_defaults timeout: @config.timeout,
517
+ metadata: @config.metadata,
518
+ retry_policy: @config.retry_policy
519
+
520
+ @artifact_registry_stub.get_repository request, options do |result, operation|
521
+ yield result, operation if block_given?
522
+ return result
523
+ end
524
+ rescue ::Gapic::Rest::Error => e
525
+ raise ::Google::Cloud::Error.from_error(e)
526
+ end
527
+
528
+ ##
529
+ # Creates a repository. The returned Operation will finish once the
530
+ # repository has been created. Its response will be the created Repository.
531
+ #
532
+ # @overload create_repository(request, options = nil)
533
+ # Pass arguments to `create_repository` via a request object, either of type
534
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::CreateRepositoryRequest} or an equivalent Hash.
535
+ #
536
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::CreateRepositoryRequest, ::Hash]
537
+ # A request object representing the call parameters. Required. To specify no
538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
539
+ # @param options [::Gapic::CallOptions, ::Hash]
540
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
541
+ #
542
+ # @overload create_repository(parent: nil, repository_id: nil, repository: nil)
543
+ # Pass arguments to `create_repository` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param parent [::String]
548
+ # Required. The name of the parent resource where the repository will be created.
549
+ # @param repository_id [::String]
550
+ # The repository id to use for this repository.
551
+ # @param repository [::Google::Cloud::ArtifactRegistry::V1beta2::Repository, ::Hash]
552
+ # The repository to be created.
553
+ # @yield [result, operation] Access the result along with the TransportOperation object
554
+ # @yieldparam result [::Gapic::Operation]
555
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
556
+ #
557
+ # @return [::Gapic::Operation]
558
+ #
559
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
560
+ def create_repository request, options = nil
561
+ raise ::ArgumentError, "request must be provided" if request.nil?
562
+
563
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::CreateRepositoryRequest
564
+
565
+ # Converts hash and nil to an options object
566
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
567
+
568
+ # Customize the options with defaults
569
+ call_metadata = @config.rpcs.create_repository.metadata.to_h
570
+
571
+ # Set x-goog-api-client and x-goog-user-project headers
572
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
573
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
574
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
575
+ transports_version_send: [:rest]
576
+
577
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
578
+
579
+ options.apply_defaults timeout: @config.rpcs.create_repository.timeout,
580
+ metadata: call_metadata,
581
+ retry_policy: @config.rpcs.create_repository.retry_policy
582
+
583
+ options.apply_defaults timeout: @config.timeout,
584
+ metadata: @config.metadata,
585
+ retry_policy: @config.retry_policy
586
+
587
+ @artifact_registry_stub.create_repository request, options do |result, operation|
588
+ result = ::Gapic::Operation.new result, @operations_client, options: options
589
+ yield result, operation if block_given?
590
+ return result
591
+ end
592
+ rescue ::Gapic::Rest::Error => e
593
+ raise ::Google::Cloud::Error.from_error(e)
594
+ end
595
+
596
+ ##
597
+ # Updates a repository.
598
+ #
599
+ # @overload update_repository(request, options = nil)
600
+ # Pass arguments to `update_repository` via a request object, either of type
601
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::UpdateRepositoryRequest} or an equivalent Hash.
602
+ #
603
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::UpdateRepositoryRequest, ::Hash]
604
+ # A request object representing the call parameters. Required. To specify no
605
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
606
+ # @param options [::Gapic::CallOptions, ::Hash]
607
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
608
+ #
609
+ # @overload update_repository(repository: nil, update_mask: nil)
610
+ # Pass arguments to `update_repository` via keyword arguments. Note that at
611
+ # least one keyword argument is required. To specify no parameters, or to keep all
612
+ # the default parameter values, pass an empty Hash as a request object (see above).
613
+ #
614
+ # @param repository [::Google::Cloud::ArtifactRegistry::V1beta2::Repository, ::Hash]
615
+ # The repository that replaces the resource on the server.
616
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
617
+ # The update mask applies to the resource. For the `FieldMask` definition,
618
+ # see
619
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
620
+ # @yield [result, operation] Access the result along with the TransportOperation object
621
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::Repository]
622
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
623
+ #
624
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::Repository]
625
+ #
626
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
627
+ def update_repository request, options = nil
628
+ raise ::ArgumentError, "request must be provided" if request.nil?
629
+
630
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::UpdateRepositoryRequest
631
+
632
+ # Converts hash and nil to an options object
633
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
634
+
635
+ # Customize the options with defaults
636
+ call_metadata = @config.rpcs.update_repository.metadata.to_h
637
+
638
+ # Set x-goog-api-client and x-goog-user-project headers
639
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
640
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
641
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
642
+ transports_version_send: [:rest]
643
+
644
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
645
+
646
+ options.apply_defaults timeout: @config.rpcs.update_repository.timeout,
647
+ metadata: call_metadata,
648
+ retry_policy: @config.rpcs.update_repository.retry_policy
649
+
650
+ options.apply_defaults timeout: @config.timeout,
651
+ metadata: @config.metadata,
652
+ retry_policy: @config.retry_policy
653
+
654
+ @artifact_registry_stub.update_repository request, options do |result, operation|
655
+ yield result, operation if block_given?
656
+ return result
657
+ end
658
+ rescue ::Gapic::Rest::Error => e
659
+ raise ::Google::Cloud::Error.from_error(e)
660
+ end
661
+
662
+ ##
663
+ # Deletes a repository and all of its contents. The returned Operation will
664
+ # finish once the repository has been deleted. It will not have any Operation
665
+ # metadata and will return a google.protobuf.Empty response.
666
+ #
667
+ # @overload delete_repository(request, options = nil)
668
+ # Pass arguments to `delete_repository` via a request object, either of type
669
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::DeleteRepositoryRequest} or an equivalent Hash.
670
+ #
671
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::DeleteRepositoryRequest, ::Hash]
672
+ # A request object representing the call parameters. Required. To specify no
673
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
674
+ # @param options [::Gapic::CallOptions, ::Hash]
675
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
676
+ #
677
+ # @overload delete_repository(name: nil)
678
+ # Pass arguments to `delete_repository` via keyword arguments. Note that at
679
+ # least one keyword argument is required. To specify no parameters, or to keep all
680
+ # the default parameter values, pass an empty Hash as a request object (see above).
681
+ #
682
+ # @param name [::String]
683
+ # Required. The name of the repository to delete.
684
+ # @yield [result, operation] Access the result along with the TransportOperation object
685
+ # @yieldparam result [::Gapic::Operation]
686
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
687
+ #
688
+ # @return [::Gapic::Operation]
689
+ #
690
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
691
+ def delete_repository request, options = nil
692
+ raise ::ArgumentError, "request must be provided" if request.nil?
693
+
694
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::DeleteRepositoryRequest
695
+
696
+ # Converts hash and nil to an options object
697
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
698
+
699
+ # Customize the options with defaults
700
+ call_metadata = @config.rpcs.delete_repository.metadata.to_h
701
+
702
+ # Set x-goog-api-client and x-goog-user-project headers
703
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
704
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
705
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
706
+ transports_version_send: [:rest]
707
+
708
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
709
+
710
+ options.apply_defaults timeout: @config.rpcs.delete_repository.timeout,
711
+ metadata: call_metadata,
712
+ retry_policy: @config.rpcs.delete_repository.retry_policy
713
+
714
+ options.apply_defaults timeout: @config.timeout,
715
+ metadata: @config.metadata,
716
+ retry_policy: @config.retry_policy
717
+
718
+ @artifact_registry_stub.delete_repository request, options do |result, operation|
719
+ result = ::Gapic::Operation.new result, @operations_client, options: options
720
+ yield result, operation if block_given?
721
+ return result
722
+ end
723
+ rescue ::Gapic::Rest::Error => e
724
+ raise ::Google::Cloud::Error.from_error(e)
725
+ end
726
+
727
+ ##
728
+ # Lists packages.
729
+ #
730
+ # @overload list_packages(request, options = nil)
731
+ # Pass arguments to `list_packages` via a request object, either of type
732
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ListPackagesRequest} or an equivalent Hash.
733
+ #
734
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::ListPackagesRequest, ::Hash]
735
+ # A request object representing the call parameters. Required. To specify no
736
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
737
+ # @param options [::Gapic::CallOptions, ::Hash]
738
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
739
+ #
740
+ # @overload list_packages(parent: nil, page_size: nil, page_token: nil)
741
+ # Pass arguments to `list_packages` via keyword arguments. Note that at
742
+ # least one keyword argument is required. To specify no parameters, or to keep all
743
+ # the default parameter values, pass an empty Hash as a request object (see above).
744
+ #
745
+ # @param parent [::String]
746
+ # The name of the parent resource whose packages will be listed.
747
+ # @param page_size [::Integer]
748
+ # The maximum number of packages to return.
749
+ # Maximum page size is 10,000.
750
+ # @param page_token [::String]
751
+ # The next_page_token value returned from a previous list request, if any.
752
+ # @yield [result, operation] Access the result along with the TransportOperation object
753
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Package>]
754
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
755
+ #
756
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Package>]
757
+ #
758
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
759
+ def list_packages request, options = nil
760
+ raise ::ArgumentError, "request must be provided" if request.nil?
761
+
762
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::ListPackagesRequest
763
+
764
+ # Converts hash and nil to an options object
765
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
766
+
767
+ # Customize the options with defaults
768
+ call_metadata = @config.rpcs.list_packages.metadata.to_h
769
+
770
+ # Set x-goog-api-client and x-goog-user-project headers
771
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
772
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
773
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
774
+ transports_version_send: [:rest]
775
+
776
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
777
+
778
+ options.apply_defaults timeout: @config.rpcs.list_packages.timeout,
779
+ metadata: call_metadata,
780
+ retry_policy: @config.rpcs.list_packages.retry_policy
781
+
782
+ options.apply_defaults timeout: @config.timeout,
783
+ metadata: @config.metadata,
784
+ retry_policy: @config.retry_policy
785
+
786
+ @artifact_registry_stub.list_packages request, options do |result, operation|
787
+ result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_packages, "packages", request, result, options
788
+ yield result, operation if block_given?
789
+ return result
790
+ end
791
+ rescue ::Gapic::Rest::Error => e
792
+ raise ::Google::Cloud::Error.from_error(e)
793
+ end
794
+
795
+ ##
796
+ # Gets a package.
797
+ #
798
+ # @overload get_package(request, options = nil)
799
+ # Pass arguments to `get_package` via a request object, either of type
800
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::GetPackageRequest} or an equivalent Hash.
801
+ #
802
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::GetPackageRequest, ::Hash]
803
+ # A request object representing the call parameters. Required. To specify no
804
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
805
+ # @param options [::Gapic::CallOptions, ::Hash]
806
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
807
+ #
808
+ # @overload get_package(name: nil)
809
+ # Pass arguments to `get_package` via keyword arguments. Note that at
810
+ # least one keyword argument is required. To specify no parameters, or to keep all
811
+ # the default parameter values, pass an empty Hash as a request object (see above).
812
+ #
813
+ # @param name [::String]
814
+ # The name of the package to retrieve.
815
+ # @yield [result, operation] Access the result along with the TransportOperation object
816
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::Package]
817
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
818
+ #
819
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::Package]
820
+ #
821
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
822
+ def get_package request, options = nil
823
+ raise ::ArgumentError, "request must be provided" if request.nil?
824
+
825
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::GetPackageRequest
826
+
827
+ # Converts hash and nil to an options object
828
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
829
+
830
+ # Customize the options with defaults
831
+ call_metadata = @config.rpcs.get_package.metadata.to_h
832
+
833
+ # Set x-goog-api-client and x-goog-user-project headers
834
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
835
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
836
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
837
+ transports_version_send: [:rest]
838
+
839
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
840
+
841
+ options.apply_defaults timeout: @config.rpcs.get_package.timeout,
842
+ metadata: call_metadata,
843
+ retry_policy: @config.rpcs.get_package.retry_policy
844
+
845
+ options.apply_defaults timeout: @config.timeout,
846
+ metadata: @config.metadata,
847
+ retry_policy: @config.retry_policy
848
+
849
+ @artifact_registry_stub.get_package request, options do |result, operation|
850
+ yield result, operation if block_given?
851
+ return result
852
+ end
853
+ rescue ::Gapic::Rest::Error => e
854
+ raise ::Google::Cloud::Error.from_error(e)
855
+ end
856
+
857
+ ##
858
+ # Deletes a package and all of its versions and tags. The returned operation
859
+ # will complete once the package has been deleted.
860
+ #
861
+ # @overload delete_package(request, options = nil)
862
+ # Pass arguments to `delete_package` via a request object, either of type
863
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::DeletePackageRequest} or an equivalent Hash.
864
+ #
865
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::DeletePackageRequest, ::Hash]
866
+ # A request object representing the call parameters. Required. To specify no
867
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
868
+ # @param options [::Gapic::CallOptions, ::Hash]
869
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
870
+ #
871
+ # @overload delete_package(name: nil)
872
+ # Pass arguments to `delete_package` via keyword arguments. Note that at
873
+ # least one keyword argument is required. To specify no parameters, or to keep all
874
+ # the default parameter values, pass an empty Hash as a request object (see above).
875
+ #
876
+ # @param name [::String]
877
+ # The name of the package to delete.
878
+ # @yield [result, operation] Access the result along with the TransportOperation object
879
+ # @yieldparam result [::Gapic::Operation]
880
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
881
+ #
882
+ # @return [::Gapic::Operation]
883
+ #
884
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
885
+ def delete_package request, options = nil
886
+ raise ::ArgumentError, "request must be provided" if request.nil?
887
+
888
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::DeletePackageRequest
889
+
890
+ # Converts hash and nil to an options object
891
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
892
+
893
+ # Customize the options with defaults
894
+ call_metadata = @config.rpcs.delete_package.metadata.to_h
895
+
896
+ # Set x-goog-api-client and x-goog-user-project headers
897
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
898
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
899
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
900
+ transports_version_send: [:rest]
901
+
902
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
903
+
904
+ options.apply_defaults timeout: @config.rpcs.delete_package.timeout,
905
+ metadata: call_metadata,
906
+ retry_policy: @config.rpcs.delete_package.retry_policy
907
+
908
+ options.apply_defaults timeout: @config.timeout,
909
+ metadata: @config.metadata,
910
+ retry_policy: @config.retry_policy
911
+
912
+ @artifact_registry_stub.delete_package request, options do |result, operation|
913
+ result = ::Gapic::Operation.new result, @operations_client, options: options
914
+ yield result, operation if block_given?
915
+ return result
916
+ end
917
+ rescue ::Gapic::Rest::Error => e
918
+ raise ::Google::Cloud::Error.from_error(e)
919
+ end
920
+
921
+ ##
922
+ # Lists versions.
923
+ #
924
+ # @overload list_versions(request, options = nil)
925
+ # Pass arguments to `list_versions` via a request object, either of type
926
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsRequest} or an equivalent Hash.
927
+ #
928
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsRequest, ::Hash]
929
+ # A request object representing the call parameters. Required. To specify no
930
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
931
+ # @param options [::Gapic::CallOptions, ::Hash]
932
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
933
+ #
934
+ # @overload list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil)
935
+ # Pass arguments to `list_versions` via keyword arguments. Note that at
936
+ # least one keyword argument is required. To specify no parameters, or to keep all
937
+ # the default parameter values, pass an empty Hash as a request object (see above).
938
+ #
939
+ # @param parent [::String]
940
+ # The name of the parent resource whose versions will be listed.
941
+ # @param page_size [::Integer]
942
+ # The maximum number of versions to return. Maximum page size is 1,000.
943
+ # @param page_token [::String]
944
+ # The next_page_token value returned from a previous list request, if any.
945
+ # @param view [::Google::Cloud::ArtifactRegistry::V1beta2::VersionView]
946
+ # The view that should be returned in the response.
947
+ # @param order_by [::String]
948
+ # Optional. The field to order the results by.
949
+ # @yield [result, operation] Access the result along with the TransportOperation object
950
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Version>]
951
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
952
+ #
953
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Version>]
954
+ #
955
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
956
+ def list_versions request, options = nil
957
+ raise ::ArgumentError, "request must be provided" if request.nil?
958
+
959
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsRequest
960
+
961
+ # Converts hash and nil to an options object
962
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
963
+
964
+ # Customize the options with defaults
965
+ call_metadata = @config.rpcs.list_versions.metadata.to_h
966
+
967
+ # Set x-goog-api-client and x-goog-user-project headers
968
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
969
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
970
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
971
+ transports_version_send: [:rest]
972
+
973
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
974
+
975
+ options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
976
+ metadata: call_metadata,
977
+ retry_policy: @config.rpcs.list_versions.retry_policy
978
+
979
+ options.apply_defaults timeout: @config.timeout,
980
+ metadata: @config.metadata,
981
+ retry_policy: @config.retry_policy
982
+
983
+ @artifact_registry_stub.list_versions request, options do |result, operation|
984
+ result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_versions, "versions", request, result, options
985
+ yield result, operation if block_given?
986
+ return result
987
+ end
988
+ rescue ::Gapic::Rest::Error => e
989
+ raise ::Google::Cloud::Error.from_error(e)
990
+ end
991
+
992
+ ##
993
+ # Gets a version
994
+ #
995
+ # @overload get_version(request, options = nil)
996
+ # Pass arguments to `get_version` via a request object, either of type
997
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::GetVersionRequest} or an equivalent Hash.
998
+ #
999
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::GetVersionRequest, ::Hash]
1000
+ # A request object representing the call parameters. Required. To specify no
1001
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1002
+ # @param options [::Gapic::CallOptions, ::Hash]
1003
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1004
+ #
1005
+ # @overload get_version(name: nil, view: nil)
1006
+ # Pass arguments to `get_version` via keyword arguments. Note that at
1007
+ # least one keyword argument is required. To specify no parameters, or to keep all
1008
+ # the default parameter values, pass an empty Hash as a request object (see above).
1009
+ #
1010
+ # @param name [::String]
1011
+ # The name of the version to retrieve.
1012
+ # @param view [::Google::Cloud::ArtifactRegistry::V1beta2::VersionView]
1013
+ # The view that should be returned in the response.
1014
+ # @yield [result, operation] Access the result along with the TransportOperation object
1015
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::Version]
1016
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1017
+ #
1018
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::Version]
1019
+ #
1020
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1021
+ def get_version request, options = nil
1022
+ raise ::ArgumentError, "request must be provided" if request.nil?
1023
+
1024
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::GetVersionRequest
1025
+
1026
+ # Converts hash and nil to an options object
1027
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1028
+
1029
+ # Customize the options with defaults
1030
+ call_metadata = @config.rpcs.get_version.metadata.to_h
1031
+
1032
+ # Set x-goog-api-client and x-goog-user-project headers
1033
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1034
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1035
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1036
+ transports_version_send: [:rest]
1037
+
1038
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1039
+
1040
+ options.apply_defaults timeout: @config.rpcs.get_version.timeout,
1041
+ metadata: call_metadata,
1042
+ retry_policy: @config.rpcs.get_version.retry_policy
1043
+
1044
+ options.apply_defaults timeout: @config.timeout,
1045
+ metadata: @config.metadata,
1046
+ retry_policy: @config.retry_policy
1047
+
1048
+ @artifact_registry_stub.get_version request, options do |result, operation|
1049
+ yield result, operation if block_given?
1050
+ return result
1051
+ end
1052
+ rescue ::Gapic::Rest::Error => e
1053
+ raise ::Google::Cloud::Error.from_error(e)
1054
+ end
1055
+
1056
+ ##
1057
+ # Deletes a version and all of its content. The returned operation will
1058
+ # complete once the version has been deleted.
1059
+ #
1060
+ # @overload delete_version(request, options = nil)
1061
+ # Pass arguments to `delete_version` via a request object, either of type
1062
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::DeleteVersionRequest} or an equivalent Hash.
1063
+ #
1064
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::DeleteVersionRequest, ::Hash]
1065
+ # A request object representing the call parameters. Required. To specify no
1066
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1067
+ # @param options [::Gapic::CallOptions, ::Hash]
1068
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1069
+ #
1070
+ # @overload delete_version(name: nil, force: nil)
1071
+ # Pass arguments to `delete_version` via keyword arguments. Note that at
1072
+ # least one keyword argument is required. To specify no parameters, or to keep all
1073
+ # the default parameter values, pass an empty Hash as a request object (see above).
1074
+ #
1075
+ # @param name [::String]
1076
+ # The name of the version to delete.
1077
+ # @param force [::Boolean]
1078
+ # By default, a version that is tagged may not be deleted. If force=true, the
1079
+ # version and any tags pointing to the version are deleted.
1080
+ # @yield [result, operation] Access the result along with the TransportOperation object
1081
+ # @yieldparam result [::Gapic::Operation]
1082
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1083
+ #
1084
+ # @return [::Gapic::Operation]
1085
+ #
1086
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1087
+ def delete_version request, options = nil
1088
+ raise ::ArgumentError, "request must be provided" if request.nil?
1089
+
1090
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::DeleteVersionRequest
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.delete_version.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::ArtifactRegistry::V1beta2::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.delete_version.timeout,
1107
+ metadata: call_metadata,
1108
+ retry_policy: @config.rpcs.delete_version.retry_policy
1109
+
1110
+ options.apply_defaults timeout: @config.timeout,
1111
+ metadata: @config.metadata,
1112
+ retry_policy: @config.retry_policy
1113
+
1114
+ @artifact_registry_stub.delete_version request, options do |result, operation|
1115
+ result = ::Gapic::Operation.new result, @operations_client, options: 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
+ # Lists files.
1125
+ #
1126
+ # @overload list_files(request, options = nil)
1127
+ # Pass arguments to `list_files` via a request object, either of type
1128
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ListFilesRequest} or an equivalent Hash.
1129
+ #
1130
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::ListFilesRequest, ::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 list_files(parent: nil, filter: nil, page_size: nil, page_token: nil)
1137
+ # Pass arguments to `list_files` 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 parent [::String]
1142
+ # The name of the repository whose files will be listed. For example:
1143
+ # "projects/p1/locations/us-central1/repositories/repo1
1144
+ # @param filter [::String]
1145
+ # An expression for filtering the results of the request. Filter rules are
1146
+ # case insensitive. The fields eligible for filtering are:
1147
+ #
1148
+ # * `name`
1149
+ # * `owner`
1150
+ #
1151
+ # An example of using a filter:
1152
+ #
1153
+ # * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an
1154
+ # ID starting with "a/b/".
1155
+ # * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` -->
1156
+ # Files owned by the version `1.0` in package `pkg1`.
1157
+ # @param page_size [::Integer]
1158
+ # The maximum number of files to return.
1159
+ # @param page_token [::String]
1160
+ # The next_page_token value returned from a previous list request, if any.
1161
+ # @yield [result, operation] Access the result along with the TransportOperation object
1162
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::File>]
1163
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1164
+ #
1165
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::File>]
1166
+ #
1167
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1168
+ def list_files request, options = nil
1169
+ raise ::ArgumentError, "request must be provided" if request.nil?
1170
+
1171
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::ListFilesRequest
1172
+
1173
+ # Converts hash and nil to an options object
1174
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1175
+
1176
+ # Customize the options with defaults
1177
+ call_metadata = @config.rpcs.list_files.metadata.to_h
1178
+
1179
+ # Set x-goog-api-client and x-goog-user-project headers
1180
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1181
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1182
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1183
+ transports_version_send: [:rest]
1184
+
1185
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1186
+
1187
+ options.apply_defaults timeout: @config.rpcs.list_files.timeout,
1188
+ metadata: call_metadata,
1189
+ retry_policy: @config.rpcs.list_files.retry_policy
1190
+
1191
+ options.apply_defaults timeout: @config.timeout,
1192
+ metadata: @config.metadata,
1193
+ retry_policy: @config.retry_policy
1194
+
1195
+ @artifact_registry_stub.list_files request, options do |result, operation|
1196
+ result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_files, "files", request, result, options
1197
+ yield result, operation if block_given?
1198
+ return result
1199
+ end
1200
+ rescue ::Gapic::Rest::Error => e
1201
+ raise ::Google::Cloud::Error.from_error(e)
1202
+ end
1203
+
1204
+ ##
1205
+ # Gets a file.
1206
+ #
1207
+ # @overload get_file(request, options = nil)
1208
+ # Pass arguments to `get_file` via a request object, either of type
1209
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::GetFileRequest} or an equivalent Hash.
1210
+ #
1211
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::GetFileRequest, ::Hash]
1212
+ # A request object representing the call parameters. Required. To specify no
1213
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1214
+ # @param options [::Gapic::CallOptions, ::Hash]
1215
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1216
+ #
1217
+ # @overload get_file(name: nil)
1218
+ # Pass arguments to `get_file` via keyword arguments. Note that at
1219
+ # least one keyword argument is required. To specify no parameters, or to keep all
1220
+ # the default parameter values, pass an empty Hash as a request object (see above).
1221
+ #
1222
+ # @param name [::String]
1223
+ # The name of the file to retrieve.
1224
+ # @yield [result, operation] Access the result along with the TransportOperation object
1225
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::File]
1226
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1227
+ #
1228
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::File]
1229
+ #
1230
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1231
+ def get_file request, options = nil
1232
+ raise ::ArgumentError, "request must be provided" if request.nil?
1233
+
1234
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::GetFileRequest
1235
+
1236
+ # Converts hash and nil to an options object
1237
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1238
+
1239
+ # Customize the options with defaults
1240
+ call_metadata = @config.rpcs.get_file.metadata.to_h
1241
+
1242
+ # Set x-goog-api-client and x-goog-user-project headers
1243
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1244
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1245
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1246
+ transports_version_send: [:rest]
1247
+
1248
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1249
+
1250
+ options.apply_defaults timeout: @config.rpcs.get_file.timeout,
1251
+ metadata: call_metadata,
1252
+ retry_policy: @config.rpcs.get_file.retry_policy
1253
+
1254
+ options.apply_defaults timeout: @config.timeout,
1255
+ metadata: @config.metadata,
1256
+ retry_policy: @config.retry_policy
1257
+
1258
+ @artifact_registry_stub.get_file request, options do |result, operation|
1259
+ yield result, operation if block_given?
1260
+ return result
1261
+ end
1262
+ rescue ::Gapic::Rest::Error => e
1263
+ raise ::Google::Cloud::Error.from_error(e)
1264
+ end
1265
+
1266
+ ##
1267
+ # Lists tags.
1268
+ #
1269
+ # @overload list_tags(request, options = nil)
1270
+ # Pass arguments to `list_tags` via a request object, either of type
1271
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ListTagsRequest} or an equivalent Hash.
1272
+ #
1273
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::ListTagsRequest, ::Hash]
1274
+ # A request object representing the call parameters. Required. To specify no
1275
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1276
+ # @param options [::Gapic::CallOptions, ::Hash]
1277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1278
+ #
1279
+ # @overload list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil)
1280
+ # Pass arguments to `list_tags` via keyword arguments. Note that at
1281
+ # least one keyword argument is required. To specify no parameters, or to keep all
1282
+ # the default parameter values, pass an empty Hash as a request object (see above).
1283
+ #
1284
+ # @param parent [::String]
1285
+ # The name of the parent resource whose tags will be listed.
1286
+ # @param filter [::String]
1287
+ # An expression for filtering the results of the request. Filter rules are
1288
+ # case insensitive. The fields eligible for filtering are:
1289
+ #
1290
+ # * `version`
1291
+ #
1292
+ # An example of using a filter:
1293
+ #
1294
+ # * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"`
1295
+ # --> Tags that are applied to the version `1.0` in package `pkg1`.
1296
+ # @param page_size [::Integer]
1297
+ # The maximum number of tags to return. Maximum page size is 10,000.
1298
+ # @param page_token [::String]
1299
+ # The next_page_token value returned from a previous list request, if any.
1300
+ # @yield [result, operation] Access the result along with the TransportOperation object
1301
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Tag>]
1302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1303
+ #
1304
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Tag>]
1305
+ #
1306
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1307
+ def list_tags request, options = nil
1308
+ raise ::ArgumentError, "request must be provided" if request.nil?
1309
+
1310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::ListTagsRequest
1311
+
1312
+ # Converts hash and nil to an options object
1313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1314
+
1315
+ # Customize the options with defaults
1316
+ call_metadata = @config.rpcs.list_tags.metadata.to_h
1317
+
1318
+ # Set x-goog-api-client and x-goog-user-project headers
1319
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1321
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1322
+ transports_version_send: [:rest]
1323
+
1324
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1325
+
1326
+ options.apply_defaults timeout: @config.rpcs.list_tags.timeout,
1327
+ metadata: call_metadata,
1328
+ retry_policy: @config.rpcs.list_tags.retry_policy
1329
+
1330
+ options.apply_defaults timeout: @config.timeout,
1331
+ metadata: @config.metadata,
1332
+ retry_policy: @config.retry_policy
1333
+
1334
+ @artifact_registry_stub.list_tags request, options do |result, operation|
1335
+ result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_tags, "tags", request, result, options
1336
+ yield result, operation if block_given?
1337
+ return result
1338
+ end
1339
+ rescue ::Gapic::Rest::Error => e
1340
+ raise ::Google::Cloud::Error.from_error(e)
1341
+ end
1342
+
1343
+ ##
1344
+ # Gets a tag.
1345
+ #
1346
+ # @overload get_tag(request, options = nil)
1347
+ # Pass arguments to `get_tag` via a request object, either of type
1348
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::GetTagRequest} or an equivalent Hash.
1349
+ #
1350
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::GetTagRequest, ::Hash]
1351
+ # A request object representing the call parameters. Required. To specify no
1352
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1353
+ # @param options [::Gapic::CallOptions, ::Hash]
1354
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1355
+ #
1356
+ # @overload get_tag(name: nil)
1357
+ # Pass arguments to `get_tag` via keyword arguments. Note that at
1358
+ # least one keyword argument is required. To specify no parameters, or to keep all
1359
+ # the default parameter values, pass an empty Hash as a request object (see above).
1360
+ #
1361
+ # @param name [::String]
1362
+ # The name of the tag to retrieve.
1363
+ # @yield [result, operation] Access the result along with the TransportOperation object
1364
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::Tag]
1365
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1366
+ #
1367
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::Tag]
1368
+ #
1369
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1370
+ def get_tag request, options = nil
1371
+ raise ::ArgumentError, "request must be provided" if request.nil?
1372
+
1373
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::GetTagRequest
1374
+
1375
+ # Converts hash and nil to an options object
1376
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1377
+
1378
+ # Customize the options with defaults
1379
+ call_metadata = @config.rpcs.get_tag.metadata.to_h
1380
+
1381
+ # Set x-goog-api-client and x-goog-user-project headers
1382
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1383
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1384
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1385
+ transports_version_send: [:rest]
1386
+
1387
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1388
+
1389
+ options.apply_defaults timeout: @config.rpcs.get_tag.timeout,
1390
+ metadata: call_metadata,
1391
+ retry_policy: @config.rpcs.get_tag.retry_policy
1392
+
1393
+ options.apply_defaults timeout: @config.timeout,
1394
+ metadata: @config.metadata,
1395
+ retry_policy: @config.retry_policy
1396
+
1397
+ @artifact_registry_stub.get_tag request, options do |result, operation|
1398
+ yield result, operation if block_given?
1399
+ return result
1400
+ end
1401
+ rescue ::Gapic::Rest::Error => e
1402
+ raise ::Google::Cloud::Error.from_error(e)
1403
+ end
1404
+
1405
+ ##
1406
+ # Creates a tag.
1407
+ #
1408
+ # @overload create_tag(request, options = nil)
1409
+ # Pass arguments to `create_tag` via a request object, either of type
1410
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::CreateTagRequest} or an equivalent Hash.
1411
+ #
1412
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::CreateTagRequest, ::Hash]
1413
+ # A request object representing the call parameters. Required. To specify no
1414
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1415
+ # @param options [::Gapic::CallOptions, ::Hash]
1416
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1417
+ #
1418
+ # @overload create_tag(parent: nil, tag_id: nil, tag: nil)
1419
+ # Pass arguments to `create_tag` via keyword arguments. Note that at
1420
+ # least one keyword argument is required. To specify no parameters, or to keep all
1421
+ # the default parameter values, pass an empty Hash as a request object (see above).
1422
+ #
1423
+ # @param parent [::String]
1424
+ # The name of the parent resource where the tag will be created.
1425
+ # @param tag_id [::String]
1426
+ # The tag id to use for this repository.
1427
+ # @param tag [::Google::Cloud::ArtifactRegistry::V1beta2::Tag, ::Hash]
1428
+ # The tag to be created.
1429
+ # @yield [result, operation] Access the result along with the TransportOperation object
1430
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::Tag]
1431
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1432
+ #
1433
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::Tag]
1434
+ #
1435
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1436
+ def create_tag request, options = nil
1437
+ raise ::ArgumentError, "request must be provided" if request.nil?
1438
+
1439
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::CreateTagRequest
1440
+
1441
+ # Converts hash and nil to an options object
1442
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1443
+
1444
+ # Customize the options with defaults
1445
+ call_metadata = @config.rpcs.create_tag.metadata.to_h
1446
+
1447
+ # Set x-goog-api-client and x-goog-user-project headers
1448
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1449
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1450
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1451
+ transports_version_send: [:rest]
1452
+
1453
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1454
+
1455
+ options.apply_defaults timeout: @config.rpcs.create_tag.timeout,
1456
+ metadata: call_metadata,
1457
+ retry_policy: @config.rpcs.create_tag.retry_policy
1458
+
1459
+ options.apply_defaults timeout: @config.timeout,
1460
+ metadata: @config.metadata,
1461
+ retry_policy: @config.retry_policy
1462
+
1463
+ @artifact_registry_stub.create_tag request, options do |result, operation|
1464
+ yield result, operation if block_given?
1465
+ return result
1466
+ end
1467
+ rescue ::Gapic::Rest::Error => e
1468
+ raise ::Google::Cloud::Error.from_error(e)
1469
+ end
1470
+
1471
+ ##
1472
+ # Updates a tag.
1473
+ #
1474
+ # @overload update_tag(request, options = nil)
1475
+ # Pass arguments to `update_tag` via a request object, either of type
1476
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::UpdateTagRequest} or an equivalent Hash.
1477
+ #
1478
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::UpdateTagRequest, ::Hash]
1479
+ # A request object representing the call parameters. Required. To specify no
1480
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1481
+ # @param options [::Gapic::CallOptions, ::Hash]
1482
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1483
+ #
1484
+ # @overload update_tag(tag: nil, update_mask: nil)
1485
+ # Pass arguments to `update_tag` via keyword arguments. Note that at
1486
+ # least one keyword argument is required. To specify no parameters, or to keep all
1487
+ # the default parameter values, pass an empty Hash as a request object (see above).
1488
+ #
1489
+ # @param tag [::Google::Cloud::ArtifactRegistry::V1beta2::Tag, ::Hash]
1490
+ # The tag that replaces the resource on the server.
1491
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1492
+ # The update mask applies to the resource. For the `FieldMask` definition,
1493
+ # see
1494
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
1495
+ # @yield [result, operation] Access the result along with the TransportOperation object
1496
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::Tag]
1497
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1498
+ #
1499
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::Tag]
1500
+ #
1501
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1502
+ def update_tag request, options = nil
1503
+ raise ::ArgumentError, "request must be provided" if request.nil?
1504
+
1505
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::UpdateTagRequest
1506
+
1507
+ # Converts hash and nil to an options object
1508
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1509
+
1510
+ # Customize the options with defaults
1511
+ call_metadata = @config.rpcs.update_tag.metadata.to_h
1512
+
1513
+ # Set x-goog-api-client and x-goog-user-project headers
1514
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1515
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1516
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1517
+ transports_version_send: [:rest]
1518
+
1519
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1520
+
1521
+ options.apply_defaults timeout: @config.rpcs.update_tag.timeout,
1522
+ metadata: call_metadata,
1523
+ retry_policy: @config.rpcs.update_tag.retry_policy
1524
+
1525
+ options.apply_defaults timeout: @config.timeout,
1526
+ metadata: @config.metadata,
1527
+ retry_policy: @config.retry_policy
1528
+
1529
+ @artifact_registry_stub.update_tag request, options do |result, operation|
1530
+ yield result, operation if block_given?
1531
+ return result
1532
+ end
1533
+ rescue ::Gapic::Rest::Error => e
1534
+ raise ::Google::Cloud::Error.from_error(e)
1535
+ end
1536
+
1537
+ ##
1538
+ # Deletes a tag.
1539
+ #
1540
+ # @overload delete_tag(request, options = nil)
1541
+ # Pass arguments to `delete_tag` via a request object, either of type
1542
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::DeleteTagRequest} or an equivalent Hash.
1543
+ #
1544
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::DeleteTagRequest, ::Hash]
1545
+ # A request object representing the call parameters. Required. To specify no
1546
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1547
+ # @param options [::Gapic::CallOptions, ::Hash]
1548
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1549
+ #
1550
+ # @overload delete_tag(name: nil)
1551
+ # Pass arguments to `delete_tag` via keyword arguments. Note that at
1552
+ # least one keyword argument is required. To specify no parameters, or to keep all
1553
+ # the default parameter values, pass an empty Hash as a request object (see above).
1554
+ #
1555
+ # @param name [::String]
1556
+ # The name of the tag to delete.
1557
+ # @yield [result, operation] Access the result along with the TransportOperation object
1558
+ # @yieldparam result [::Google::Protobuf::Empty]
1559
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1560
+ #
1561
+ # @return [::Google::Protobuf::Empty]
1562
+ #
1563
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1564
+ def delete_tag request, options = nil
1565
+ raise ::ArgumentError, "request must be provided" if request.nil?
1566
+
1567
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::DeleteTagRequest
1568
+
1569
+ # Converts hash and nil to an options object
1570
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1571
+
1572
+ # Customize the options with defaults
1573
+ call_metadata = @config.rpcs.delete_tag.metadata.to_h
1574
+
1575
+ # Set x-goog-api-client and x-goog-user-project headers
1576
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1577
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1578
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1579
+ transports_version_send: [:rest]
1580
+
1581
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1582
+
1583
+ options.apply_defaults timeout: @config.rpcs.delete_tag.timeout,
1584
+ metadata: call_metadata,
1585
+ retry_policy: @config.rpcs.delete_tag.retry_policy
1586
+
1587
+ options.apply_defaults timeout: @config.timeout,
1588
+ metadata: @config.metadata,
1589
+ retry_policy: @config.retry_policy
1590
+
1591
+ @artifact_registry_stub.delete_tag request, options do |result, operation|
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
+ # Updates the IAM policy for a given resource.
1601
+ #
1602
+ # @overload set_iam_policy(request, options = nil)
1603
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1604
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1605
+ #
1606
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1607
+ # A request object representing the call parameters. Required. To specify no
1608
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1609
+ # @param options [::Gapic::CallOptions, ::Hash]
1610
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1611
+ #
1612
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1613
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1614
+ # least one keyword argument is required. To specify no parameters, or to keep all
1615
+ # the default parameter values, pass an empty Hash as a request object (see above).
1616
+ #
1617
+ # @param resource [::String]
1618
+ # REQUIRED: The resource for which the policy is being specified.
1619
+ # See the operation documentation for the appropriate value for this field.
1620
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1621
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1622
+ # the policy is limited to a few 10s of KB. An empty policy is a
1623
+ # valid policy but certain Cloud Platform services (such as Projects)
1624
+ # might reject them.
1625
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1626
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1627
+ # the fields in the mask will be modified. If no mask is provided, the
1628
+ # following default mask is used:
1629
+ #
1630
+ # `paths: "bindings, etag"`
1631
+ # @yield [result, operation] Access the result along with the TransportOperation object
1632
+ # @yieldparam result [::Google::Iam::V1::Policy]
1633
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1634
+ #
1635
+ # @return [::Google::Iam::V1::Policy]
1636
+ #
1637
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1638
+ def set_iam_policy request, options = nil
1639
+ raise ::ArgumentError, "request must be provided" if request.nil?
1640
+
1641
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1642
+
1643
+ # Converts hash and nil to an options object
1644
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1645
+
1646
+ # Customize the options with defaults
1647
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1648
+
1649
+ # Set x-goog-api-client and x-goog-user-project headers
1650
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1651
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1652
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1653
+ transports_version_send: [:rest]
1654
+
1655
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1656
+
1657
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1658
+ metadata: call_metadata,
1659
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1660
+
1661
+ options.apply_defaults timeout: @config.timeout,
1662
+ metadata: @config.metadata,
1663
+ retry_policy: @config.retry_policy
1664
+
1665
+ @artifact_registry_stub.set_iam_policy request, options do |result, operation|
1666
+ yield result, operation if block_given?
1667
+ return result
1668
+ end
1669
+ rescue ::Gapic::Rest::Error => e
1670
+ raise ::Google::Cloud::Error.from_error(e)
1671
+ end
1672
+
1673
+ ##
1674
+ # Gets the IAM policy for a given resource.
1675
+ #
1676
+ # @overload get_iam_policy(request, options = nil)
1677
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1678
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1679
+ #
1680
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1681
+ # A request object representing the call parameters. Required. To specify no
1682
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1683
+ # @param options [::Gapic::CallOptions, ::Hash]
1684
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1685
+ #
1686
+ # @overload get_iam_policy(resource: nil, options: nil)
1687
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1688
+ # least one keyword argument is required. To specify no parameters, or to keep all
1689
+ # the default parameter values, pass an empty Hash as a request object (see above).
1690
+ #
1691
+ # @param resource [::String]
1692
+ # REQUIRED: The resource for which the policy is being requested.
1693
+ # See the operation documentation for the appropriate value for this field.
1694
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1695
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1696
+ # `GetIamPolicy`.
1697
+ # @yield [result, operation] Access the result along with the TransportOperation object
1698
+ # @yieldparam result [::Google::Iam::V1::Policy]
1699
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1700
+ #
1701
+ # @return [::Google::Iam::V1::Policy]
1702
+ #
1703
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1704
+ def get_iam_policy request, options = nil
1705
+ raise ::ArgumentError, "request must be provided" if request.nil?
1706
+
1707
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1708
+
1709
+ # Converts hash and nil to an options object
1710
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1711
+
1712
+ # Customize the options with defaults
1713
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
1714
+
1715
+ # Set x-goog-api-client and x-goog-user-project headers
1716
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1717
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1718
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1719
+ transports_version_send: [:rest]
1720
+
1721
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1722
+
1723
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1724
+ metadata: call_metadata,
1725
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1726
+
1727
+ options.apply_defaults timeout: @config.timeout,
1728
+ metadata: @config.metadata,
1729
+ retry_policy: @config.retry_policy
1730
+
1731
+ @artifact_registry_stub.get_iam_policy request, options do |result, operation|
1732
+ yield result, operation if block_given?
1733
+ return result
1734
+ end
1735
+ rescue ::Gapic::Rest::Error => e
1736
+ raise ::Google::Cloud::Error.from_error(e)
1737
+ end
1738
+
1739
+ ##
1740
+ # Tests if the caller has a list of permissions on a resource.
1741
+ #
1742
+ # @overload test_iam_permissions(request, options = nil)
1743
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1744
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
1745
+ #
1746
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
1747
+ # A request object representing the call parameters. Required. To specify no
1748
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1749
+ # @param options [::Gapic::CallOptions, ::Hash]
1750
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1751
+ #
1752
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
1753
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1754
+ # least one keyword argument is required. To specify no parameters, or to keep all
1755
+ # the default parameter values, pass an empty Hash as a request object (see above).
1756
+ #
1757
+ # @param resource [::String]
1758
+ # REQUIRED: The resource for which the policy detail is being requested.
1759
+ # See the operation documentation for the appropriate value for this field.
1760
+ # @param permissions [::Array<::String>]
1761
+ # The set of permissions to check for the `resource`. Permissions with
1762
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
1763
+ # information see
1764
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1765
+ # @yield [result, operation] Access the result along with the TransportOperation object
1766
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
1767
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1768
+ #
1769
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
1770
+ #
1771
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1772
+ def test_iam_permissions request, options = nil
1773
+ raise ::ArgumentError, "request must be provided" if request.nil?
1774
+
1775
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
1776
+
1777
+ # Converts hash and nil to an options object
1778
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1779
+
1780
+ # Customize the options with defaults
1781
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1782
+
1783
+ # Set x-goog-api-client and x-goog-user-project headers
1784
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1785
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1786
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1787
+ transports_version_send: [:rest]
1788
+
1789
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1790
+
1791
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1792
+ metadata: call_metadata,
1793
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1794
+
1795
+ options.apply_defaults timeout: @config.timeout,
1796
+ metadata: @config.metadata,
1797
+ retry_policy: @config.retry_policy
1798
+
1799
+ @artifact_registry_stub.test_iam_permissions request, options do |result, operation|
1800
+ yield result, operation if block_given?
1801
+ return result
1802
+ end
1803
+ rescue ::Gapic::Rest::Error => e
1804
+ raise ::Google::Cloud::Error.from_error(e)
1805
+ end
1806
+
1807
+ ##
1808
+ # Retrieves the Settings for the Project.
1809
+ #
1810
+ # @overload get_project_settings(request, options = nil)
1811
+ # Pass arguments to `get_project_settings` via a request object, either of type
1812
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::GetProjectSettingsRequest} or an equivalent Hash.
1813
+ #
1814
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::GetProjectSettingsRequest, ::Hash]
1815
+ # A request object representing the call parameters. Required. To specify no
1816
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1817
+ # @param options [::Gapic::CallOptions, ::Hash]
1818
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1819
+ #
1820
+ # @overload get_project_settings(name: nil)
1821
+ # Pass arguments to `get_project_settings` via keyword arguments. Note that at
1822
+ # least one keyword argument is required. To specify no parameters, or to keep all
1823
+ # the default parameter values, pass an empty Hash as a request object (see above).
1824
+ #
1825
+ # @param name [::String]
1826
+ # Required. The name of the projectSettings resource.
1827
+ # @yield [result, operation] Access the result along with the TransportOperation object
1828
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings]
1829
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1830
+ #
1831
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings]
1832
+ #
1833
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1834
+ def get_project_settings request, options = nil
1835
+ raise ::ArgumentError, "request must be provided" if request.nil?
1836
+
1837
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::GetProjectSettingsRequest
1838
+
1839
+ # Converts hash and nil to an options object
1840
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1841
+
1842
+ # Customize the options with defaults
1843
+ call_metadata = @config.rpcs.get_project_settings.metadata.to_h
1844
+
1845
+ # Set x-goog-api-client and x-goog-user-project headers
1846
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1847
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1848
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1849
+ transports_version_send: [:rest]
1850
+
1851
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1852
+
1853
+ options.apply_defaults timeout: @config.rpcs.get_project_settings.timeout,
1854
+ metadata: call_metadata,
1855
+ retry_policy: @config.rpcs.get_project_settings.retry_policy
1856
+
1857
+ options.apply_defaults timeout: @config.timeout,
1858
+ metadata: @config.metadata,
1859
+ retry_policy: @config.retry_policy
1860
+
1861
+ @artifact_registry_stub.get_project_settings request, options do |result, operation|
1862
+ yield result, operation if block_given?
1863
+ return result
1864
+ end
1865
+ rescue ::Gapic::Rest::Error => e
1866
+ raise ::Google::Cloud::Error.from_error(e)
1867
+ end
1868
+
1869
+ ##
1870
+ # Updates the Settings for the Project.
1871
+ #
1872
+ # @overload update_project_settings(request, options = nil)
1873
+ # Pass arguments to `update_project_settings` via a request object, either of type
1874
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::UpdateProjectSettingsRequest} or an equivalent Hash.
1875
+ #
1876
+ # @param request [::Google::Cloud::ArtifactRegistry::V1beta2::UpdateProjectSettingsRequest, ::Hash]
1877
+ # A request object representing the call parameters. Required. To specify no
1878
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1879
+ # @param options [::Gapic::CallOptions, ::Hash]
1880
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1881
+ #
1882
+ # @overload update_project_settings(project_settings: nil, update_mask: nil)
1883
+ # Pass arguments to `update_project_settings` via keyword arguments. Note that at
1884
+ # least one keyword argument is required. To specify no parameters, or to keep all
1885
+ # the default parameter values, pass an empty Hash as a request object (see above).
1886
+ #
1887
+ # @param project_settings [::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings, ::Hash]
1888
+ # The project settings.
1889
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1890
+ # Field mask to support partial updates.
1891
+ # @yield [result, operation] Access the result along with the TransportOperation object
1892
+ # @yieldparam result [::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings]
1893
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1894
+ #
1895
+ # @return [::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings]
1896
+ #
1897
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1898
+ def update_project_settings request, options = nil
1899
+ raise ::ArgumentError, "request must be provided" if request.nil?
1900
+
1901
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::UpdateProjectSettingsRequest
1902
+
1903
+ # Converts hash and nil to an options object
1904
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1905
+
1906
+ # Customize the options with defaults
1907
+ call_metadata = @config.rpcs.update_project_settings.metadata.to_h
1908
+
1909
+ # Set x-goog-api-client and x-goog-user-project headers
1910
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1911
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1912
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION,
1913
+ transports_version_send: [:rest]
1914
+
1915
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1916
+
1917
+ options.apply_defaults timeout: @config.rpcs.update_project_settings.timeout,
1918
+ metadata: call_metadata,
1919
+ retry_policy: @config.rpcs.update_project_settings.retry_policy
1920
+
1921
+ options.apply_defaults timeout: @config.timeout,
1922
+ metadata: @config.metadata,
1923
+ retry_policy: @config.retry_policy
1924
+
1925
+ @artifact_registry_stub.update_project_settings request, options do |result, operation|
1926
+ yield result, operation if block_given?
1927
+ return result
1928
+ end
1929
+ rescue ::Gapic::Rest::Error => e
1930
+ raise ::Google::Cloud::Error.from_error(e)
1931
+ end
1932
+
1933
+ ##
1934
+ # Configuration class for the ArtifactRegistry REST API.
1935
+ #
1936
+ # This class represents the configuration for ArtifactRegistry REST,
1937
+ # providing control over timeouts, retry behavior, logging, transport
1938
+ # parameters, and other low-level controls. Certain parameters can also be
1939
+ # applied individually to specific RPCs. See
1940
+ # {::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client::Configuration::Rpcs}
1941
+ # for a list of RPCs that can be configured independently.
1942
+ #
1943
+ # Configuration can be applied globally to all clients, or to a single client
1944
+ # on construction.
1945
+ #
1946
+ # @example
1947
+ #
1948
+ # # Modify the global config, setting the timeout for
1949
+ # # import_apt_artifacts to 20 seconds,
1950
+ # # and all remaining timeouts to 10 seconds.
1951
+ # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client.configure do |config|
1952
+ # config.timeout = 10.0
1953
+ # config.rpcs.import_apt_artifacts.timeout = 20.0
1954
+ # end
1955
+ #
1956
+ # # Apply the above configuration only to a new client.
1957
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client.new do |config|
1958
+ # config.timeout = 10.0
1959
+ # config.rpcs.import_apt_artifacts.timeout = 20.0
1960
+ # end
1961
+ #
1962
+ # @!attribute [rw] endpoint
1963
+ # The hostname or hostname:port of the service endpoint.
1964
+ # Defaults to `"artifactregistry.googleapis.com"`.
1965
+ # @return [::String]
1966
+ # @!attribute [rw] credentials
1967
+ # Credentials to send with calls. You may provide any of the following types:
1968
+ # * (`String`) The path to a service account key file in JSON format
1969
+ # * (`Hash`) A service account key as a Hash
1970
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1971
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1972
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1973
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1974
+ # * (`nil`) indicating no credentials
1975
+ # @return [::Object]
1976
+ # @!attribute [rw] scope
1977
+ # The OAuth scopes
1978
+ # @return [::Array<::String>]
1979
+ # @!attribute [rw] lib_name
1980
+ # The library name as recorded in instrumentation and logging
1981
+ # @return [::String]
1982
+ # @!attribute [rw] lib_version
1983
+ # The library version as recorded in instrumentation and logging
1984
+ # @return [::String]
1985
+ # @!attribute [rw] timeout
1986
+ # The call timeout in seconds.
1987
+ # @return [::Numeric]
1988
+ # @!attribute [rw] metadata
1989
+ # Additional headers to be sent with the call.
1990
+ # @return [::Hash{::Symbol=>::String}]
1991
+ # @!attribute [rw] retry_policy
1992
+ # The retry policy. The value is a hash with the following keys:
1993
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1994
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1995
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1996
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1997
+ # trigger a retry.
1998
+ # @return [::Hash]
1999
+ # @!attribute [rw] quota_project
2000
+ # A separate project against which to charge quota.
2001
+ # @return [::String]
2002
+ #
2003
+ class Configuration
2004
+ extend ::Gapic::Config
2005
+
2006
+ config_attr :endpoint, "artifactregistry.googleapis.com", ::String
2007
+ config_attr :credentials, nil do |value|
2008
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2009
+ allowed.any? { |klass| klass === value }
2010
+ end
2011
+ config_attr :scope, nil, ::String, ::Array, nil
2012
+ config_attr :lib_name, nil, ::String, nil
2013
+ config_attr :lib_version, nil, ::String, nil
2014
+ config_attr :timeout, nil, ::Numeric, nil
2015
+ config_attr :metadata, nil, ::Hash, nil
2016
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2017
+ config_attr :quota_project, nil, ::String, nil
2018
+
2019
+ # @private
2020
+ # Overrides for http bindings for the RPCs of this service
2021
+ # are only used when this service is used as mixin, and only
2022
+ # by the host service.
2023
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2024
+ config_attr :bindings_override, {}, ::Hash, nil
2025
+
2026
+ # @private
2027
+ def initialize parent_config = nil
2028
+ @parent_config = parent_config unless parent_config.nil?
2029
+
2030
+ yield self if block_given?
2031
+ end
2032
+
2033
+ ##
2034
+ # Configurations for individual RPCs
2035
+ # @return [Rpcs]
2036
+ #
2037
+ def rpcs
2038
+ @rpcs ||= begin
2039
+ parent_rpcs = nil
2040
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2041
+ Rpcs.new parent_rpcs
2042
+ end
2043
+ end
2044
+
2045
+ ##
2046
+ # Configuration RPC class for the ArtifactRegistry API.
2047
+ #
2048
+ # Includes fields providing the configuration for each RPC in this service.
2049
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2050
+ # the following configuration fields:
2051
+ #
2052
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2053
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2054
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2055
+ # include the following keys:
2056
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2057
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2058
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2059
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2060
+ # trigger a retry.
2061
+ #
2062
+ class Rpcs
2063
+ ##
2064
+ # RPC-specific configuration for `import_apt_artifacts`
2065
+ # @return [::Gapic::Config::Method]
2066
+ #
2067
+ attr_reader :import_apt_artifacts
2068
+ ##
2069
+ # RPC-specific configuration for `import_yum_artifacts`
2070
+ # @return [::Gapic::Config::Method]
2071
+ #
2072
+ attr_reader :import_yum_artifacts
2073
+ ##
2074
+ # RPC-specific configuration for `list_repositories`
2075
+ # @return [::Gapic::Config::Method]
2076
+ #
2077
+ attr_reader :list_repositories
2078
+ ##
2079
+ # RPC-specific configuration for `get_repository`
2080
+ # @return [::Gapic::Config::Method]
2081
+ #
2082
+ attr_reader :get_repository
2083
+ ##
2084
+ # RPC-specific configuration for `create_repository`
2085
+ # @return [::Gapic::Config::Method]
2086
+ #
2087
+ attr_reader :create_repository
2088
+ ##
2089
+ # RPC-specific configuration for `update_repository`
2090
+ # @return [::Gapic::Config::Method]
2091
+ #
2092
+ attr_reader :update_repository
2093
+ ##
2094
+ # RPC-specific configuration for `delete_repository`
2095
+ # @return [::Gapic::Config::Method]
2096
+ #
2097
+ attr_reader :delete_repository
2098
+ ##
2099
+ # RPC-specific configuration for `list_packages`
2100
+ # @return [::Gapic::Config::Method]
2101
+ #
2102
+ attr_reader :list_packages
2103
+ ##
2104
+ # RPC-specific configuration for `get_package`
2105
+ # @return [::Gapic::Config::Method]
2106
+ #
2107
+ attr_reader :get_package
2108
+ ##
2109
+ # RPC-specific configuration for `delete_package`
2110
+ # @return [::Gapic::Config::Method]
2111
+ #
2112
+ attr_reader :delete_package
2113
+ ##
2114
+ # RPC-specific configuration for `list_versions`
2115
+ # @return [::Gapic::Config::Method]
2116
+ #
2117
+ attr_reader :list_versions
2118
+ ##
2119
+ # RPC-specific configuration for `get_version`
2120
+ # @return [::Gapic::Config::Method]
2121
+ #
2122
+ attr_reader :get_version
2123
+ ##
2124
+ # RPC-specific configuration for `delete_version`
2125
+ # @return [::Gapic::Config::Method]
2126
+ #
2127
+ attr_reader :delete_version
2128
+ ##
2129
+ # RPC-specific configuration for `list_files`
2130
+ # @return [::Gapic::Config::Method]
2131
+ #
2132
+ attr_reader :list_files
2133
+ ##
2134
+ # RPC-specific configuration for `get_file`
2135
+ # @return [::Gapic::Config::Method]
2136
+ #
2137
+ attr_reader :get_file
2138
+ ##
2139
+ # RPC-specific configuration for `list_tags`
2140
+ # @return [::Gapic::Config::Method]
2141
+ #
2142
+ attr_reader :list_tags
2143
+ ##
2144
+ # RPC-specific configuration for `get_tag`
2145
+ # @return [::Gapic::Config::Method]
2146
+ #
2147
+ attr_reader :get_tag
2148
+ ##
2149
+ # RPC-specific configuration for `create_tag`
2150
+ # @return [::Gapic::Config::Method]
2151
+ #
2152
+ attr_reader :create_tag
2153
+ ##
2154
+ # RPC-specific configuration for `update_tag`
2155
+ # @return [::Gapic::Config::Method]
2156
+ #
2157
+ attr_reader :update_tag
2158
+ ##
2159
+ # RPC-specific configuration for `delete_tag`
2160
+ # @return [::Gapic::Config::Method]
2161
+ #
2162
+ attr_reader :delete_tag
2163
+ ##
2164
+ # RPC-specific configuration for `set_iam_policy`
2165
+ # @return [::Gapic::Config::Method]
2166
+ #
2167
+ attr_reader :set_iam_policy
2168
+ ##
2169
+ # RPC-specific configuration for `get_iam_policy`
2170
+ # @return [::Gapic::Config::Method]
2171
+ #
2172
+ attr_reader :get_iam_policy
2173
+ ##
2174
+ # RPC-specific configuration for `test_iam_permissions`
2175
+ # @return [::Gapic::Config::Method]
2176
+ #
2177
+ attr_reader :test_iam_permissions
2178
+ ##
2179
+ # RPC-specific configuration for `get_project_settings`
2180
+ # @return [::Gapic::Config::Method]
2181
+ #
2182
+ attr_reader :get_project_settings
2183
+ ##
2184
+ # RPC-specific configuration for `update_project_settings`
2185
+ # @return [::Gapic::Config::Method]
2186
+ #
2187
+ attr_reader :update_project_settings
2188
+
2189
+ # @private
2190
+ def initialize parent_rpcs = nil
2191
+ import_apt_artifacts_config = parent_rpcs.import_apt_artifacts if parent_rpcs.respond_to? :import_apt_artifacts
2192
+ @import_apt_artifacts = ::Gapic::Config::Method.new import_apt_artifacts_config
2193
+ import_yum_artifacts_config = parent_rpcs.import_yum_artifacts if parent_rpcs.respond_to? :import_yum_artifacts
2194
+ @import_yum_artifacts = ::Gapic::Config::Method.new import_yum_artifacts_config
2195
+ list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories
2196
+ @list_repositories = ::Gapic::Config::Method.new list_repositories_config
2197
+ get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository
2198
+ @get_repository = ::Gapic::Config::Method.new get_repository_config
2199
+ create_repository_config = parent_rpcs.create_repository if parent_rpcs.respond_to? :create_repository
2200
+ @create_repository = ::Gapic::Config::Method.new create_repository_config
2201
+ update_repository_config = parent_rpcs.update_repository if parent_rpcs.respond_to? :update_repository
2202
+ @update_repository = ::Gapic::Config::Method.new update_repository_config
2203
+ delete_repository_config = parent_rpcs.delete_repository if parent_rpcs.respond_to? :delete_repository
2204
+ @delete_repository = ::Gapic::Config::Method.new delete_repository_config
2205
+ list_packages_config = parent_rpcs.list_packages if parent_rpcs.respond_to? :list_packages
2206
+ @list_packages = ::Gapic::Config::Method.new list_packages_config
2207
+ get_package_config = parent_rpcs.get_package if parent_rpcs.respond_to? :get_package
2208
+ @get_package = ::Gapic::Config::Method.new get_package_config
2209
+ delete_package_config = parent_rpcs.delete_package if parent_rpcs.respond_to? :delete_package
2210
+ @delete_package = ::Gapic::Config::Method.new delete_package_config
2211
+ list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
2212
+ @list_versions = ::Gapic::Config::Method.new list_versions_config
2213
+ get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
2214
+ @get_version = ::Gapic::Config::Method.new get_version_config
2215
+ delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
2216
+ @delete_version = ::Gapic::Config::Method.new delete_version_config
2217
+ list_files_config = parent_rpcs.list_files if parent_rpcs.respond_to? :list_files
2218
+ @list_files = ::Gapic::Config::Method.new list_files_config
2219
+ get_file_config = parent_rpcs.get_file if parent_rpcs.respond_to? :get_file
2220
+ @get_file = ::Gapic::Config::Method.new get_file_config
2221
+ list_tags_config = parent_rpcs.list_tags if parent_rpcs.respond_to? :list_tags
2222
+ @list_tags = ::Gapic::Config::Method.new list_tags_config
2223
+ get_tag_config = parent_rpcs.get_tag if parent_rpcs.respond_to? :get_tag
2224
+ @get_tag = ::Gapic::Config::Method.new get_tag_config
2225
+ create_tag_config = parent_rpcs.create_tag if parent_rpcs.respond_to? :create_tag
2226
+ @create_tag = ::Gapic::Config::Method.new create_tag_config
2227
+ update_tag_config = parent_rpcs.update_tag if parent_rpcs.respond_to? :update_tag
2228
+ @update_tag = ::Gapic::Config::Method.new update_tag_config
2229
+ delete_tag_config = parent_rpcs.delete_tag if parent_rpcs.respond_to? :delete_tag
2230
+ @delete_tag = ::Gapic::Config::Method.new delete_tag_config
2231
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
2232
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
2233
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
2234
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
2235
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
2236
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
2237
+ get_project_settings_config = parent_rpcs.get_project_settings if parent_rpcs.respond_to? :get_project_settings
2238
+ @get_project_settings = ::Gapic::Config::Method.new get_project_settings_config
2239
+ update_project_settings_config = parent_rpcs.update_project_settings if parent_rpcs.respond_to? :update_project_settings
2240
+ @update_project_settings = ::Gapic::Config::Method.new update_project_settings_config
2241
+
2242
+ yield self if block_given?
2243
+ end
2244
+ end
2245
+ end
2246
+ end
2247
+ end
2248
+ end
2249
+ end
2250
+ end
2251
+ end
2252
+ end