google-cloud-artifact_registry-v1 0.2.0 → 0.3.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.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/README.md +1 -1
- data/lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb +2530 -70
- data/lib/google/cloud/artifact_registry/v1/artifact_registry/operations.rb +767 -0
- data/lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb +58 -0
- data/lib/google/cloud/artifact_registry/v1/artifact_registry.rb +1 -0
- data/lib/google/cloud/artifact_registry/v1/version.rb +1 -1
- data/lib/google/cloud/artifact_registry/v1.rb +2 -0
- data/lib/google/devtools/artifactregistry/v1/apt_artifact_pb.rb +63 -0
- data/lib/google/devtools/artifactregistry/v1/artifact_pb.rb +4 -1
- data/lib/google/devtools/artifactregistry/v1/file_pb.rb +57 -0
- data/lib/google/devtools/artifactregistry/v1/package_pb.rb +47 -0
- data/lib/google/devtools/artifactregistry/v1/repository_pb.rb +30 -1
- data/lib/google/devtools/artifactregistry/v1/service_pb.rb +13 -0
- data/lib/google/devtools/artifactregistry/v1/service_services_pb.rb +59 -0
- data/lib/google/devtools/artifactregistry/v1/settings_pb.rb +42 -0
- data/lib/google/devtools/artifactregistry/v1/tag_pb.rb +56 -0
- data/lib/google/devtools/artifactregistry/v1/version_pb.rb +61 -0
- data/lib/google/devtools/artifactregistry/v1/yum_artifact_pb.rb +61 -0
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/devtools/artifactregistry/v1/apt_artifact.rb +118 -0
- data/proto_docs/google/devtools/artifactregistry/v1/artifact.rb +12 -3
- data/proto_docs/google/devtools/artifactregistry/v1/file.rb +131 -0
- data/proto_docs/google/devtools/artifactregistry/v1/package.rb +93 -0
- data/proto_docs/google/devtools/artifactregistry/v1/repository.rb +73 -2
- data/proto_docs/google/devtools/artifactregistry/v1/service.rb +32 -0
- data/proto_docs/google/devtools/artifactregistry/v1/settings.rb +80 -0
- data/proto_docs/google/devtools/artifactregistry/v1/tag.rb +132 -0
- data/proto_docs/google/devtools/artifactregistry/v1/version.rb +132 -0
- data/proto_docs/google/devtools/artifactregistry/v1/yum_artifact.rb +110 -0
- data/proto_docs/google/iam/v1/iam_policy.rb +80 -0
- data/proto_docs/google/iam/v1/options.rb +40 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +28 -3
@@ -147,6 +147,12 @@ module Google
|
|
147
147
|
@quota_project_id = @config.quota_project
|
148
148
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
149
149
|
|
150
|
+
@operations_client = Operations.new do |config|
|
151
|
+
config.credentials = credentials
|
152
|
+
config.quota_project = @quota_project_id
|
153
|
+
config.endpoint = @config.endpoint
|
154
|
+
end
|
155
|
+
|
150
156
|
@artifact_registry_stub = ::Gapic::ServiceStub.new(
|
151
157
|
::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Stub,
|
152
158
|
credentials: credentials,
|
@@ -156,51 +162,2214 @@ module Google
|
|
156
162
|
)
|
157
163
|
end
|
158
164
|
|
159
|
-
|
165
|
+
##
|
166
|
+
# Get the associated client for long-running operations.
|
167
|
+
#
|
168
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Operations]
|
169
|
+
#
|
170
|
+
attr_reader :operations_client
|
171
|
+
|
172
|
+
# Service calls
|
173
|
+
|
174
|
+
##
|
175
|
+
# Lists docker images.
|
176
|
+
#
|
177
|
+
# @overload list_docker_images(request, options = nil)
|
178
|
+
# Pass arguments to `list_docker_images` via a request object, either of type
|
179
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest} or an equivalent Hash.
|
180
|
+
#
|
181
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest, ::Hash]
|
182
|
+
# A request object representing the call parameters. Required. To specify no
|
183
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
184
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
185
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
186
|
+
#
|
187
|
+
# @overload list_docker_images(parent: nil, page_size: nil, page_token: nil)
|
188
|
+
# Pass arguments to `list_docker_images` via keyword arguments. Note that at
|
189
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
190
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
191
|
+
#
|
192
|
+
# @param parent [::String]
|
193
|
+
# Required. The name of the parent resource whose docker images will be listed.
|
194
|
+
# @param page_size [::Integer]
|
195
|
+
# The maximum number of artifacts to return.
|
196
|
+
# @param page_token [::String]
|
197
|
+
# The next_page_token value returned from a previous list request, if any.
|
198
|
+
#
|
199
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
200
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
|
201
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
202
|
+
#
|
203
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
|
204
|
+
#
|
205
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
206
|
+
#
|
207
|
+
# @example Basic example
|
208
|
+
# require "google/cloud/artifact_registry/v1"
|
209
|
+
#
|
210
|
+
# # Create a client object. The client can be reused for multiple calls.
|
211
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
212
|
+
#
|
213
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
214
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest.new
|
215
|
+
#
|
216
|
+
# # Call the list_docker_images method.
|
217
|
+
# result = client.list_docker_images request
|
218
|
+
#
|
219
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
220
|
+
# # iterate over all elements by calling #each, and the enumerable
|
221
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
222
|
+
# # methods are also available for managing paging directly.
|
223
|
+
# result.each do |response|
|
224
|
+
# # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::DockerImage.
|
225
|
+
# p response
|
226
|
+
# end
|
227
|
+
#
|
228
|
+
def list_docker_images request, options = nil
|
229
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
230
|
+
|
231
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest
|
232
|
+
|
233
|
+
# Converts hash and nil to an options object
|
234
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
235
|
+
|
236
|
+
# Customize the options with defaults
|
237
|
+
metadata = @config.rpcs.list_docker_images.metadata.to_h
|
238
|
+
|
239
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
240
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
241
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
242
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
243
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
244
|
+
|
245
|
+
header_params = {}
|
246
|
+
if request.parent
|
247
|
+
header_params["parent"] = request.parent
|
248
|
+
end
|
249
|
+
|
250
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
251
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
252
|
+
|
253
|
+
options.apply_defaults timeout: @config.rpcs.list_docker_images.timeout,
|
254
|
+
metadata: metadata,
|
255
|
+
retry_policy: @config.rpcs.list_docker_images.retry_policy
|
256
|
+
|
257
|
+
options.apply_defaults timeout: @config.timeout,
|
258
|
+
metadata: @config.metadata,
|
259
|
+
retry_policy: @config.retry_policy
|
260
|
+
|
261
|
+
@artifact_registry_stub.call_rpc :list_docker_images, request, options: options do |response, operation|
|
262
|
+
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_docker_images, request, response, operation, options
|
263
|
+
yield response, operation if block_given?
|
264
|
+
return response
|
265
|
+
end
|
266
|
+
rescue ::GRPC::BadStatus => e
|
267
|
+
raise ::Google::Cloud::Error.from_error(e)
|
268
|
+
end
|
269
|
+
|
270
|
+
##
|
271
|
+
# Gets a docker image.
|
272
|
+
#
|
273
|
+
# @overload get_docker_image(request, options = nil)
|
274
|
+
# Pass arguments to `get_docker_image` via a request object, either of type
|
275
|
+
# {::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest} or an equivalent Hash.
|
276
|
+
#
|
277
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest, ::Hash]
|
278
|
+
# A request object representing the call parameters. Required. To specify no
|
279
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
280
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
281
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
282
|
+
#
|
283
|
+
# @overload get_docker_image(name: nil)
|
284
|
+
# Pass arguments to `get_docker_image` via keyword arguments. Note that at
|
285
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
286
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
287
|
+
#
|
288
|
+
# @param name [::String]
|
289
|
+
# Required. The name of the docker images.
|
290
|
+
#
|
291
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
292
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::DockerImage]
|
293
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
294
|
+
#
|
295
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::DockerImage]
|
296
|
+
#
|
297
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
298
|
+
#
|
299
|
+
# @example Basic example
|
300
|
+
# require "google/cloud/artifact_registry/v1"
|
301
|
+
#
|
302
|
+
# # Create a client object. The client can be reused for multiple calls.
|
303
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
304
|
+
#
|
305
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
306
|
+
# request = Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest.new
|
307
|
+
#
|
308
|
+
# # Call the get_docker_image method.
|
309
|
+
# result = client.get_docker_image request
|
310
|
+
#
|
311
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::DockerImage.
|
312
|
+
# p result
|
313
|
+
#
|
314
|
+
def get_docker_image request, options = nil
|
315
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
316
|
+
|
317
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest
|
318
|
+
|
319
|
+
# Converts hash and nil to an options object
|
320
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
321
|
+
|
322
|
+
# Customize the options with defaults
|
323
|
+
metadata = @config.rpcs.get_docker_image.metadata.to_h
|
324
|
+
|
325
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
326
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
327
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
328
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
329
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
330
|
+
|
331
|
+
header_params = {}
|
332
|
+
if request.name
|
333
|
+
header_params["name"] = request.name
|
334
|
+
end
|
335
|
+
|
336
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
337
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
338
|
+
|
339
|
+
options.apply_defaults timeout: @config.rpcs.get_docker_image.timeout,
|
340
|
+
metadata: metadata,
|
341
|
+
retry_policy: @config.rpcs.get_docker_image.retry_policy
|
342
|
+
|
343
|
+
options.apply_defaults timeout: @config.timeout,
|
344
|
+
metadata: @config.metadata,
|
345
|
+
retry_policy: @config.retry_policy
|
346
|
+
|
347
|
+
@artifact_registry_stub.call_rpc :get_docker_image, request, options: options do |response, operation|
|
348
|
+
yield response, operation if block_given?
|
349
|
+
return response
|
350
|
+
end
|
351
|
+
rescue ::GRPC::BadStatus => e
|
352
|
+
raise ::Google::Cloud::Error.from_error(e)
|
353
|
+
end
|
354
|
+
|
355
|
+
##
|
356
|
+
# Imports Apt artifacts. The returned Operation will complete once the
|
357
|
+
# resources are imported. Package, Version, and File resources are created
|
358
|
+
# based on the imported artifacts. Imported artifacts that conflict with
|
359
|
+
# existing resources are ignored.
|
360
|
+
#
|
361
|
+
# @overload import_apt_artifacts(request, options = nil)
|
362
|
+
# Pass arguments to `import_apt_artifacts` via a request object, either of type
|
363
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest} or an equivalent Hash.
|
364
|
+
#
|
365
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest, ::Hash]
|
366
|
+
# A request object representing the call parameters. Required. To specify no
|
367
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
368
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
369
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
370
|
+
#
|
371
|
+
# @overload import_apt_artifacts(gcs_source: nil, parent: nil)
|
372
|
+
# Pass arguments to `import_apt_artifacts` via keyword arguments. Note that at
|
373
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
374
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
375
|
+
#
|
376
|
+
# @param gcs_source [::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsGcsSource, ::Hash]
|
377
|
+
# Google Cloud Storage location where input content is located.
|
378
|
+
# @param parent [::String]
|
379
|
+
# The name of the parent resource where the artifacts will be imported.
|
380
|
+
#
|
381
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
382
|
+
# @yieldparam response [::Gapic::Operation]
|
383
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
384
|
+
#
|
385
|
+
# @return [::Gapic::Operation]
|
386
|
+
#
|
387
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
388
|
+
#
|
389
|
+
# @example Basic example
|
390
|
+
# require "google/cloud/artifact_registry/v1"
|
391
|
+
#
|
392
|
+
# # Create a client object. The client can be reused for multiple calls.
|
393
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
394
|
+
#
|
395
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
396
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest.new
|
397
|
+
#
|
398
|
+
# # Call the import_apt_artifacts method.
|
399
|
+
# result = client.import_apt_artifacts request
|
400
|
+
#
|
401
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
402
|
+
# # object to check the status of an operation, cancel it, or wait
|
403
|
+
# # for results. Here is how to block until completion:
|
404
|
+
# result.wait_until_done! timeout: 60
|
405
|
+
# if result.response?
|
406
|
+
# p result.response
|
407
|
+
# else
|
408
|
+
# puts "Error!"
|
409
|
+
# end
|
410
|
+
#
|
411
|
+
def import_apt_artifacts request, options = nil
|
412
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
413
|
+
|
414
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest
|
415
|
+
|
416
|
+
# Converts hash and nil to an options object
|
417
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
418
|
+
|
419
|
+
# Customize the options with defaults
|
420
|
+
metadata = @config.rpcs.import_apt_artifacts.metadata.to_h
|
421
|
+
|
422
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
423
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
424
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
425
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
426
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
427
|
+
|
428
|
+
header_params = {}
|
429
|
+
if request.parent
|
430
|
+
header_params["parent"] = request.parent
|
431
|
+
end
|
432
|
+
|
433
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
434
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
435
|
+
|
436
|
+
options.apply_defaults timeout: @config.rpcs.import_apt_artifacts.timeout,
|
437
|
+
metadata: metadata,
|
438
|
+
retry_policy: @config.rpcs.import_apt_artifacts.retry_policy
|
439
|
+
|
440
|
+
options.apply_defaults timeout: @config.timeout,
|
441
|
+
metadata: @config.metadata,
|
442
|
+
retry_policy: @config.retry_policy
|
443
|
+
|
444
|
+
@artifact_registry_stub.call_rpc :import_apt_artifacts, request, options: options do |response, operation|
|
445
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
446
|
+
yield response, operation if block_given?
|
447
|
+
return response
|
448
|
+
end
|
449
|
+
rescue ::GRPC::BadStatus => e
|
450
|
+
raise ::Google::Cloud::Error.from_error(e)
|
451
|
+
end
|
452
|
+
|
453
|
+
##
|
454
|
+
# Imports Yum (RPM) artifacts. The returned Operation will complete once the
|
455
|
+
# resources are imported. Package, Version, and File resources are created
|
456
|
+
# based on the imported artifacts. Imported artifacts that conflict with
|
457
|
+
# existing resources are ignored.
|
458
|
+
#
|
459
|
+
# @overload import_yum_artifacts(request, options = nil)
|
460
|
+
# Pass arguments to `import_yum_artifacts` via a request object, either of type
|
461
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest} or an equivalent Hash.
|
462
|
+
#
|
463
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest, ::Hash]
|
464
|
+
# A request object representing the call parameters. Required. To specify no
|
465
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
466
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
467
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
468
|
+
#
|
469
|
+
# @overload import_yum_artifacts(gcs_source: nil, parent: nil)
|
470
|
+
# Pass arguments to `import_yum_artifacts` via keyword arguments. Note that at
|
471
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
472
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
473
|
+
#
|
474
|
+
# @param gcs_source [::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsGcsSource, ::Hash]
|
475
|
+
# Google Cloud Storage location where input content is located.
|
476
|
+
# @param parent [::String]
|
477
|
+
# The name of the parent resource where the artifacts will be imported.
|
478
|
+
#
|
479
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
480
|
+
# @yieldparam response [::Gapic::Operation]
|
481
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
482
|
+
#
|
483
|
+
# @return [::Gapic::Operation]
|
484
|
+
#
|
485
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
486
|
+
#
|
487
|
+
# @example Basic example
|
488
|
+
# require "google/cloud/artifact_registry/v1"
|
489
|
+
#
|
490
|
+
# # Create a client object. The client can be reused for multiple calls.
|
491
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
492
|
+
#
|
493
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
494
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest.new
|
495
|
+
#
|
496
|
+
# # Call the import_yum_artifacts method.
|
497
|
+
# result = client.import_yum_artifacts request
|
498
|
+
#
|
499
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
500
|
+
# # object to check the status of an operation, cancel it, or wait
|
501
|
+
# # for results. Here is how to block until completion:
|
502
|
+
# result.wait_until_done! timeout: 60
|
503
|
+
# if result.response?
|
504
|
+
# p result.response
|
505
|
+
# else
|
506
|
+
# puts "Error!"
|
507
|
+
# end
|
508
|
+
#
|
509
|
+
def import_yum_artifacts request, options = nil
|
510
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
511
|
+
|
512
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest
|
513
|
+
|
514
|
+
# Converts hash and nil to an options object
|
515
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
516
|
+
|
517
|
+
# Customize the options with defaults
|
518
|
+
metadata = @config.rpcs.import_yum_artifacts.metadata.to_h
|
519
|
+
|
520
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
521
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
522
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
523
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
524
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
525
|
+
|
526
|
+
header_params = {}
|
527
|
+
if request.parent
|
528
|
+
header_params["parent"] = request.parent
|
529
|
+
end
|
530
|
+
|
531
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
532
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
533
|
+
|
534
|
+
options.apply_defaults timeout: @config.rpcs.import_yum_artifacts.timeout,
|
535
|
+
metadata: metadata,
|
536
|
+
retry_policy: @config.rpcs.import_yum_artifacts.retry_policy
|
537
|
+
|
538
|
+
options.apply_defaults timeout: @config.timeout,
|
539
|
+
metadata: @config.metadata,
|
540
|
+
retry_policy: @config.retry_policy
|
541
|
+
|
542
|
+
@artifact_registry_stub.call_rpc :import_yum_artifacts, request, options: options do |response, operation|
|
543
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
544
|
+
yield response, operation if block_given?
|
545
|
+
return response
|
546
|
+
end
|
547
|
+
rescue ::GRPC::BadStatus => e
|
548
|
+
raise ::Google::Cloud::Error.from_error(e)
|
549
|
+
end
|
550
|
+
|
551
|
+
##
|
552
|
+
# Lists repositories.
|
553
|
+
#
|
554
|
+
# @overload list_repositories(request, options = nil)
|
555
|
+
# Pass arguments to `list_repositories` via a request object, either of type
|
556
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest} or an equivalent Hash.
|
557
|
+
#
|
558
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest, ::Hash]
|
559
|
+
# A request object representing the call parameters. Required. To specify no
|
560
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
561
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
562
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
563
|
+
#
|
564
|
+
# @overload list_repositories(parent: nil, page_size: nil, page_token: nil)
|
565
|
+
# Pass arguments to `list_repositories` via keyword arguments. Note that at
|
566
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
567
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
568
|
+
#
|
569
|
+
# @param parent [::String]
|
570
|
+
# Required. The name of the parent resource whose repositories will be listed.
|
571
|
+
# @param page_size [::Integer]
|
572
|
+
# The maximum number of repositories to return. Maximum page size is 1,000.
|
573
|
+
# @param page_token [::String]
|
574
|
+
# The next_page_token value returned from a previous list request, if any.
|
575
|
+
#
|
576
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
577
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
|
578
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
579
|
+
#
|
580
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
|
581
|
+
#
|
582
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
583
|
+
#
|
584
|
+
# @example Basic example
|
585
|
+
# require "google/cloud/artifact_registry/v1"
|
586
|
+
#
|
587
|
+
# # Create a client object. The client can be reused for multiple calls.
|
588
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
589
|
+
#
|
590
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
591
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest.new
|
592
|
+
#
|
593
|
+
# # Call the list_repositories method.
|
594
|
+
# result = client.list_repositories request
|
595
|
+
#
|
596
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
597
|
+
# # iterate over all elements by calling #each, and the enumerable
|
598
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
599
|
+
# # methods are also available for managing paging directly.
|
600
|
+
# result.each do |response|
|
601
|
+
# # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Repository.
|
602
|
+
# p response
|
603
|
+
# end
|
604
|
+
#
|
605
|
+
def list_repositories request, options = nil
|
606
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
607
|
+
|
608
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest
|
609
|
+
|
610
|
+
# Converts hash and nil to an options object
|
611
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
612
|
+
|
613
|
+
# Customize the options with defaults
|
614
|
+
metadata = @config.rpcs.list_repositories.metadata.to_h
|
615
|
+
|
616
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
617
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
618
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
619
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
620
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
621
|
+
|
622
|
+
header_params = {}
|
623
|
+
if request.parent
|
624
|
+
header_params["parent"] = request.parent
|
625
|
+
end
|
626
|
+
|
627
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
628
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
629
|
+
|
630
|
+
options.apply_defaults timeout: @config.rpcs.list_repositories.timeout,
|
631
|
+
metadata: metadata,
|
632
|
+
retry_policy: @config.rpcs.list_repositories.retry_policy
|
633
|
+
|
634
|
+
options.apply_defaults timeout: @config.timeout,
|
635
|
+
metadata: @config.metadata,
|
636
|
+
retry_policy: @config.retry_policy
|
637
|
+
|
638
|
+
@artifact_registry_stub.call_rpc :list_repositories, request, options: options do |response, operation|
|
639
|
+
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_repositories, request, response, operation, options
|
640
|
+
yield response, operation if block_given?
|
641
|
+
return response
|
642
|
+
end
|
643
|
+
rescue ::GRPC::BadStatus => e
|
644
|
+
raise ::Google::Cloud::Error.from_error(e)
|
645
|
+
end
|
646
|
+
|
647
|
+
##
|
648
|
+
# Gets a repository.
|
649
|
+
#
|
650
|
+
# @overload get_repository(request, options = nil)
|
651
|
+
# Pass arguments to `get_repository` via a request object, either of type
|
652
|
+
# {::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest} or an equivalent Hash.
|
653
|
+
#
|
654
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest, ::Hash]
|
655
|
+
# A request object representing the call parameters. Required. To specify no
|
656
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
657
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
658
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
659
|
+
#
|
660
|
+
# @overload get_repository(name: nil)
|
661
|
+
# Pass arguments to `get_repository` via keyword arguments. Note that at
|
662
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
663
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
664
|
+
#
|
665
|
+
# @param name [::String]
|
666
|
+
# Required. The name of the repository to retrieve.
|
667
|
+
#
|
668
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
669
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Repository]
|
670
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
671
|
+
#
|
672
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::Repository]
|
673
|
+
#
|
674
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
675
|
+
#
|
676
|
+
# @example Basic example
|
677
|
+
# require "google/cloud/artifact_registry/v1"
|
678
|
+
#
|
679
|
+
# # Create a client object. The client can be reused for multiple calls.
|
680
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
681
|
+
#
|
682
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
683
|
+
# request = Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest.new
|
684
|
+
#
|
685
|
+
# # Call the get_repository method.
|
686
|
+
# result = client.get_repository request
|
687
|
+
#
|
688
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
|
689
|
+
# p result
|
690
|
+
#
|
691
|
+
def get_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::V1::GetRepositoryRequest
|
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
|
+
metadata = @config.rpcs.get_repository.metadata.to_h
|
701
|
+
|
702
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
703
|
+
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::V1::VERSION
|
706
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
707
|
+
|
708
|
+
header_params = {}
|
709
|
+
if request.name
|
710
|
+
header_params["name"] = request.name
|
711
|
+
end
|
712
|
+
|
713
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
714
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
715
|
+
|
716
|
+
options.apply_defaults timeout: @config.rpcs.get_repository.timeout,
|
717
|
+
metadata: metadata,
|
718
|
+
retry_policy: @config.rpcs.get_repository.retry_policy
|
719
|
+
|
720
|
+
options.apply_defaults timeout: @config.timeout,
|
721
|
+
metadata: @config.metadata,
|
722
|
+
retry_policy: @config.retry_policy
|
723
|
+
|
724
|
+
@artifact_registry_stub.call_rpc :get_repository, request, options: options do |response, operation|
|
725
|
+
yield response, operation if block_given?
|
726
|
+
return response
|
727
|
+
end
|
728
|
+
rescue ::GRPC::BadStatus => e
|
729
|
+
raise ::Google::Cloud::Error.from_error(e)
|
730
|
+
end
|
731
|
+
|
732
|
+
##
|
733
|
+
# Creates a repository. The returned Operation will finish once the
|
734
|
+
# repository has been created. Its response will be the created Repository.
|
735
|
+
#
|
736
|
+
# @overload create_repository(request, options = nil)
|
737
|
+
# Pass arguments to `create_repository` via a request object, either of type
|
738
|
+
# {::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest} or an equivalent Hash.
|
739
|
+
#
|
740
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest, ::Hash]
|
741
|
+
# A request object representing the call parameters. Required. To specify no
|
742
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
743
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
744
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
745
|
+
#
|
746
|
+
# @overload create_repository(parent: nil, repository_id: nil, repository: nil)
|
747
|
+
# Pass arguments to `create_repository` via keyword arguments. Note that at
|
748
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
749
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
750
|
+
#
|
751
|
+
# @param parent [::String]
|
752
|
+
# Required. The name of the parent resource where the repository will be created.
|
753
|
+
# @param repository_id [::String]
|
754
|
+
# The repository id to use for this repository.
|
755
|
+
# @param repository [::Google::Cloud::ArtifactRegistry::V1::Repository, ::Hash]
|
756
|
+
# The repository to be created.
|
757
|
+
#
|
758
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
759
|
+
# @yieldparam response [::Gapic::Operation]
|
760
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
761
|
+
#
|
762
|
+
# @return [::Gapic::Operation]
|
763
|
+
#
|
764
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
765
|
+
#
|
766
|
+
# @example Basic example
|
767
|
+
# require "google/cloud/artifact_registry/v1"
|
768
|
+
#
|
769
|
+
# # Create a client object. The client can be reused for multiple calls.
|
770
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
771
|
+
#
|
772
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
773
|
+
# request = Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest.new
|
774
|
+
#
|
775
|
+
# # Call the create_repository method.
|
776
|
+
# result = client.create_repository request
|
777
|
+
#
|
778
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
779
|
+
# # object to check the status of an operation, cancel it, or wait
|
780
|
+
# # for results. Here is how to block until completion:
|
781
|
+
# result.wait_until_done! timeout: 60
|
782
|
+
# if result.response?
|
783
|
+
# p result.response
|
784
|
+
# else
|
785
|
+
# puts "Error!"
|
786
|
+
# end
|
787
|
+
#
|
788
|
+
def create_repository request, options = nil
|
789
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
790
|
+
|
791
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest
|
792
|
+
|
793
|
+
# Converts hash and nil to an options object
|
794
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
795
|
+
|
796
|
+
# Customize the options with defaults
|
797
|
+
metadata = @config.rpcs.create_repository.metadata.to_h
|
798
|
+
|
799
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
800
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
801
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
802
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
803
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
804
|
+
|
805
|
+
header_params = {}
|
806
|
+
if request.parent
|
807
|
+
header_params["parent"] = request.parent
|
808
|
+
end
|
809
|
+
|
810
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
811
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
812
|
+
|
813
|
+
options.apply_defaults timeout: @config.rpcs.create_repository.timeout,
|
814
|
+
metadata: metadata,
|
815
|
+
retry_policy: @config.rpcs.create_repository.retry_policy
|
816
|
+
|
817
|
+
options.apply_defaults timeout: @config.timeout,
|
818
|
+
metadata: @config.metadata,
|
819
|
+
retry_policy: @config.retry_policy
|
820
|
+
|
821
|
+
@artifact_registry_stub.call_rpc :create_repository, request, options: options do |response, operation|
|
822
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
823
|
+
yield response, operation if block_given?
|
824
|
+
return response
|
825
|
+
end
|
826
|
+
rescue ::GRPC::BadStatus => e
|
827
|
+
raise ::Google::Cloud::Error.from_error(e)
|
828
|
+
end
|
829
|
+
|
830
|
+
##
|
831
|
+
# Updates a repository.
|
832
|
+
#
|
833
|
+
# @overload update_repository(request, options = nil)
|
834
|
+
# Pass arguments to `update_repository` via a request object, either of type
|
835
|
+
# {::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest} or an equivalent Hash.
|
836
|
+
#
|
837
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest, ::Hash]
|
838
|
+
# A request object representing the call parameters. Required. To specify no
|
839
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
840
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
841
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
842
|
+
#
|
843
|
+
# @overload update_repository(repository: nil, update_mask: nil)
|
844
|
+
# Pass arguments to `update_repository` via keyword arguments. Note that at
|
845
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
846
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
847
|
+
#
|
848
|
+
# @param repository [::Google::Cloud::ArtifactRegistry::V1::Repository, ::Hash]
|
849
|
+
# The repository that replaces the resource on the server.
|
850
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
851
|
+
# The update mask applies to the resource. For the `FieldMask` definition,
|
852
|
+
# see
|
853
|
+
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
|
854
|
+
#
|
855
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
856
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Repository]
|
857
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
858
|
+
#
|
859
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::Repository]
|
860
|
+
#
|
861
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
862
|
+
#
|
863
|
+
# @example Basic example
|
864
|
+
# require "google/cloud/artifact_registry/v1"
|
865
|
+
#
|
866
|
+
# # Create a client object. The client can be reused for multiple calls.
|
867
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
868
|
+
#
|
869
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
870
|
+
# request = Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest.new
|
871
|
+
#
|
872
|
+
# # Call the update_repository method.
|
873
|
+
# result = client.update_repository request
|
874
|
+
#
|
875
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
|
876
|
+
# p result
|
877
|
+
#
|
878
|
+
def update_repository request, options = nil
|
879
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
880
|
+
|
881
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest
|
882
|
+
|
883
|
+
# Converts hash and nil to an options object
|
884
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
885
|
+
|
886
|
+
# Customize the options with defaults
|
887
|
+
metadata = @config.rpcs.update_repository.metadata.to_h
|
888
|
+
|
889
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
890
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
891
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
892
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
893
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
894
|
+
|
895
|
+
header_params = {}
|
896
|
+
if request.repository&.name
|
897
|
+
header_params["repository.name"] = request.repository.name
|
898
|
+
end
|
899
|
+
|
900
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
901
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
902
|
+
|
903
|
+
options.apply_defaults timeout: @config.rpcs.update_repository.timeout,
|
904
|
+
metadata: metadata,
|
905
|
+
retry_policy: @config.rpcs.update_repository.retry_policy
|
906
|
+
|
907
|
+
options.apply_defaults timeout: @config.timeout,
|
908
|
+
metadata: @config.metadata,
|
909
|
+
retry_policy: @config.retry_policy
|
910
|
+
|
911
|
+
@artifact_registry_stub.call_rpc :update_repository, request, options: options do |response, operation|
|
912
|
+
yield response, operation if block_given?
|
913
|
+
return response
|
914
|
+
end
|
915
|
+
rescue ::GRPC::BadStatus => e
|
916
|
+
raise ::Google::Cloud::Error.from_error(e)
|
917
|
+
end
|
918
|
+
|
919
|
+
##
|
920
|
+
# Deletes a repository and all of its contents. The returned Operation will
|
921
|
+
# finish once the repository has been deleted. It will not have any Operation
|
922
|
+
# metadata and will return a google.protobuf.Empty response.
|
923
|
+
#
|
924
|
+
# @overload delete_repository(request, options = nil)
|
925
|
+
# Pass arguments to `delete_repository` via a request object, either of type
|
926
|
+
# {::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest} or an equivalent Hash.
|
927
|
+
#
|
928
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest, ::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 delete_repository(name: nil)
|
935
|
+
# Pass arguments to `delete_repository` 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 name [::String]
|
940
|
+
# Required. The name of the repository to delete.
|
941
|
+
#
|
942
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
943
|
+
# @yieldparam response [::Gapic::Operation]
|
944
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
945
|
+
#
|
946
|
+
# @return [::Gapic::Operation]
|
947
|
+
#
|
948
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
949
|
+
#
|
950
|
+
# @example Basic example
|
951
|
+
# require "google/cloud/artifact_registry/v1"
|
952
|
+
#
|
953
|
+
# # Create a client object. The client can be reused for multiple calls.
|
954
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
955
|
+
#
|
956
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
957
|
+
# request = Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest.new
|
958
|
+
#
|
959
|
+
# # Call the delete_repository method.
|
960
|
+
# result = client.delete_repository request
|
961
|
+
#
|
962
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
963
|
+
# # object to check the status of an operation, cancel it, or wait
|
964
|
+
# # for results. Here is how to block until completion:
|
965
|
+
# result.wait_until_done! timeout: 60
|
966
|
+
# if result.response?
|
967
|
+
# p result.response
|
968
|
+
# else
|
969
|
+
# puts "Error!"
|
970
|
+
# end
|
971
|
+
#
|
972
|
+
def delete_repository request, options = nil
|
973
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
974
|
+
|
975
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest
|
976
|
+
|
977
|
+
# Converts hash and nil to an options object
|
978
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
979
|
+
|
980
|
+
# Customize the options with defaults
|
981
|
+
metadata = @config.rpcs.delete_repository.metadata.to_h
|
982
|
+
|
983
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
984
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
985
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
986
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
987
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
988
|
+
|
989
|
+
header_params = {}
|
990
|
+
if request.name
|
991
|
+
header_params["name"] = request.name
|
992
|
+
end
|
993
|
+
|
994
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
995
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
996
|
+
|
997
|
+
options.apply_defaults timeout: @config.rpcs.delete_repository.timeout,
|
998
|
+
metadata: metadata,
|
999
|
+
retry_policy: @config.rpcs.delete_repository.retry_policy
|
1000
|
+
|
1001
|
+
options.apply_defaults timeout: @config.timeout,
|
1002
|
+
metadata: @config.metadata,
|
1003
|
+
retry_policy: @config.retry_policy
|
1004
|
+
|
1005
|
+
@artifact_registry_stub.call_rpc :delete_repository, request, options: options do |response, operation|
|
1006
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1007
|
+
yield response, operation if block_given?
|
1008
|
+
return response
|
1009
|
+
end
|
1010
|
+
rescue ::GRPC::BadStatus => e
|
1011
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1012
|
+
end
|
1013
|
+
|
1014
|
+
##
|
1015
|
+
# Lists packages.
|
1016
|
+
#
|
1017
|
+
# @overload list_packages(request, options = nil)
|
1018
|
+
# Pass arguments to `list_packages` via a request object, either of type
|
1019
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest} or an equivalent Hash.
|
1020
|
+
#
|
1021
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest, ::Hash]
|
1022
|
+
# A request object representing the call parameters. Required. To specify no
|
1023
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1024
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1025
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1026
|
+
#
|
1027
|
+
# @overload list_packages(parent: nil, page_size: nil, page_token: nil)
|
1028
|
+
# Pass arguments to `list_packages` via keyword arguments. Note that at
|
1029
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1030
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1031
|
+
#
|
1032
|
+
# @param parent [::String]
|
1033
|
+
# Required. The name of the parent resource whose packages will be listed.
|
1034
|
+
# @param page_size [::Integer]
|
1035
|
+
# The maximum number of packages to return. Maximum page size is 1,000.
|
1036
|
+
# @param page_token [::String]
|
1037
|
+
# The next_page_token value returned from a previous list request, if any.
|
1038
|
+
#
|
1039
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1040
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>]
|
1041
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1042
|
+
#
|
1043
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>]
|
1044
|
+
#
|
1045
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1046
|
+
#
|
1047
|
+
# @example Basic example
|
1048
|
+
# require "google/cloud/artifact_registry/v1"
|
1049
|
+
#
|
1050
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1051
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1052
|
+
#
|
1053
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1054
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest.new
|
1055
|
+
#
|
1056
|
+
# # Call the list_packages method.
|
1057
|
+
# result = client.list_packages request
|
1058
|
+
#
|
1059
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1060
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1061
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1062
|
+
# # methods are also available for managing paging directly.
|
1063
|
+
# result.each do |response|
|
1064
|
+
# # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Package.
|
1065
|
+
# p response
|
1066
|
+
# end
|
1067
|
+
#
|
1068
|
+
def list_packages request, options = nil
|
1069
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1070
|
+
|
1071
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest
|
1072
|
+
|
1073
|
+
# Converts hash and nil to an options object
|
1074
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1075
|
+
|
1076
|
+
# Customize the options with defaults
|
1077
|
+
metadata = @config.rpcs.list_packages.metadata.to_h
|
1078
|
+
|
1079
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1080
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1081
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1082
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1083
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1084
|
+
|
1085
|
+
header_params = {}
|
1086
|
+
if request.parent
|
1087
|
+
header_params["parent"] = request.parent
|
1088
|
+
end
|
1089
|
+
|
1090
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1091
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1092
|
+
|
1093
|
+
options.apply_defaults timeout: @config.rpcs.list_packages.timeout,
|
1094
|
+
metadata: metadata,
|
1095
|
+
retry_policy: @config.rpcs.list_packages.retry_policy
|
1096
|
+
|
1097
|
+
options.apply_defaults timeout: @config.timeout,
|
1098
|
+
metadata: @config.metadata,
|
1099
|
+
retry_policy: @config.retry_policy
|
1100
|
+
|
1101
|
+
@artifact_registry_stub.call_rpc :list_packages, request, options: options do |response, operation|
|
1102
|
+
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_packages, request, response, operation, options
|
1103
|
+
yield response, operation if block_given?
|
1104
|
+
return response
|
1105
|
+
end
|
1106
|
+
rescue ::GRPC::BadStatus => e
|
1107
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
##
|
1111
|
+
# Gets a package.
|
1112
|
+
#
|
1113
|
+
# @overload get_package(request, options = nil)
|
1114
|
+
# Pass arguments to `get_package` via a request object, either of type
|
1115
|
+
# {::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest} or an equivalent Hash.
|
1116
|
+
#
|
1117
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest, ::Hash]
|
1118
|
+
# A request object representing the call parameters. Required. To specify no
|
1119
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1120
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1121
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1122
|
+
#
|
1123
|
+
# @overload get_package(name: nil)
|
1124
|
+
# Pass arguments to `get_package` via keyword arguments. Note that at
|
1125
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1126
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1127
|
+
#
|
1128
|
+
# @param name [::String]
|
1129
|
+
# Required. The name of the package to retrieve.
|
1130
|
+
#
|
1131
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1132
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Package]
|
1133
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1134
|
+
#
|
1135
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::Package]
|
1136
|
+
#
|
1137
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1138
|
+
#
|
1139
|
+
# @example Basic example
|
1140
|
+
# require "google/cloud/artifact_registry/v1"
|
1141
|
+
#
|
1142
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1143
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1144
|
+
#
|
1145
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1146
|
+
# request = Google::Cloud::ArtifactRegistry::V1::GetPackageRequest.new
|
1147
|
+
#
|
1148
|
+
# # Call the get_package method.
|
1149
|
+
# result = client.get_package request
|
1150
|
+
#
|
1151
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Package.
|
1152
|
+
# p result
|
1153
|
+
#
|
1154
|
+
def get_package request, options = nil
|
1155
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1156
|
+
|
1157
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest
|
1158
|
+
|
1159
|
+
# Converts hash and nil to an options object
|
1160
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1161
|
+
|
1162
|
+
# Customize the options with defaults
|
1163
|
+
metadata = @config.rpcs.get_package.metadata.to_h
|
1164
|
+
|
1165
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1166
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1167
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1168
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1169
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1170
|
+
|
1171
|
+
header_params = {}
|
1172
|
+
if request.name
|
1173
|
+
header_params["name"] = request.name
|
1174
|
+
end
|
1175
|
+
|
1176
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1177
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1178
|
+
|
1179
|
+
options.apply_defaults timeout: @config.rpcs.get_package.timeout,
|
1180
|
+
metadata: metadata,
|
1181
|
+
retry_policy: @config.rpcs.get_package.retry_policy
|
1182
|
+
|
1183
|
+
options.apply_defaults timeout: @config.timeout,
|
1184
|
+
metadata: @config.metadata,
|
1185
|
+
retry_policy: @config.retry_policy
|
1186
|
+
|
1187
|
+
@artifact_registry_stub.call_rpc :get_package, request, options: options do |response, operation|
|
1188
|
+
yield response, operation if block_given?
|
1189
|
+
return response
|
1190
|
+
end
|
1191
|
+
rescue ::GRPC::BadStatus => e
|
1192
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1193
|
+
end
|
1194
|
+
|
1195
|
+
##
|
1196
|
+
# Deletes a package and all of its versions and tags. The returned operation
|
1197
|
+
# will complete once the package has been deleted.
|
1198
|
+
#
|
1199
|
+
# @overload delete_package(request, options = nil)
|
1200
|
+
# Pass arguments to `delete_package` via a request object, either of type
|
1201
|
+
# {::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest} or an equivalent Hash.
|
1202
|
+
#
|
1203
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest, ::Hash]
|
1204
|
+
# A request object representing the call parameters. Required. To specify no
|
1205
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1206
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1207
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1208
|
+
#
|
1209
|
+
# @overload delete_package(name: nil)
|
1210
|
+
# Pass arguments to `delete_package` via keyword arguments. Note that at
|
1211
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1212
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1213
|
+
#
|
1214
|
+
# @param name [::String]
|
1215
|
+
# Required. The name of the package to delete.
|
1216
|
+
#
|
1217
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1218
|
+
# @yieldparam response [::Gapic::Operation]
|
1219
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1220
|
+
#
|
1221
|
+
# @return [::Gapic::Operation]
|
1222
|
+
#
|
1223
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1224
|
+
#
|
1225
|
+
# @example Basic example
|
1226
|
+
# require "google/cloud/artifact_registry/v1"
|
1227
|
+
#
|
1228
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1229
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1230
|
+
#
|
1231
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1232
|
+
# request = Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest.new
|
1233
|
+
#
|
1234
|
+
# # Call the delete_package method.
|
1235
|
+
# result = client.delete_package request
|
1236
|
+
#
|
1237
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1238
|
+
# # object to check the status of an operation, cancel it, or wait
|
1239
|
+
# # for results. Here is how to block until completion:
|
1240
|
+
# result.wait_until_done! timeout: 60
|
1241
|
+
# if result.response?
|
1242
|
+
# p result.response
|
1243
|
+
# else
|
1244
|
+
# puts "Error!"
|
1245
|
+
# end
|
1246
|
+
#
|
1247
|
+
def delete_package request, options = nil
|
1248
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1249
|
+
|
1250
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest
|
1251
|
+
|
1252
|
+
# Converts hash and nil to an options object
|
1253
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1254
|
+
|
1255
|
+
# Customize the options with defaults
|
1256
|
+
metadata = @config.rpcs.delete_package.metadata.to_h
|
1257
|
+
|
1258
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1259
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1260
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1261
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1262
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1263
|
+
|
1264
|
+
header_params = {}
|
1265
|
+
if request.name
|
1266
|
+
header_params["name"] = request.name
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1270
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1271
|
+
|
1272
|
+
options.apply_defaults timeout: @config.rpcs.delete_package.timeout,
|
1273
|
+
metadata: metadata,
|
1274
|
+
retry_policy: @config.rpcs.delete_package.retry_policy
|
1275
|
+
|
1276
|
+
options.apply_defaults timeout: @config.timeout,
|
1277
|
+
metadata: @config.metadata,
|
1278
|
+
retry_policy: @config.retry_policy
|
1279
|
+
|
1280
|
+
@artifact_registry_stub.call_rpc :delete_package, request, options: options do |response, operation|
|
1281
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1282
|
+
yield response, operation if block_given?
|
1283
|
+
return response
|
1284
|
+
end
|
1285
|
+
rescue ::GRPC::BadStatus => e
|
1286
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1287
|
+
end
|
1288
|
+
|
1289
|
+
##
|
1290
|
+
# Lists versions.
|
1291
|
+
#
|
1292
|
+
# @overload list_versions(request, options = nil)
|
1293
|
+
# Pass arguments to `list_versions` via a request object, either of type
|
1294
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest} or an equivalent Hash.
|
1295
|
+
#
|
1296
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest, ::Hash]
|
1297
|
+
# A request object representing the call parameters. Required. To specify no
|
1298
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1299
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1300
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1301
|
+
#
|
1302
|
+
# @overload list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil)
|
1303
|
+
# Pass arguments to `list_versions` via keyword arguments. Note that at
|
1304
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1305
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1306
|
+
#
|
1307
|
+
# @param parent [::String]
|
1308
|
+
# The name of the parent resource whose versions will be listed.
|
1309
|
+
# @param page_size [::Integer]
|
1310
|
+
# The maximum number of versions to return. Maximum page size is 1,000.
|
1311
|
+
# @param page_token [::String]
|
1312
|
+
# The next_page_token value returned from a previous list request, if any.
|
1313
|
+
# @param view [::Google::Cloud::ArtifactRegistry::V1::VersionView]
|
1314
|
+
# The view that should be returned in the response.
|
1315
|
+
# @param order_by [::String]
|
1316
|
+
# Optional. The field to order the results by.
|
1317
|
+
#
|
1318
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1319
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>]
|
1320
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1321
|
+
#
|
1322
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>]
|
1323
|
+
#
|
1324
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1325
|
+
#
|
1326
|
+
# @example Basic example
|
1327
|
+
# require "google/cloud/artifact_registry/v1"
|
1328
|
+
#
|
1329
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1330
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1331
|
+
#
|
1332
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1333
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest.new
|
1334
|
+
#
|
1335
|
+
# # Call the list_versions method.
|
1336
|
+
# result = client.list_versions request
|
1337
|
+
#
|
1338
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1339
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1340
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1341
|
+
# # methods are also available for managing paging directly.
|
1342
|
+
# result.each do |response|
|
1343
|
+
# # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Version.
|
1344
|
+
# p response
|
1345
|
+
# end
|
1346
|
+
#
|
1347
|
+
def list_versions request, options = nil
|
1348
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1349
|
+
|
1350
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest
|
1351
|
+
|
1352
|
+
# Converts hash and nil to an options object
|
1353
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1354
|
+
|
1355
|
+
# Customize the options with defaults
|
1356
|
+
metadata = @config.rpcs.list_versions.metadata.to_h
|
1357
|
+
|
1358
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1359
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1360
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1361
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1362
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1363
|
+
|
1364
|
+
header_params = {}
|
1365
|
+
if request.parent
|
1366
|
+
header_params["parent"] = request.parent
|
1367
|
+
end
|
1368
|
+
|
1369
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1370
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1371
|
+
|
1372
|
+
options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
|
1373
|
+
metadata: metadata,
|
1374
|
+
retry_policy: @config.rpcs.list_versions.retry_policy
|
1375
|
+
|
1376
|
+
options.apply_defaults timeout: @config.timeout,
|
1377
|
+
metadata: @config.metadata,
|
1378
|
+
retry_policy: @config.retry_policy
|
1379
|
+
|
1380
|
+
@artifact_registry_stub.call_rpc :list_versions, request, options: options do |response, operation|
|
1381
|
+
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_versions, request, response, operation, options
|
1382
|
+
yield response, operation if block_given?
|
1383
|
+
return response
|
1384
|
+
end
|
1385
|
+
rescue ::GRPC::BadStatus => e
|
1386
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1387
|
+
end
|
1388
|
+
|
1389
|
+
##
|
1390
|
+
# Gets a version
|
1391
|
+
#
|
1392
|
+
# @overload get_version(request, options = nil)
|
1393
|
+
# Pass arguments to `get_version` via a request object, either of type
|
1394
|
+
# {::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest} or an equivalent Hash.
|
1395
|
+
#
|
1396
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest, ::Hash]
|
1397
|
+
# A request object representing the call parameters. Required. To specify no
|
1398
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1399
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1400
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1401
|
+
#
|
1402
|
+
# @overload get_version(name: nil, view: nil)
|
1403
|
+
# Pass arguments to `get_version` via keyword arguments. Note that at
|
1404
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1405
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1406
|
+
#
|
1407
|
+
# @param name [::String]
|
1408
|
+
# The name of the version to retrieve.
|
1409
|
+
# @param view [::Google::Cloud::ArtifactRegistry::V1::VersionView]
|
1410
|
+
# The view that should be returned in the response.
|
1411
|
+
#
|
1412
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1413
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Version]
|
1414
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1415
|
+
#
|
1416
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::Version]
|
1417
|
+
#
|
1418
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1419
|
+
#
|
1420
|
+
# @example Basic example
|
1421
|
+
# require "google/cloud/artifact_registry/v1"
|
1422
|
+
#
|
1423
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1424
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1425
|
+
#
|
1426
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1427
|
+
# request = Google::Cloud::ArtifactRegistry::V1::GetVersionRequest.new
|
1428
|
+
#
|
1429
|
+
# # Call the get_version method.
|
1430
|
+
# result = client.get_version request
|
1431
|
+
#
|
1432
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Version.
|
1433
|
+
# p result
|
1434
|
+
#
|
1435
|
+
def get_version request, options = nil
|
1436
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1437
|
+
|
1438
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest
|
1439
|
+
|
1440
|
+
# Converts hash and nil to an options object
|
1441
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1442
|
+
|
1443
|
+
# Customize the options with defaults
|
1444
|
+
metadata = @config.rpcs.get_version.metadata.to_h
|
1445
|
+
|
1446
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1447
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1448
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1449
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1450
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1451
|
+
|
1452
|
+
header_params = {}
|
1453
|
+
if request.name
|
1454
|
+
header_params["name"] = request.name
|
1455
|
+
end
|
1456
|
+
|
1457
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1458
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1459
|
+
|
1460
|
+
options.apply_defaults timeout: @config.rpcs.get_version.timeout,
|
1461
|
+
metadata: metadata,
|
1462
|
+
retry_policy: @config.rpcs.get_version.retry_policy
|
1463
|
+
|
1464
|
+
options.apply_defaults timeout: @config.timeout,
|
1465
|
+
metadata: @config.metadata,
|
1466
|
+
retry_policy: @config.retry_policy
|
1467
|
+
|
1468
|
+
@artifact_registry_stub.call_rpc :get_version, request, options: options do |response, operation|
|
1469
|
+
yield response, operation if block_given?
|
1470
|
+
return response
|
1471
|
+
end
|
1472
|
+
rescue ::GRPC::BadStatus => e
|
1473
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
##
|
1477
|
+
# Deletes a version and all of its content. The returned operation will
|
1478
|
+
# complete once the version has been deleted.
|
1479
|
+
#
|
1480
|
+
# @overload delete_version(request, options = nil)
|
1481
|
+
# Pass arguments to `delete_version` via a request object, either of type
|
1482
|
+
# {::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest} or an equivalent Hash.
|
1483
|
+
#
|
1484
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest, ::Hash]
|
1485
|
+
# A request object representing the call parameters. Required. To specify no
|
1486
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1487
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1488
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1489
|
+
#
|
1490
|
+
# @overload delete_version(name: nil, force: nil)
|
1491
|
+
# Pass arguments to `delete_version` via keyword arguments. Note that at
|
1492
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1493
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1494
|
+
#
|
1495
|
+
# @param name [::String]
|
1496
|
+
# The name of the version to delete.
|
1497
|
+
# @param force [::Boolean]
|
1498
|
+
# By default, a version that is tagged may not be deleted. If force=true, the
|
1499
|
+
# version and any tags pointing to the version are deleted.
|
1500
|
+
#
|
1501
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1502
|
+
# @yieldparam response [::Gapic::Operation]
|
1503
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1504
|
+
#
|
1505
|
+
# @return [::Gapic::Operation]
|
1506
|
+
#
|
1507
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1508
|
+
#
|
1509
|
+
# @example Basic example
|
1510
|
+
# require "google/cloud/artifact_registry/v1"
|
1511
|
+
#
|
1512
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1513
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1514
|
+
#
|
1515
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1516
|
+
# request = Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest.new
|
1517
|
+
#
|
1518
|
+
# # Call the delete_version method.
|
1519
|
+
# result = client.delete_version request
|
1520
|
+
#
|
1521
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
1522
|
+
# # object to check the status of an operation, cancel it, or wait
|
1523
|
+
# # for results. Here is how to block until completion:
|
1524
|
+
# result.wait_until_done! timeout: 60
|
1525
|
+
# if result.response?
|
1526
|
+
# p result.response
|
1527
|
+
# else
|
1528
|
+
# puts "Error!"
|
1529
|
+
# end
|
1530
|
+
#
|
1531
|
+
def delete_version request, options = nil
|
1532
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1533
|
+
|
1534
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest
|
1535
|
+
|
1536
|
+
# Converts hash and nil to an options object
|
1537
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1538
|
+
|
1539
|
+
# Customize the options with defaults
|
1540
|
+
metadata = @config.rpcs.delete_version.metadata.to_h
|
1541
|
+
|
1542
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1543
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1544
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1545
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1546
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1547
|
+
|
1548
|
+
header_params = {}
|
1549
|
+
if request.name
|
1550
|
+
header_params["name"] = request.name
|
1551
|
+
end
|
1552
|
+
|
1553
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1554
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1555
|
+
|
1556
|
+
options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
|
1557
|
+
metadata: metadata,
|
1558
|
+
retry_policy: @config.rpcs.delete_version.retry_policy
|
1559
|
+
|
1560
|
+
options.apply_defaults timeout: @config.timeout,
|
1561
|
+
metadata: @config.metadata,
|
1562
|
+
retry_policy: @config.retry_policy
|
1563
|
+
|
1564
|
+
@artifact_registry_stub.call_rpc :delete_version, request, options: options do |response, operation|
|
1565
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1566
|
+
yield response, operation if block_given?
|
1567
|
+
return response
|
1568
|
+
end
|
1569
|
+
rescue ::GRPC::BadStatus => e
|
1570
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1571
|
+
end
|
1572
|
+
|
1573
|
+
##
|
1574
|
+
# Lists files.
|
1575
|
+
#
|
1576
|
+
# @overload list_files(request, options = nil)
|
1577
|
+
# Pass arguments to `list_files` via a request object, either of type
|
1578
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest} or an equivalent Hash.
|
1579
|
+
#
|
1580
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest, ::Hash]
|
1581
|
+
# A request object representing the call parameters. Required. To specify no
|
1582
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1583
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1584
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1585
|
+
#
|
1586
|
+
# @overload list_files(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil)
|
1587
|
+
# Pass arguments to `list_files` via keyword arguments. Note that at
|
1588
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1589
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1590
|
+
#
|
1591
|
+
# @param parent [::String]
|
1592
|
+
# The name of the repository whose files will be listed. For example:
|
1593
|
+
# "projects/p1/locations/us-central1/repositories/repo1
|
1594
|
+
# @param filter [::String]
|
1595
|
+
# An expression for filtering the results of the request. Filter rules are
|
1596
|
+
# case insensitive. The fields eligible for filtering are:
|
1597
|
+
#
|
1598
|
+
# * `name`
|
1599
|
+
# * `owner`
|
1600
|
+
#
|
1601
|
+
# An example of using a filter:
|
1602
|
+
#
|
1603
|
+
# * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an
|
1604
|
+
# ID starting with "a/b/".
|
1605
|
+
# * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` -->
|
1606
|
+
# Files owned by the version `1.0` in package `pkg1`.
|
1607
|
+
# @param page_size [::Integer]
|
1608
|
+
# The maximum number of files to return.
|
1609
|
+
# @param page_token [::String]
|
1610
|
+
# The next_page_token value returned from a previous list request, if any.
|
1611
|
+
# @param order_by [::String]
|
1612
|
+
# The field to order the results by.
|
1613
|
+
#
|
1614
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1615
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>]
|
1616
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1617
|
+
#
|
1618
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>]
|
1619
|
+
#
|
1620
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1621
|
+
#
|
1622
|
+
# @example Basic example
|
1623
|
+
# require "google/cloud/artifact_registry/v1"
|
1624
|
+
#
|
1625
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1626
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1627
|
+
#
|
1628
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1629
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ListFilesRequest.new
|
1630
|
+
#
|
1631
|
+
# # Call the list_files method.
|
1632
|
+
# result = client.list_files request
|
1633
|
+
#
|
1634
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1635
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1636
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1637
|
+
# # methods are also available for managing paging directly.
|
1638
|
+
# result.each do |response|
|
1639
|
+
# # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::File.
|
1640
|
+
# p response
|
1641
|
+
# end
|
1642
|
+
#
|
1643
|
+
def list_files request, options = nil
|
1644
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1645
|
+
|
1646
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest
|
1647
|
+
|
1648
|
+
# Converts hash and nil to an options object
|
1649
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1650
|
+
|
1651
|
+
# Customize the options with defaults
|
1652
|
+
metadata = @config.rpcs.list_files.metadata.to_h
|
1653
|
+
|
1654
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1655
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1656
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1657
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1658
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1659
|
+
|
1660
|
+
header_params = {}
|
1661
|
+
if request.parent
|
1662
|
+
header_params["parent"] = request.parent
|
1663
|
+
end
|
1664
|
+
|
1665
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1666
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1667
|
+
|
1668
|
+
options.apply_defaults timeout: @config.rpcs.list_files.timeout,
|
1669
|
+
metadata: metadata,
|
1670
|
+
retry_policy: @config.rpcs.list_files.retry_policy
|
1671
|
+
|
1672
|
+
options.apply_defaults timeout: @config.timeout,
|
1673
|
+
metadata: @config.metadata,
|
1674
|
+
retry_policy: @config.retry_policy
|
1675
|
+
|
1676
|
+
@artifact_registry_stub.call_rpc :list_files, request, options: options do |response, operation|
|
1677
|
+
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_files, request, response, operation, options
|
1678
|
+
yield response, operation if block_given?
|
1679
|
+
return response
|
1680
|
+
end
|
1681
|
+
rescue ::GRPC::BadStatus => e
|
1682
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1683
|
+
end
|
1684
|
+
|
1685
|
+
##
|
1686
|
+
# Gets a file.
|
1687
|
+
#
|
1688
|
+
# @overload get_file(request, options = nil)
|
1689
|
+
# Pass arguments to `get_file` via a request object, either of type
|
1690
|
+
# {::Google::Cloud::ArtifactRegistry::V1::GetFileRequest} or an equivalent Hash.
|
1691
|
+
#
|
1692
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::GetFileRequest, ::Hash]
|
1693
|
+
# A request object representing the call parameters. Required. To specify no
|
1694
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1695
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1696
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1697
|
+
#
|
1698
|
+
# @overload get_file(name: nil)
|
1699
|
+
# Pass arguments to `get_file` via keyword arguments. Note that at
|
1700
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1701
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1702
|
+
#
|
1703
|
+
# @param name [::String]
|
1704
|
+
# The name of the file to retrieve.
|
1705
|
+
#
|
1706
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1707
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::File]
|
1708
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1709
|
+
#
|
1710
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::File]
|
1711
|
+
#
|
1712
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1713
|
+
#
|
1714
|
+
# @example Basic example
|
1715
|
+
# require "google/cloud/artifact_registry/v1"
|
1716
|
+
#
|
1717
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1718
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1719
|
+
#
|
1720
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1721
|
+
# request = Google::Cloud::ArtifactRegistry::V1::GetFileRequest.new
|
1722
|
+
#
|
1723
|
+
# # Call the get_file method.
|
1724
|
+
# result = client.get_file request
|
1725
|
+
#
|
1726
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::File.
|
1727
|
+
# p result
|
1728
|
+
#
|
1729
|
+
def get_file request, options = nil
|
1730
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1731
|
+
|
1732
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetFileRequest
|
1733
|
+
|
1734
|
+
# Converts hash and nil to an options object
|
1735
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1736
|
+
|
1737
|
+
# Customize the options with defaults
|
1738
|
+
metadata = @config.rpcs.get_file.metadata.to_h
|
1739
|
+
|
1740
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1741
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1742
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1743
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1744
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1745
|
+
|
1746
|
+
header_params = {}
|
1747
|
+
if request.name
|
1748
|
+
header_params["name"] = request.name
|
1749
|
+
end
|
1750
|
+
|
1751
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1752
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1753
|
+
|
1754
|
+
options.apply_defaults timeout: @config.rpcs.get_file.timeout,
|
1755
|
+
metadata: metadata,
|
1756
|
+
retry_policy: @config.rpcs.get_file.retry_policy
|
1757
|
+
|
1758
|
+
options.apply_defaults timeout: @config.timeout,
|
1759
|
+
metadata: @config.metadata,
|
1760
|
+
retry_policy: @config.retry_policy
|
1761
|
+
|
1762
|
+
@artifact_registry_stub.call_rpc :get_file, request, options: options do |response, operation|
|
1763
|
+
yield response, operation if block_given?
|
1764
|
+
return response
|
1765
|
+
end
|
1766
|
+
rescue ::GRPC::BadStatus => e
|
1767
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1768
|
+
end
|
1769
|
+
|
1770
|
+
##
|
1771
|
+
# Lists tags.
|
1772
|
+
#
|
1773
|
+
# @overload list_tags(request, options = nil)
|
1774
|
+
# Pass arguments to `list_tags` via a request object, either of type
|
1775
|
+
# {::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest} or an equivalent Hash.
|
1776
|
+
#
|
1777
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest, ::Hash]
|
1778
|
+
# A request object representing the call parameters. Required. To specify no
|
1779
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1780
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1781
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1782
|
+
#
|
1783
|
+
# @overload list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil)
|
1784
|
+
# Pass arguments to `list_tags` via keyword arguments. Note that at
|
1785
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1786
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1787
|
+
#
|
1788
|
+
# @param parent [::String]
|
1789
|
+
# The name of the parent resource whose tags will be listed.
|
1790
|
+
# @param filter [::String]
|
1791
|
+
# An expression for filtering the results of the request. Filter rules are
|
1792
|
+
# case insensitive. The fields eligible for filtering are:
|
1793
|
+
#
|
1794
|
+
# * `version`
|
1795
|
+
#
|
1796
|
+
# An example of using a filter:
|
1797
|
+
#
|
1798
|
+
# * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"`
|
1799
|
+
# --> Tags that are applied to the version `1.0` in package `pkg1`.
|
1800
|
+
# @param page_size [::Integer]
|
1801
|
+
# The maximum number of tags to return. Maximum page size is 10,000.
|
1802
|
+
# @param page_token [::String]
|
1803
|
+
# The next_page_token value returned from a previous list request, if any.
|
1804
|
+
#
|
1805
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1806
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>]
|
1807
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1808
|
+
#
|
1809
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>]
|
1810
|
+
#
|
1811
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1812
|
+
#
|
1813
|
+
# @example Basic example
|
1814
|
+
# require "google/cloud/artifact_registry/v1"
|
1815
|
+
#
|
1816
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1817
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1818
|
+
#
|
1819
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1820
|
+
# request = Google::Cloud::ArtifactRegistry::V1::ListTagsRequest.new
|
1821
|
+
#
|
1822
|
+
# # Call the list_tags method.
|
1823
|
+
# result = client.list_tags request
|
1824
|
+
#
|
1825
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1826
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1827
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1828
|
+
# # methods are also available for managing paging directly.
|
1829
|
+
# result.each do |response|
|
1830
|
+
# # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Tag.
|
1831
|
+
# p response
|
1832
|
+
# end
|
1833
|
+
#
|
1834
|
+
def list_tags request, options = nil
|
1835
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1836
|
+
|
1837
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest
|
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
|
+
metadata = @config.rpcs.list_tags.metadata.to_h
|
1844
|
+
|
1845
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1846
|
+
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::V1::VERSION
|
1849
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1850
|
+
|
1851
|
+
header_params = {}
|
1852
|
+
if request.parent
|
1853
|
+
header_params["parent"] = request.parent
|
1854
|
+
end
|
1855
|
+
|
1856
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1857
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1858
|
+
|
1859
|
+
options.apply_defaults timeout: @config.rpcs.list_tags.timeout,
|
1860
|
+
metadata: metadata,
|
1861
|
+
retry_policy: @config.rpcs.list_tags.retry_policy
|
1862
|
+
|
1863
|
+
options.apply_defaults timeout: @config.timeout,
|
1864
|
+
metadata: @config.metadata,
|
1865
|
+
retry_policy: @config.retry_policy
|
1866
|
+
|
1867
|
+
@artifact_registry_stub.call_rpc :list_tags, request, options: options do |response, operation|
|
1868
|
+
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_tags, request, response, operation, options
|
1869
|
+
yield response, operation if block_given?
|
1870
|
+
return response
|
1871
|
+
end
|
1872
|
+
rescue ::GRPC::BadStatus => e
|
1873
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1874
|
+
end
|
1875
|
+
|
1876
|
+
##
|
1877
|
+
# Gets a tag.
|
1878
|
+
#
|
1879
|
+
# @overload get_tag(request, options = nil)
|
1880
|
+
# Pass arguments to `get_tag` via a request object, either of type
|
1881
|
+
# {::Google::Cloud::ArtifactRegistry::V1::GetTagRequest} or an equivalent Hash.
|
1882
|
+
#
|
1883
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::GetTagRequest, ::Hash]
|
1884
|
+
# A request object representing the call parameters. Required. To specify no
|
1885
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1886
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1887
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1888
|
+
#
|
1889
|
+
# @overload get_tag(name: nil)
|
1890
|
+
# Pass arguments to `get_tag` via keyword arguments. Note that at
|
1891
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1892
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1893
|
+
#
|
1894
|
+
# @param name [::String]
|
1895
|
+
# The name of the tag to retrieve.
|
1896
|
+
#
|
1897
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1898
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Tag]
|
1899
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1900
|
+
#
|
1901
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::Tag]
|
1902
|
+
#
|
1903
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1904
|
+
#
|
1905
|
+
# @example Basic example
|
1906
|
+
# require "google/cloud/artifact_registry/v1"
|
1907
|
+
#
|
1908
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1909
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1910
|
+
#
|
1911
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1912
|
+
# request = Google::Cloud::ArtifactRegistry::V1::GetTagRequest.new
|
1913
|
+
#
|
1914
|
+
# # Call the get_tag method.
|
1915
|
+
# result = client.get_tag request
|
1916
|
+
#
|
1917
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
|
1918
|
+
# p result
|
1919
|
+
#
|
1920
|
+
def get_tag request, options = nil
|
1921
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1922
|
+
|
1923
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetTagRequest
|
1924
|
+
|
1925
|
+
# Converts hash and nil to an options object
|
1926
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1927
|
+
|
1928
|
+
# Customize the options with defaults
|
1929
|
+
metadata = @config.rpcs.get_tag.metadata.to_h
|
1930
|
+
|
1931
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1932
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1933
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1934
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
1935
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1936
|
+
|
1937
|
+
header_params = {}
|
1938
|
+
if request.name
|
1939
|
+
header_params["name"] = request.name
|
1940
|
+
end
|
1941
|
+
|
1942
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1943
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1944
|
+
|
1945
|
+
options.apply_defaults timeout: @config.rpcs.get_tag.timeout,
|
1946
|
+
metadata: metadata,
|
1947
|
+
retry_policy: @config.rpcs.get_tag.retry_policy
|
1948
|
+
|
1949
|
+
options.apply_defaults timeout: @config.timeout,
|
1950
|
+
metadata: @config.metadata,
|
1951
|
+
retry_policy: @config.retry_policy
|
1952
|
+
|
1953
|
+
@artifact_registry_stub.call_rpc :get_tag, request, options: options do |response, operation|
|
1954
|
+
yield response, operation if block_given?
|
1955
|
+
return response
|
1956
|
+
end
|
1957
|
+
rescue ::GRPC::BadStatus => e
|
1958
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1959
|
+
end
|
1960
|
+
|
1961
|
+
##
|
1962
|
+
# Creates a tag.
|
1963
|
+
#
|
1964
|
+
# @overload create_tag(request, options = nil)
|
1965
|
+
# Pass arguments to `create_tag` via a request object, either of type
|
1966
|
+
# {::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest} or an equivalent Hash.
|
1967
|
+
#
|
1968
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest, ::Hash]
|
1969
|
+
# A request object representing the call parameters. Required. To specify no
|
1970
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1971
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1972
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1973
|
+
#
|
1974
|
+
# @overload create_tag(parent: nil, tag_id: nil, tag: nil)
|
1975
|
+
# Pass arguments to `create_tag` via keyword arguments. Note that at
|
1976
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1977
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1978
|
+
#
|
1979
|
+
# @param parent [::String]
|
1980
|
+
# The name of the parent resource where the tag will be created.
|
1981
|
+
# @param tag_id [::String]
|
1982
|
+
# The tag id to use for this repository.
|
1983
|
+
# @param tag [::Google::Cloud::ArtifactRegistry::V1::Tag, ::Hash]
|
1984
|
+
# The tag to be created.
|
1985
|
+
#
|
1986
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1987
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Tag]
|
1988
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1989
|
+
#
|
1990
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::Tag]
|
1991
|
+
#
|
1992
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1993
|
+
#
|
1994
|
+
# @example Basic example
|
1995
|
+
# require "google/cloud/artifact_registry/v1"
|
1996
|
+
#
|
1997
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1998
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
1999
|
+
#
|
2000
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2001
|
+
# request = Google::Cloud::ArtifactRegistry::V1::CreateTagRequest.new
|
2002
|
+
#
|
2003
|
+
# # Call the create_tag method.
|
2004
|
+
# result = client.create_tag request
|
2005
|
+
#
|
2006
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
|
2007
|
+
# p result
|
2008
|
+
#
|
2009
|
+
def create_tag request, options = nil
|
2010
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2011
|
+
|
2012
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest
|
2013
|
+
|
2014
|
+
# Converts hash and nil to an options object
|
2015
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2016
|
+
|
2017
|
+
# Customize the options with defaults
|
2018
|
+
metadata = @config.rpcs.create_tag.metadata.to_h
|
2019
|
+
|
2020
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2021
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2022
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2023
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
2024
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2025
|
+
|
2026
|
+
header_params = {}
|
2027
|
+
if request.parent
|
2028
|
+
header_params["parent"] = request.parent
|
2029
|
+
end
|
2030
|
+
|
2031
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2032
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2033
|
+
|
2034
|
+
options.apply_defaults timeout: @config.rpcs.create_tag.timeout,
|
2035
|
+
metadata: metadata,
|
2036
|
+
retry_policy: @config.rpcs.create_tag.retry_policy
|
2037
|
+
|
2038
|
+
options.apply_defaults timeout: @config.timeout,
|
2039
|
+
metadata: @config.metadata,
|
2040
|
+
retry_policy: @config.retry_policy
|
2041
|
+
|
2042
|
+
@artifact_registry_stub.call_rpc :create_tag, request, options: options do |response, operation|
|
2043
|
+
yield response, operation if block_given?
|
2044
|
+
return response
|
2045
|
+
end
|
2046
|
+
rescue ::GRPC::BadStatus => e
|
2047
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2048
|
+
end
|
2049
|
+
|
2050
|
+
##
|
2051
|
+
# Updates a tag.
|
2052
|
+
#
|
2053
|
+
# @overload update_tag(request, options = nil)
|
2054
|
+
# Pass arguments to `update_tag` via a request object, either of type
|
2055
|
+
# {::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest} or an equivalent Hash.
|
2056
|
+
#
|
2057
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest, ::Hash]
|
2058
|
+
# A request object representing the call parameters. Required. To specify no
|
2059
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2060
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2061
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2062
|
+
#
|
2063
|
+
# @overload update_tag(tag: nil, update_mask: nil)
|
2064
|
+
# Pass arguments to `update_tag` via keyword arguments. Note that at
|
2065
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2066
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2067
|
+
#
|
2068
|
+
# @param tag [::Google::Cloud::ArtifactRegistry::V1::Tag, ::Hash]
|
2069
|
+
# The tag that replaces the resource on the server.
|
2070
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2071
|
+
# The update mask applies to the resource. For the `FieldMask` definition,
|
2072
|
+
# see
|
2073
|
+
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
|
2074
|
+
#
|
2075
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2076
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Tag]
|
2077
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2078
|
+
#
|
2079
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::Tag]
|
2080
|
+
#
|
2081
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2082
|
+
#
|
2083
|
+
# @example Basic example
|
2084
|
+
# require "google/cloud/artifact_registry/v1"
|
2085
|
+
#
|
2086
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2087
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
2088
|
+
#
|
2089
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2090
|
+
# request = Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest.new
|
2091
|
+
#
|
2092
|
+
# # Call the update_tag method.
|
2093
|
+
# result = client.update_tag request
|
2094
|
+
#
|
2095
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
|
2096
|
+
# p result
|
2097
|
+
#
|
2098
|
+
def update_tag request, options = nil
|
2099
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2100
|
+
|
2101
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest
|
2102
|
+
|
2103
|
+
# Converts hash and nil to an options object
|
2104
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2105
|
+
|
2106
|
+
# Customize the options with defaults
|
2107
|
+
metadata = @config.rpcs.update_tag.metadata.to_h
|
2108
|
+
|
2109
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2110
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2111
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2112
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
2113
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2114
|
+
|
2115
|
+
header_params = {}
|
2116
|
+
if request.tag&.name
|
2117
|
+
header_params["tag.name"] = request.tag.name
|
2118
|
+
end
|
2119
|
+
|
2120
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2121
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2122
|
+
|
2123
|
+
options.apply_defaults timeout: @config.rpcs.update_tag.timeout,
|
2124
|
+
metadata: metadata,
|
2125
|
+
retry_policy: @config.rpcs.update_tag.retry_policy
|
2126
|
+
|
2127
|
+
options.apply_defaults timeout: @config.timeout,
|
2128
|
+
metadata: @config.metadata,
|
2129
|
+
retry_policy: @config.retry_policy
|
2130
|
+
|
2131
|
+
@artifact_registry_stub.call_rpc :update_tag, request, options: options do |response, operation|
|
2132
|
+
yield response, operation if block_given?
|
2133
|
+
return response
|
2134
|
+
end
|
2135
|
+
rescue ::GRPC::BadStatus => e
|
2136
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2137
|
+
end
|
2138
|
+
|
2139
|
+
##
|
2140
|
+
# Deletes a tag.
|
2141
|
+
#
|
2142
|
+
# @overload delete_tag(request, options = nil)
|
2143
|
+
# Pass arguments to `delete_tag` via a request object, either of type
|
2144
|
+
# {::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest} or an equivalent Hash.
|
2145
|
+
#
|
2146
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest, ::Hash]
|
2147
|
+
# A request object representing the call parameters. Required. To specify no
|
2148
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2149
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2150
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2151
|
+
#
|
2152
|
+
# @overload delete_tag(name: nil)
|
2153
|
+
# Pass arguments to `delete_tag` via keyword arguments. Note that at
|
2154
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2155
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2156
|
+
#
|
2157
|
+
# @param name [::String]
|
2158
|
+
# The name of the tag to delete.
|
2159
|
+
#
|
2160
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2161
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
2162
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2163
|
+
#
|
2164
|
+
# @return [::Google::Protobuf::Empty]
|
2165
|
+
#
|
2166
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2167
|
+
#
|
2168
|
+
# @example Basic example
|
2169
|
+
# require "google/cloud/artifact_registry/v1"
|
2170
|
+
#
|
2171
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2172
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
2173
|
+
#
|
2174
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2175
|
+
# request = Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest.new
|
2176
|
+
#
|
2177
|
+
# # Call the delete_tag method.
|
2178
|
+
# result = client.delete_tag request
|
2179
|
+
#
|
2180
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
2181
|
+
# p result
|
2182
|
+
#
|
2183
|
+
def delete_tag request, options = nil
|
2184
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2185
|
+
|
2186
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest
|
2187
|
+
|
2188
|
+
# Converts hash and nil to an options object
|
2189
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2190
|
+
|
2191
|
+
# Customize the options with defaults
|
2192
|
+
metadata = @config.rpcs.delete_tag.metadata.to_h
|
2193
|
+
|
2194
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2195
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2196
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2197
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
2198
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2199
|
+
|
2200
|
+
header_params = {}
|
2201
|
+
if request.name
|
2202
|
+
header_params["name"] = request.name
|
2203
|
+
end
|
2204
|
+
|
2205
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2206
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2207
|
+
|
2208
|
+
options.apply_defaults timeout: @config.rpcs.delete_tag.timeout,
|
2209
|
+
metadata: metadata,
|
2210
|
+
retry_policy: @config.rpcs.delete_tag.retry_policy
|
2211
|
+
|
2212
|
+
options.apply_defaults timeout: @config.timeout,
|
2213
|
+
metadata: @config.metadata,
|
2214
|
+
retry_policy: @config.retry_policy
|
2215
|
+
|
2216
|
+
@artifact_registry_stub.call_rpc :delete_tag, request, options: options do |response, operation|
|
2217
|
+
yield response, operation if block_given?
|
2218
|
+
return response
|
2219
|
+
end
|
2220
|
+
rescue ::GRPC::BadStatus => e
|
2221
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2222
|
+
end
|
2223
|
+
|
2224
|
+
##
|
2225
|
+
# Updates the IAM policy for a given resource.
|
2226
|
+
#
|
2227
|
+
# @overload set_iam_policy(request, options = nil)
|
2228
|
+
# Pass arguments to `set_iam_policy` via a request object, either of type
|
2229
|
+
# {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
|
2230
|
+
#
|
2231
|
+
# @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
|
2232
|
+
# A request object representing the call parameters. Required. To specify no
|
2233
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2234
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2235
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2236
|
+
#
|
2237
|
+
# @overload set_iam_policy(resource: nil, policy: nil)
|
2238
|
+
# Pass arguments to `set_iam_policy` via keyword arguments. Note that at
|
2239
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2240
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2241
|
+
#
|
2242
|
+
# @param resource [::String]
|
2243
|
+
# REQUIRED: The resource for which the policy is being specified.
|
2244
|
+
# See the operation documentation for the appropriate value for this field.
|
2245
|
+
# @param policy [::Google::Iam::V1::Policy, ::Hash]
|
2246
|
+
# REQUIRED: The complete policy to be applied to the `resource`. The size of
|
2247
|
+
# the policy is limited to a few 10s of KB. An empty policy is a
|
2248
|
+
# valid policy but certain Cloud Platform services (such as Projects)
|
2249
|
+
# might reject them.
|
2250
|
+
#
|
2251
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2252
|
+
# @yieldparam response [::Google::Iam::V1::Policy]
|
2253
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2254
|
+
#
|
2255
|
+
# @return [::Google::Iam::V1::Policy]
|
2256
|
+
#
|
2257
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2258
|
+
#
|
2259
|
+
# @example Basic example
|
2260
|
+
# require "google/cloud/artifact_registry/v1"
|
2261
|
+
#
|
2262
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2263
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
2264
|
+
#
|
2265
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2266
|
+
# request = Google::Iam::V1::SetIamPolicyRequest.new
|
2267
|
+
#
|
2268
|
+
# # Call the set_iam_policy method.
|
2269
|
+
# result = client.set_iam_policy request
|
2270
|
+
#
|
2271
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
2272
|
+
# p result
|
2273
|
+
#
|
2274
|
+
def set_iam_policy request, options = nil
|
2275
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2276
|
+
|
2277
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
|
2278
|
+
|
2279
|
+
# Converts hash and nil to an options object
|
2280
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2281
|
+
|
2282
|
+
# Customize the options with defaults
|
2283
|
+
metadata = @config.rpcs.set_iam_policy.metadata.to_h
|
2284
|
+
|
2285
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2286
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2287
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2288
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
2289
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2290
|
+
|
2291
|
+
header_params = {}
|
2292
|
+
if request.resource
|
2293
|
+
header_params["resource"] = request.resource
|
2294
|
+
end
|
2295
|
+
|
2296
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2297
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2298
|
+
|
2299
|
+
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
2300
|
+
metadata: metadata,
|
2301
|
+
retry_policy: @config.rpcs.set_iam_policy.retry_policy
|
2302
|
+
|
2303
|
+
options.apply_defaults timeout: @config.timeout,
|
2304
|
+
metadata: @config.metadata,
|
2305
|
+
retry_policy: @config.retry_policy
|
2306
|
+
|
2307
|
+
@artifact_registry_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
2308
|
+
yield response, operation if block_given?
|
2309
|
+
return response
|
2310
|
+
end
|
2311
|
+
rescue ::GRPC::BadStatus => e
|
2312
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2313
|
+
end
|
160
2314
|
|
161
2315
|
##
|
162
|
-
#
|
2316
|
+
# Gets the IAM policy for a given resource.
|
163
2317
|
#
|
164
|
-
# @overload
|
165
|
-
# Pass arguments to `
|
166
|
-
# {::Google::
|
2318
|
+
# @overload get_iam_policy(request, options = nil)
|
2319
|
+
# Pass arguments to `get_iam_policy` via a request object, either of type
|
2320
|
+
# {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
|
167
2321
|
#
|
168
|
-
# @param request [::Google::
|
2322
|
+
# @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
|
169
2323
|
# A request object representing the call parameters. Required. To specify no
|
170
2324
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
171
2325
|
# @param options [::Gapic::CallOptions, ::Hash]
|
172
2326
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
173
2327
|
#
|
174
|
-
# @overload
|
175
|
-
# Pass arguments to `
|
2328
|
+
# @overload get_iam_policy(resource: nil, options: nil)
|
2329
|
+
# Pass arguments to `get_iam_policy` via keyword arguments. Note that at
|
176
2330
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
177
2331
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
178
2332
|
#
|
179
|
-
# @param
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
2333
|
+
# @param resource [::String]
|
2334
|
+
# REQUIRED: The resource for which the policy is being requested.
|
2335
|
+
# See the operation documentation for the appropriate value for this field.
|
2336
|
+
# @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
|
2337
|
+
# OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
2338
|
+
# `GetIamPolicy`. This field is only used by Cloud IAM.
|
185
2339
|
#
|
186
2340
|
# @yield [response, operation] Access the result along with the RPC operation
|
187
|
-
# @yieldparam response [::
|
2341
|
+
# @yieldparam response [::Google::Iam::V1::Policy]
|
188
2342
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
189
2343
|
#
|
190
|
-
# @return [::
|
2344
|
+
# @return [::Google::Iam::V1::Policy]
|
191
2345
|
#
|
192
2346
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
193
2347
|
#
|
194
|
-
|
2348
|
+
# @example Basic example
|
2349
|
+
# require "google/cloud/artifact_registry/v1"
|
2350
|
+
#
|
2351
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2352
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
2353
|
+
#
|
2354
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2355
|
+
# request = Google::Iam::V1::GetIamPolicyRequest.new
|
2356
|
+
#
|
2357
|
+
# # Call the get_iam_policy method.
|
2358
|
+
# result = client.get_iam_policy request
|
2359
|
+
#
|
2360
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
2361
|
+
# p result
|
2362
|
+
#
|
2363
|
+
def get_iam_policy request, options = nil
|
195
2364
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
196
2365
|
|
197
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::
|
2366
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
|
198
2367
|
|
199
2368
|
# Converts hash and nil to an options object
|
200
2369
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
201
2370
|
|
202
2371
|
# Customize the options with defaults
|
203
|
-
metadata = @config.rpcs.
|
2372
|
+
metadata = @config.rpcs.get_iam_policy.metadata.to_h
|
204
2373
|
|
205
2374
|
# Set x-goog-api-client and x-goog-user-project headers
|
206
2375
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -208,22 +2377,23 @@ module Google
|
|
208
2377
|
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
209
2378
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
210
2379
|
|
211
|
-
header_params = {
|
212
|
-
|
213
|
-
|
2380
|
+
header_params = {}
|
2381
|
+
if request.resource
|
2382
|
+
header_params["resource"] = request.resource
|
2383
|
+
end
|
2384
|
+
|
214
2385
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
215
2386
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
216
2387
|
|
217
|
-
options.apply_defaults timeout: @config.rpcs.
|
2388
|
+
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
218
2389
|
metadata: metadata,
|
219
|
-
retry_policy: @config.rpcs.
|
2390
|
+
retry_policy: @config.rpcs.get_iam_policy.retry_policy
|
220
2391
|
|
221
2392
|
options.apply_defaults timeout: @config.timeout,
|
222
2393
|
metadata: @config.metadata,
|
223
2394
|
retry_policy: @config.retry_policy
|
224
2395
|
|
225
|
-
@artifact_registry_stub.call_rpc :
|
226
|
-
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_docker_images, request, response, operation, options
|
2396
|
+
@artifact_registry_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
227
2397
|
yield response, operation if block_given?
|
228
2398
|
return response
|
229
2399
|
end
|
@@ -232,48 +2402,65 @@ module Google
|
|
232
2402
|
end
|
233
2403
|
|
234
2404
|
##
|
235
|
-
#
|
2405
|
+
# Tests if the caller has a list of permissions on a resource.
|
236
2406
|
#
|
237
|
-
# @overload
|
238
|
-
# Pass arguments to `
|
239
|
-
# {::Google::
|
2407
|
+
# @overload test_iam_permissions(request, options = nil)
|
2408
|
+
# Pass arguments to `test_iam_permissions` via a request object, either of type
|
2409
|
+
# {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
|
240
2410
|
#
|
241
|
-
# @param request [::Google::
|
2411
|
+
# @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
|
242
2412
|
# A request object representing the call parameters. Required. To specify no
|
243
2413
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
244
2414
|
# @param options [::Gapic::CallOptions, ::Hash]
|
245
2415
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
246
2416
|
#
|
247
|
-
# @overload
|
248
|
-
# Pass arguments to `
|
2417
|
+
# @overload test_iam_permissions(resource: nil, permissions: nil)
|
2418
|
+
# Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
|
249
2419
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
250
2420
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
251
2421
|
#
|
252
|
-
# @param
|
253
|
-
#
|
254
|
-
#
|
255
|
-
#
|
256
|
-
#
|
257
|
-
#
|
2422
|
+
# @param resource [::String]
|
2423
|
+
# REQUIRED: The resource for which the policy detail is being requested.
|
2424
|
+
# See the operation documentation for the appropriate value for this field.
|
2425
|
+
# @param permissions [::Array<::String>]
|
2426
|
+
# The set of permissions to check for the `resource`. Permissions with
|
2427
|
+
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
2428
|
+
# information see
|
2429
|
+
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
258
2430
|
#
|
259
2431
|
# @yield [response, operation] Access the result along with the RPC operation
|
260
|
-
# @yieldparam response [::
|
2432
|
+
# @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
|
261
2433
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
262
2434
|
#
|
263
|
-
# @return [::
|
2435
|
+
# @return [::Google::Iam::V1::TestIamPermissionsResponse]
|
264
2436
|
#
|
265
2437
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
266
2438
|
#
|
267
|
-
|
2439
|
+
# @example Basic example
|
2440
|
+
# require "google/cloud/artifact_registry/v1"
|
2441
|
+
#
|
2442
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2443
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
2444
|
+
#
|
2445
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2446
|
+
# request = Google::Iam::V1::TestIamPermissionsRequest.new
|
2447
|
+
#
|
2448
|
+
# # Call the test_iam_permissions method.
|
2449
|
+
# result = client.test_iam_permissions request
|
2450
|
+
#
|
2451
|
+
# # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
|
2452
|
+
# p result
|
2453
|
+
#
|
2454
|
+
def test_iam_permissions request, options = nil
|
268
2455
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
269
2456
|
|
270
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::
|
2457
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
|
271
2458
|
|
272
2459
|
# Converts hash and nil to an options object
|
273
2460
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
274
2461
|
|
275
2462
|
# Customize the options with defaults
|
276
|
-
metadata = @config.rpcs.
|
2463
|
+
metadata = @config.rpcs.test_iam_permissions.metadata.to_h
|
277
2464
|
|
278
2465
|
# Set x-goog-api-client and x-goog-user-project headers
|
279
2466
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -281,22 +2468,23 @@ module Google
|
|
281
2468
|
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
282
2469
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
283
2470
|
|
284
|
-
header_params = {
|
285
|
-
|
286
|
-
|
2471
|
+
header_params = {}
|
2472
|
+
if request.resource
|
2473
|
+
header_params["resource"] = request.resource
|
2474
|
+
end
|
2475
|
+
|
287
2476
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
288
2477
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
289
2478
|
|
290
|
-
options.apply_defaults timeout: @config.rpcs.
|
2479
|
+
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
291
2480
|
metadata: metadata,
|
292
|
-
retry_policy: @config.rpcs.
|
2481
|
+
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
293
2482
|
|
294
2483
|
options.apply_defaults timeout: @config.timeout,
|
295
2484
|
metadata: @config.metadata,
|
296
2485
|
retry_policy: @config.retry_policy
|
297
2486
|
|
298
|
-
@artifact_registry_stub.call_rpc :
|
299
|
-
response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_repositories, request, response, operation, options
|
2487
|
+
@artifact_registry_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
300
2488
|
yield response, operation if block_given?
|
301
2489
|
return response
|
302
2490
|
end
|
@@ -305,44 +2493,59 @@ module Google
|
|
305
2493
|
end
|
306
2494
|
|
307
2495
|
##
|
308
|
-
#
|
2496
|
+
# Retrieves the Settings for the Project.
|
309
2497
|
#
|
310
|
-
# @overload
|
311
|
-
# Pass arguments to `
|
312
|
-
# {::Google::Cloud::ArtifactRegistry::V1::
|
2498
|
+
# @overload get_project_settings(request, options = nil)
|
2499
|
+
# Pass arguments to `get_project_settings` via a request object, either of type
|
2500
|
+
# {::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest} or an equivalent Hash.
|
313
2501
|
#
|
314
|
-
# @param request [::Google::Cloud::ArtifactRegistry::V1::
|
2502
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest, ::Hash]
|
315
2503
|
# A request object representing the call parameters. Required. To specify no
|
316
2504
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
317
2505
|
# @param options [::Gapic::CallOptions, ::Hash]
|
318
2506
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
319
2507
|
#
|
320
|
-
# @overload
|
321
|
-
# Pass arguments to `
|
2508
|
+
# @overload get_project_settings(name: nil)
|
2509
|
+
# Pass arguments to `get_project_settings` via keyword arguments. Note that at
|
322
2510
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
323
2511
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
324
2512
|
#
|
325
2513
|
# @param name [::String]
|
326
|
-
# Required. The name of the
|
2514
|
+
# Required. The name of the projectSettings resource.
|
327
2515
|
#
|
328
2516
|
# @yield [response, operation] Access the result along with the RPC operation
|
329
|
-
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::
|
2517
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
|
330
2518
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
331
2519
|
#
|
332
|
-
# @return [::Google::Cloud::ArtifactRegistry::V1::
|
2520
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
|
333
2521
|
#
|
334
2522
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
335
2523
|
#
|
336
|
-
|
2524
|
+
# @example Basic example
|
2525
|
+
# require "google/cloud/artifact_registry/v1"
|
2526
|
+
#
|
2527
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2528
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
2529
|
+
#
|
2530
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2531
|
+
# request = Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest.new
|
2532
|
+
#
|
2533
|
+
# # Call the get_project_settings method.
|
2534
|
+
# result = client.get_project_settings request
|
2535
|
+
#
|
2536
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
|
2537
|
+
# p result
|
2538
|
+
#
|
2539
|
+
def get_project_settings request, options = nil
|
337
2540
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
338
2541
|
|
339
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::
|
2542
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest
|
340
2543
|
|
341
2544
|
# Converts hash and nil to an options object
|
342
2545
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
343
2546
|
|
344
2547
|
# Customize the options with defaults
|
345
|
-
metadata = @config.rpcs.
|
2548
|
+
metadata = @config.rpcs.get_project_settings.metadata.to_h
|
346
2549
|
|
347
2550
|
# Set x-goog-api-client and x-goog-user-project headers
|
348
2551
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -350,21 +2553,110 @@ module Google
|
|
350
2553
|
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
351
2554
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
352
2555
|
|
353
|
-
header_params = {
|
354
|
-
|
355
|
-
|
2556
|
+
header_params = {}
|
2557
|
+
if request.name
|
2558
|
+
header_params["name"] = request.name
|
2559
|
+
end
|
2560
|
+
|
356
2561
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
357
2562
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
358
2563
|
|
359
|
-
options.apply_defaults timeout: @config.rpcs.
|
2564
|
+
options.apply_defaults timeout: @config.rpcs.get_project_settings.timeout,
|
360
2565
|
metadata: metadata,
|
361
|
-
retry_policy: @config.rpcs.
|
2566
|
+
retry_policy: @config.rpcs.get_project_settings.retry_policy
|
362
2567
|
|
363
2568
|
options.apply_defaults timeout: @config.timeout,
|
364
2569
|
metadata: @config.metadata,
|
365
2570
|
retry_policy: @config.retry_policy
|
366
2571
|
|
367
|
-
@artifact_registry_stub.call_rpc :
|
2572
|
+
@artifact_registry_stub.call_rpc :get_project_settings, request, options: options do |response, operation|
|
2573
|
+
yield response, operation if block_given?
|
2574
|
+
return response
|
2575
|
+
end
|
2576
|
+
rescue ::GRPC::BadStatus => e
|
2577
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2578
|
+
end
|
2579
|
+
|
2580
|
+
##
|
2581
|
+
# Updates the Settings for the Project.
|
2582
|
+
#
|
2583
|
+
# @overload update_project_settings(request, options = nil)
|
2584
|
+
# Pass arguments to `update_project_settings` via a request object, either of type
|
2585
|
+
# {::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest} or an equivalent Hash.
|
2586
|
+
#
|
2587
|
+
# @param request [::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest, ::Hash]
|
2588
|
+
# A request object representing the call parameters. Required. To specify no
|
2589
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2590
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2591
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2592
|
+
#
|
2593
|
+
# @overload update_project_settings(project_settings: nil, update_mask: nil)
|
2594
|
+
# Pass arguments to `update_project_settings` via keyword arguments. Note that at
|
2595
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2596
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2597
|
+
#
|
2598
|
+
# @param project_settings [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings, ::Hash]
|
2599
|
+
# The project settings.
|
2600
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2601
|
+
# Field mask to support partial updates.
|
2602
|
+
#
|
2603
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2604
|
+
# @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
|
2605
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2606
|
+
#
|
2607
|
+
# @return [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
|
2608
|
+
#
|
2609
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2610
|
+
#
|
2611
|
+
# @example Basic example
|
2612
|
+
# require "google/cloud/artifact_registry/v1"
|
2613
|
+
#
|
2614
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2615
|
+
# client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
|
2616
|
+
#
|
2617
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2618
|
+
# request = Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest.new
|
2619
|
+
#
|
2620
|
+
# # Call the update_project_settings method.
|
2621
|
+
# result = client.update_project_settings request
|
2622
|
+
#
|
2623
|
+
# # The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
|
2624
|
+
# p result
|
2625
|
+
#
|
2626
|
+
def update_project_settings request, options = nil
|
2627
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2628
|
+
|
2629
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest
|
2630
|
+
|
2631
|
+
# Converts hash and nil to an options object
|
2632
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2633
|
+
|
2634
|
+
# Customize the options with defaults
|
2635
|
+
metadata = @config.rpcs.update_project_settings.metadata.to_h
|
2636
|
+
|
2637
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2638
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2639
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2640
|
+
gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
|
2641
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2642
|
+
|
2643
|
+
header_params = {}
|
2644
|
+
if request.project_settings&.name
|
2645
|
+
header_params["project_settings.name"] = request.project_settings.name
|
2646
|
+
end
|
2647
|
+
|
2648
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2649
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2650
|
+
|
2651
|
+
options.apply_defaults timeout: @config.rpcs.update_project_settings.timeout,
|
2652
|
+
metadata: metadata,
|
2653
|
+
retry_policy: @config.rpcs.update_project_settings.retry_policy
|
2654
|
+
|
2655
|
+
options.apply_defaults timeout: @config.timeout,
|
2656
|
+
metadata: @config.metadata,
|
2657
|
+
retry_policy: @config.retry_policy
|
2658
|
+
|
2659
|
+
@artifact_registry_stub.call_rpc :update_project_settings, request, options: options do |response, operation|
|
368
2660
|
yield response, operation if block_given?
|
369
2661
|
return response
|
370
2662
|
end
|
@@ -513,6 +2805,21 @@ module Google
|
|
513
2805
|
#
|
514
2806
|
attr_reader :list_docker_images
|
515
2807
|
##
|
2808
|
+
# RPC-specific configuration for `get_docker_image`
|
2809
|
+
# @return [::Gapic::Config::Method]
|
2810
|
+
#
|
2811
|
+
attr_reader :get_docker_image
|
2812
|
+
##
|
2813
|
+
# RPC-specific configuration for `import_apt_artifacts`
|
2814
|
+
# @return [::Gapic::Config::Method]
|
2815
|
+
#
|
2816
|
+
attr_reader :import_apt_artifacts
|
2817
|
+
##
|
2818
|
+
# RPC-specific configuration for `import_yum_artifacts`
|
2819
|
+
# @return [::Gapic::Config::Method]
|
2820
|
+
#
|
2821
|
+
attr_reader :import_yum_artifacts
|
2822
|
+
##
|
516
2823
|
# RPC-specific configuration for `list_repositories`
|
517
2824
|
# @return [::Gapic::Config::Method]
|
518
2825
|
#
|
@@ -522,15 +2829,168 @@ module Google
|
|
522
2829
|
# @return [::Gapic::Config::Method]
|
523
2830
|
#
|
524
2831
|
attr_reader :get_repository
|
2832
|
+
##
|
2833
|
+
# RPC-specific configuration for `create_repository`
|
2834
|
+
# @return [::Gapic::Config::Method]
|
2835
|
+
#
|
2836
|
+
attr_reader :create_repository
|
2837
|
+
##
|
2838
|
+
# RPC-specific configuration for `update_repository`
|
2839
|
+
# @return [::Gapic::Config::Method]
|
2840
|
+
#
|
2841
|
+
attr_reader :update_repository
|
2842
|
+
##
|
2843
|
+
# RPC-specific configuration for `delete_repository`
|
2844
|
+
# @return [::Gapic::Config::Method]
|
2845
|
+
#
|
2846
|
+
attr_reader :delete_repository
|
2847
|
+
##
|
2848
|
+
# RPC-specific configuration for `list_packages`
|
2849
|
+
# @return [::Gapic::Config::Method]
|
2850
|
+
#
|
2851
|
+
attr_reader :list_packages
|
2852
|
+
##
|
2853
|
+
# RPC-specific configuration for `get_package`
|
2854
|
+
# @return [::Gapic::Config::Method]
|
2855
|
+
#
|
2856
|
+
attr_reader :get_package
|
2857
|
+
##
|
2858
|
+
# RPC-specific configuration for `delete_package`
|
2859
|
+
# @return [::Gapic::Config::Method]
|
2860
|
+
#
|
2861
|
+
attr_reader :delete_package
|
2862
|
+
##
|
2863
|
+
# RPC-specific configuration for `list_versions`
|
2864
|
+
# @return [::Gapic::Config::Method]
|
2865
|
+
#
|
2866
|
+
attr_reader :list_versions
|
2867
|
+
##
|
2868
|
+
# RPC-specific configuration for `get_version`
|
2869
|
+
# @return [::Gapic::Config::Method]
|
2870
|
+
#
|
2871
|
+
attr_reader :get_version
|
2872
|
+
##
|
2873
|
+
# RPC-specific configuration for `delete_version`
|
2874
|
+
# @return [::Gapic::Config::Method]
|
2875
|
+
#
|
2876
|
+
attr_reader :delete_version
|
2877
|
+
##
|
2878
|
+
# RPC-specific configuration for `list_files`
|
2879
|
+
# @return [::Gapic::Config::Method]
|
2880
|
+
#
|
2881
|
+
attr_reader :list_files
|
2882
|
+
##
|
2883
|
+
# RPC-specific configuration for `get_file`
|
2884
|
+
# @return [::Gapic::Config::Method]
|
2885
|
+
#
|
2886
|
+
attr_reader :get_file
|
2887
|
+
##
|
2888
|
+
# RPC-specific configuration for `list_tags`
|
2889
|
+
# @return [::Gapic::Config::Method]
|
2890
|
+
#
|
2891
|
+
attr_reader :list_tags
|
2892
|
+
##
|
2893
|
+
# RPC-specific configuration for `get_tag`
|
2894
|
+
# @return [::Gapic::Config::Method]
|
2895
|
+
#
|
2896
|
+
attr_reader :get_tag
|
2897
|
+
##
|
2898
|
+
# RPC-specific configuration for `create_tag`
|
2899
|
+
# @return [::Gapic::Config::Method]
|
2900
|
+
#
|
2901
|
+
attr_reader :create_tag
|
2902
|
+
##
|
2903
|
+
# RPC-specific configuration for `update_tag`
|
2904
|
+
# @return [::Gapic::Config::Method]
|
2905
|
+
#
|
2906
|
+
attr_reader :update_tag
|
2907
|
+
##
|
2908
|
+
# RPC-specific configuration for `delete_tag`
|
2909
|
+
# @return [::Gapic::Config::Method]
|
2910
|
+
#
|
2911
|
+
attr_reader :delete_tag
|
2912
|
+
##
|
2913
|
+
# RPC-specific configuration for `set_iam_policy`
|
2914
|
+
# @return [::Gapic::Config::Method]
|
2915
|
+
#
|
2916
|
+
attr_reader :set_iam_policy
|
2917
|
+
##
|
2918
|
+
# RPC-specific configuration for `get_iam_policy`
|
2919
|
+
# @return [::Gapic::Config::Method]
|
2920
|
+
#
|
2921
|
+
attr_reader :get_iam_policy
|
2922
|
+
##
|
2923
|
+
# RPC-specific configuration for `test_iam_permissions`
|
2924
|
+
# @return [::Gapic::Config::Method]
|
2925
|
+
#
|
2926
|
+
attr_reader :test_iam_permissions
|
2927
|
+
##
|
2928
|
+
# RPC-specific configuration for `get_project_settings`
|
2929
|
+
# @return [::Gapic::Config::Method]
|
2930
|
+
#
|
2931
|
+
attr_reader :get_project_settings
|
2932
|
+
##
|
2933
|
+
# RPC-specific configuration for `update_project_settings`
|
2934
|
+
# @return [::Gapic::Config::Method]
|
2935
|
+
#
|
2936
|
+
attr_reader :update_project_settings
|
525
2937
|
|
526
2938
|
# @private
|
527
2939
|
def initialize parent_rpcs = nil
|
528
2940
|
list_docker_images_config = parent_rpcs.list_docker_images if parent_rpcs.respond_to? :list_docker_images
|
529
2941
|
@list_docker_images = ::Gapic::Config::Method.new list_docker_images_config
|
2942
|
+
get_docker_image_config = parent_rpcs.get_docker_image if parent_rpcs.respond_to? :get_docker_image
|
2943
|
+
@get_docker_image = ::Gapic::Config::Method.new get_docker_image_config
|
2944
|
+
import_apt_artifacts_config = parent_rpcs.import_apt_artifacts if parent_rpcs.respond_to? :import_apt_artifacts
|
2945
|
+
@import_apt_artifacts = ::Gapic::Config::Method.new import_apt_artifacts_config
|
2946
|
+
import_yum_artifacts_config = parent_rpcs.import_yum_artifacts if parent_rpcs.respond_to? :import_yum_artifacts
|
2947
|
+
@import_yum_artifacts = ::Gapic::Config::Method.new import_yum_artifacts_config
|
530
2948
|
list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories
|
531
2949
|
@list_repositories = ::Gapic::Config::Method.new list_repositories_config
|
532
2950
|
get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository
|
533
2951
|
@get_repository = ::Gapic::Config::Method.new get_repository_config
|
2952
|
+
create_repository_config = parent_rpcs.create_repository if parent_rpcs.respond_to? :create_repository
|
2953
|
+
@create_repository = ::Gapic::Config::Method.new create_repository_config
|
2954
|
+
update_repository_config = parent_rpcs.update_repository if parent_rpcs.respond_to? :update_repository
|
2955
|
+
@update_repository = ::Gapic::Config::Method.new update_repository_config
|
2956
|
+
delete_repository_config = parent_rpcs.delete_repository if parent_rpcs.respond_to? :delete_repository
|
2957
|
+
@delete_repository = ::Gapic::Config::Method.new delete_repository_config
|
2958
|
+
list_packages_config = parent_rpcs.list_packages if parent_rpcs.respond_to? :list_packages
|
2959
|
+
@list_packages = ::Gapic::Config::Method.new list_packages_config
|
2960
|
+
get_package_config = parent_rpcs.get_package if parent_rpcs.respond_to? :get_package
|
2961
|
+
@get_package = ::Gapic::Config::Method.new get_package_config
|
2962
|
+
delete_package_config = parent_rpcs.delete_package if parent_rpcs.respond_to? :delete_package
|
2963
|
+
@delete_package = ::Gapic::Config::Method.new delete_package_config
|
2964
|
+
list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
|
2965
|
+
@list_versions = ::Gapic::Config::Method.new list_versions_config
|
2966
|
+
get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
|
2967
|
+
@get_version = ::Gapic::Config::Method.new get_version_config
|
2968
|
+
delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
|
2969
|
+
@delete_version = ::Gapic::Config::Method.new delete_version_config
|
2970
|
+
list_files_config = parent_rpcs.list_files if parent_rpcs.respond_to? :list_files
|
2971
|
+
@list_files = ::Gapic::Config::Method.new list_files_config
|
2972
|
+
get_file_config = parent_rpcs.get_file if parent_rpcs.respond_to? :get_file
|
2973
|
+
@get_file = ::Gapic::Config::Method.new get_file_config
|
2974
|
+
list_tags_config = parent_rpcs.list_tags if parent_rpcs.respond_to? :list_tags
|
2975
|
+
@list_tags = ::Gapic::Config::Method.new list_tags_config
|
2976
|
+
get_tag_config = parent_rpcs.get_tag if parent_rpcs.respond_to? :get_tag
|
2977
|
+
@get_tag = ::Gapic::Config::Method.new get_tag_config
|
2978
|
+
create_tag_config = parent_rpcs.create_tag if parent_rpcs.respond_to? :create_tag
|
2979
|
+
@create_tag = ::Gapic::Config::Method.new create_tag_config
|
2980
|
+
update_tag_config = parent_rpcs.update_tag if parent_rpcs.respond_to? :update_tag
|
2981
|
+
@update_tag = ::Gapic::Config::Method.new update_tag_config
|
2982
|
+
delete_tag_config = parent_rpcs.delete_tag if parent_rpcs.respond_to? :delete_tag
|
2983
|
+
@delete_tag = ::Gapic::Config::Method.new delete_tag_config
|
2984
|
+
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
2985
|
+
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
2986
|
+
get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
|
2987
|
+
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
2988
|
+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
2989
|
+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
2990
|
+
get_project_settings_config = parent_rpcs.get_project_settings if parent_rpcs.respond_to? :get_project_settings
|
2991
|
+
@get_project_settings = ::Gapic::Config::Method.new get_project_settings_config
|
2992
|
+
update_project_settings_config = parent_rpcs.update_project_settings if parent_rpcs.respond_to? :update_project_settings
|
2993
|
+
@update_project_settings = ::Gapic::Config::Method.new update_project_settings_config
|
534
2994
|
|
535
2995
|
yield self if block_given?
|
536
2996
|
end
|