Class: Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb

Overview

Client for the ArtifactRegistry service.

The Artifact Registry API service.

Artifact Registry is an artifact management system for storing artifacts from different package management systems.

The resources managed by this API are:

  • Repositories, which group packages and their data.
  • Packages, which group versions and their tags.
  • Versions, which are specific forms of a package.
  • Tags, which represent alternative names for versions.
  • Files, which contain content and are optionally associated with a Package or Version.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#docker_image_path, #file_path, #location_path, #maven_artifact_path, #npm_package_path, #package_path, #project_settings_path, #python_package_path, #repository_path, #secret_version_path, #tag_path, #version_path, #vpcsc_config_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new ArtifactRegistry client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the ArtifactRegistry client.

Yield Parameters:



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 124

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/devtools/artifactregistry/v1/service_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @artifact_registry_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Client)


185
186
187
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 185

def location_client
  @location_client
end

#operations_client::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Operations (readonly)

Get the associated client for long-running operations.



178
179
180
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 178

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the ArtifactRegistry Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all ArtifactRegistry clients
::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 69

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "ArtifactRegistry", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#batch_delete_versions(request, options = nil) ⇒ ::Gapic::Operation #batch_delete_versions(parent: nil, names: nil, validate_only: nil) ⇒ ::Gapic::Operation

Deletes multiple versions across a repository. The returned operation will complete once the versions have been deleted.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::BatchDeleteVersionsRequest.new

# Call the batch_delete_versions method.
result = client.batch_delete_versions request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #batch_delete_versions(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to batch_delete_versions via a request object, either of type BatchDeleteVersionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::BatchDeleteVersionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #batch_delete_versions(parent: nil, names: nil, validate_only: nil) ⇒ ::Gapic::Operation

    Pass arguments to batch_delete_versions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the repository holding all requested versions.

    • names (::Array<::String>) (defaults to: nil)

      Required. The names of the versions to delete. A maximum of 10000 versions can be deleted in a batch.

    • validate_only (::Boolean) (defaults to: nil)

      If true, the request is performed without deleting data, following AIP-163.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2182

def batch_delete_versions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::BatchDeleteVersionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.batch_delete_versions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.batch_delete_versions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.batch_delete_versions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :batch_delete_versions, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure {|config| ... } ⇒ Client::Configuration

Configure the ArtifactRegistry Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



103
104
105
106
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 103

def configure
  yield @config if block_given?
  @config
end

#create_repository(request, options = nil) ⇒ ::Gapic::Operation #create_repository(parent: nil, repository_id: nil, repository: nil) ⇒ ::Gapic::Operation

Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest.new

# Call the create_repository method.
result = client.create_repository request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_repository(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_repository via a request object, either of type CreateRepositoryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_repository(parent: nil, repository_id: nil, repository: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_repository via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource where the repository will be created.

    • repository_id (::String) (defaults to: nil)

      Required. The repository id to use for this repository.

    • repository (::Google::Cloud::ArtifactRegistry::V1::Repository, ::Hash) (defaults to: nil)

      Required. The repository to be created.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1344

def create_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_repository..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :create_repository, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag #create_tag(parent: nil, tag_id: nil, tag: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

Creates a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::CreateTagRequest.new

# Call the create_tag method.
result = client.create_tag request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
p result

Overloads:

  • #create_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to create_tag via a request object, either of type CreateTagRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_tag(parent: nil, tag_id: nil, tag: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to create_tag via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the parent resource where the tag will be created.

    • tag_id (::String) (defaults to: nil)

      The tag id to use for this repository.

    • tag (::Google::Cloud::ArtifactRegistry::V1::Tag, ::Hash) (defaults to: nil)

      The tag to be created.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2658

def create_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_tag..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :create_tag, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_package(request, options = nil) ⇒ ::Gapic::Operation #delete_package(name: nil) ⇒ ::Gapic::Operation

Deletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest.new

# Call the delete_package method.
result = client.delete_package request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_package(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_package via a request object, either of type DeletePackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_package(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the package to delete.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1801

def delete_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_package..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :delete_package, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_repository(request, options = nil) ⇒ ::Gapic::Operation #delete_repository(name: nil) ⇒ ::Gapic::Operation

Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest.new

# Call the delete_repository method.
result = client.delete_repository request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_repository(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_repository via a request object, either of type DeleteRepositoryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_repository(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_repository via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the repository to delete.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1528

def delete_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_repository..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :delete_repository, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_tag(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_tag(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest.new

# Call the delete_tag method.
result = client.delete_tag request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_tag(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_tag via a request object, either of type DeleteTagRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_tag(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_tag via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The name of the tag to delete.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2832

def delete_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_tag..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :delete_tag, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_version(request, options = nil) ⇒ ::Gapic::Operation #delete_version(name: nil, force: nil) ⇒ ::Gapic::Operation

Deletes a version and all of its content. The returned operation will complete once the version has been deleted.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest.new

# Call the delete_version method.
result = client.delete_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_version(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_version via a request object, either of type DeleteVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_version(name: nil, force: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The name of the version to delete.

    • force (::Boolean) (defaults to: nil)

      By default, a version that is tagged may not be deleted. If force=true, the version and any tags pointing to the version are deleted.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2083

def delete_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_version..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :delete_version, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_docker_image(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage #get_docker_image(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage

Gets a docker image.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest.new

# Call the get_docker_image method.
result = client.get_docker_image request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::DockerImage.
p result

Overloads:

  • #get_docker_image(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage

    Pass arguments to get_docker_image via a request object, either of type GetDockerImageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_docker_image(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage

    Pass arguments to get_docker_image via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the docker images.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 330

def get_docker_image request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_docker_image..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_docker_image.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_docker_image.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_docker_image, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_file(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File #get_file(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File

Gets a file.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetFileRequest.new

# Call the get_file method.
result = client.get_file request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::File.
p result

Overloads:

  • #get_file(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File

    Pass arguments to get_file via a request object, either of type GetFileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetFileRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_file(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File

    Pass arguments to get_file via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the file to retrieve.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2378

def get_file request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetFileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_file..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_file.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_file.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_file, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

Gets the IAM policy for a given resource.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

    • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) (defaults to: nil)

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 3018

def get_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_maven_artifact(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact #get_maven_artifact(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact

Gets a maven artifact.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetMavenArtifactRequest.new

# Call the get_maven_artifact method.
result = client.get_maven_artifact request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::MavenArtifact.
p result

Overloads:

  • #get_maven_artifact(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact

    Pass arguments to get_maven_artifact via a request object, either of type GetMavenArtifactRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetMavenArtifactRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_maven_artifact(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact

    Pass arguments to get_maven_artifact via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the maven artifact.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 510

def get_maven_artifact request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetMavenArtifactRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_maven_artifact..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_maven_artifact.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_maven_artifact.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_maven_artifact, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_npm_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage #get_npm_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage

Gets a npm package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetNpmPackageRequest.new

# Call the get_npm_package method.
result = client.get_npm_package request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::NpmPackage.
p result

Overloads:

  • #get_npm_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage

    Pass arguments to get_npm_package via a request object, either of type GetNpmPackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetNpmPackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_npm_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage

    Pass arguments to get_npm_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the npm package.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 690

def get_npm_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetNpmPackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_npm_package..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_npm_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_npm_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_npm_package, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package #get_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package

Gets a package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetPackageRequest.new

# Call the get_package method.
result = client.get_package request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Package.
p result

Overloads:

  • #get_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package

    Pass arguments to get_package via a request object, either of type GetPackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package

    Pass arguments to get_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the package to retrieve.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1708

def get_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_package..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_package, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_project_settings(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings #get_project_settings(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

Retrieves the Settings for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest.new

# Call the get_project_settings method.
result = client.get_project_settings request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
p result

Overloads:

  • #get_project_settings(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

    Pass arguments to get_project_settings via a request object, either of type GetProjectSettingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_project_settings(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

    Pass arguments to get_project_settings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the projectSettings resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 3194

def get_project_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_project_settings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_project_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_project_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_project_settings, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_python_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage #get_python_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage

Gets a python package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetPythonPackageRequest.new

# Call the get_python_package method.
result = client.get_python_package request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::PythonPackage.
p result

Overloads:

  • #get_python_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage

    Pass arguments to get_python_package via a request object, either of type GetPythonPackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetPythonPackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_python_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage

    Pass arguments to get_python_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the python package.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 870

def get_python_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetPythonPackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_python_package..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_python_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_python_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_python_package, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_repository(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository #get_repository(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

Gets a repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest.new

# Call the get_repository method.
result = client.get_repository request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
p result

Overloads:

  • #get_repository(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

    Pass arguments to get_repository via a request object, either of type GetRepositoryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_repository(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

    Pass arguments to get_repository via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the repository to retrieve.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1246

def get_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_repository..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_repository, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag #get_tag(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

Gets a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetTagRequest.new

# Call the get_tag method.
result = client.get_tag request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
p result

Overloads:

  • #get_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to get_tag via a request object, either of type GetTagRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetTagRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_tag(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to get_tag via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The name of the tag to retrieve.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2569

def get_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_tag..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_tag, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_version(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version #get_version(name: nil, view: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version

Gets a version

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetVersionRequest.new

# Call the get_version method.
result = client.get_version request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Version.
p result

Overloads:

  • #get_version(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version

    Pass arguments to get_version via a request object, either of type GetVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_version(name: nil, view: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version

    Pass arguments to get_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1987

def get_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_version..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_version, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_vpcsc_config(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig #get_vpcsc_config(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

Retrieves the VPCSC Config for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetVPCSCConfigRequest.new

# Call the get_vpcsc_config method.
result = client.get_vpcsc_config request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::VPCSCConfig.
p result

Overloads:

  • #get_vpcsc_config(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

    Pass arguments to get_vpcsc_config via a request object, either of type GetVPCSCConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetVPCSCConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_vpcsc_config(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

    Pass arguments to get_vpcsc_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the VPCSCConfig resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 3366

def get_vpcsc_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetVPCSCConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_vpcsc_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_vpcsc_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_vpcsc_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :get_vpcsc_config, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_apt_artifacts(request, options = nil) ⇒ ::Gapic::Operation #import_apt_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

Imports Apt artifacts. The returned Operation will complete once the resources are imported. Package, Version, and File resources are created based on the imported artifacts. Imported artifacts that conflict with existing resources are ignored.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest.new

# Call the import_apt_artifacts method.
result = client.import_apt_artifacts request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #import_apt_artifacts(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to import_apt_artifacts via a request object, either of type ImportAptArtifactsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #import_apt_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

    Pass arguments to import_apt_artifacts via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 967

def import_apt_artifacts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.import_apt_artifacts..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.import_apt_artifacts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_apt_artifacts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :import_apt_artifacts, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_yum_artifacts(request, options = nil) ⇒ ::Gapic::Operation #import_yum_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

Imports Yum (RPM) artifacts. The returned Operation will complete once the resources are imported. Package, Version, and File resources are created based on the imported artifacts. Imported artifacts that conflict with existing resources are ignored.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest.new

# Call the import_yum_artifacts method.
result = client.import_yum_artifacts request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #import_yum_artifacts(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to import_yum_artifacts via a request object, either of type ImportYumArtifactsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #import_yum_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

    Pass arguments to import_yum_artifacts via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1065

def import_yum_artifacts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.import_yum_artifacts..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.import_yum_artifacts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_yum_artifacts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :import_yum_artifacts, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_docker_images(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage> #list_docker_images(parent: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>

Lists docker images.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest.new

# Call the list_docker_images method.
result = client.list_docker_images request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::DockerImage.
  p item
end

Overloads:

  • #list_docker_images(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>

    Pass arguments to list_docker_images via a request object, either of type ListDockerImagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_docker_images(parent: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>

    Pass arguments to list_docker_images via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose docker images will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • order_by (::String) (defaults to: nil)

      The field to order the results by.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 244

def list_docker_images request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_docker_images..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_docker_images.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_docker_images.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_docker_images, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_docker_images, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_files(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File> #list_files(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>

Lists files.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListFilesRequest.new

# Call the list_files method.
result = client.list_files request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::File.
  p item
end

Overloads:

  • #list_files(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>

    Pass arguments to list_files via a request object, either of type ListFilesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_files(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>

    Pass arguments to list_files via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the repository whose files will be listed. For example: "projects/p1/locations/us-central1/repositories/repo1

    • filter (::String) (defaults to: nil)

      An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • name
      • owner

      An example of using a filter:

      • name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*" --> Files with an ID starting with "a/b/".
      • owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0" --> Files owned by the version 1.0 in package pkg1.
    • page_size (::Integer) (defaults to: nil)

      The maximum number of files to return.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • order_by (::String) (defaults to: nil)

      The field to order the results by.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2292

def list_files request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_files..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_files.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_files.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_files, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_files, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_maven_artifacts(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact> #list_maven_artifacts(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact>

Lists maven artifacts.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListMavenArtifactsRequest.new

# Call the list_maven_artifacts method.
result = client.list_maven_artifacts request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact.
  p item
end

Overloads:

  • #list_maven_artifacts(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact>

    Pass arguments to list_maven_artifacts via a request object, either of type ListMavenArtifactsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListMavenArtifactsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_maven_artifacts(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact>

    Pass arguments to list_maven_artifacts via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose maven artifacts will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 424

def list_maven_artifacts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListMavenArtifactsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_maven_artifacts..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_maven_artifacts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_maven_artifacts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_maven_artifacts, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_maven_artifacts, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_npm_packages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage> #list_npm_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage>

Lists npm packages.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListNpmPackagesRequest.new

# Call the list_npm_packages method.
result = client.list_npm_packages request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::NpmPackage.
  p item
end

Overloads:

  • #list_npm_packages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage>

    Pass arguments to list_npm_packages via a request object, either of type ListNpmPackagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListNpmPackagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_npm_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage>

    Pass arguments to list_npm_packages via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose npm packages will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 604

def list_npm_packages request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListNpmPackagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_npm_packages..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_npm_packages.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_npm_packages.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_npm_packages, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_npm_packages, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_packages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package> #list_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>

Lists packages.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest.new

# Call the list_packages method.
result = client.list_packages request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Package.
  p item
end

Overloads:

  • #list_packages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>

    Pass arguments to list_packages via a request object, either of type ListPackagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>

    Pass arguments to list_packages via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose packages will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of packages to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1622

def list_packages request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_packages..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_packages.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_packages.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_packages, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_packages, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_python_packages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage> #list_python_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage>

Lists python packages.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListPythonPackagesRequest.new

# Call the list_python_packages method.
result = client.list_python_packages request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::PythonPackage.
  p item
end

Overloads:

  • #list_python_packages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage>

    Pass arguments to list_python_packages via a request object, either of type ListPythonPackagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListPythonPackagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_python_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage>

    Pass arguments to list_python_packages via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose python packages will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 784

def list_python_packages request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListPythonPackagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_python_packages..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_python_packages.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_python_packages.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_python_packages, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_python_packages, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_repositories(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository> #list_repositories(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>

Lists repositories.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest.new

# Call the list_repositories method.
result = client.list_repositories request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Repository.
  p item
end

Overloads:

  • #list_repositories(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>

    Pass arguments to list_repositories via a request object, either of type ListRepositoriesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_repositories(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>

    Pass arguments to list_repositories via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose repositories will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of repositories to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1160

def list_repositories request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_repositories..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_repositories.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_repositories.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_repositories, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_repositories, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_tags(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag> #list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>

Lists tags.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListTagsRequest.new

# Call the list_tags method.
result = client.list_tags request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Tag.
  p item
end

Overloads:

  • #list_tags(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>

    Pass arguments to list_tags via a request object, either of type ListTagsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>

    Pass arguments to list_tags via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the parent package whose tags will be listed. For example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1.

    • filter (::String) (defaults to: nil)

      An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • version

      An example of using a filter:

      • version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0" --> Tags that are applied to the version 1.0 in package pkg1.
    • page_size (::Integer) (defaults to: nil)

      The maximum number of tags to return. Maximum page size is 10,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2483

def list_tags request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_tags..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_tags.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_tags.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_tags, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_tags, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_versions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version> #list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>

Lists versions.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest.new

# Call the list_versions method.
result = client.list_versions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Version.
  p item
end

Overloads:

  • #list_versions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>

    Pass arguments to list_versions via a request object, either of type ListVersionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>

    Pass arguments to list_versions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the parent resource whose versions will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of versions to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • view (::Google::Cloud::ArtifactRegistry::V1::VersionView) (defaults to: nil)

      The view that should be returned in the response.

    • order_by (::String) (defaults to: nil)

      Optional. The field to order the results by.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1899

def list_versions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_versions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_versions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_versions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :list_versions, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_versions, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

Updates the IAM policy for a given resource.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

    • policy (::Google::Iam::V1::Policy, ::Hash) (defaults to: nil)

      REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

      paths: "bindings, etag"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2929

def set_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.set_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

Tests if the caller has a list of permissions on a resource.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

Overloads:

  • #test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

    • permissions (::Array<::String>) (defaults to: nil)

      The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 3109

def test_iam_permissions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.test_iam_permissions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.test_iam_permissions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_project_settings(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings #update_project_settings(project_settings: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

Updates the Settings for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest.new

# Call the update_project_settings method.
result = client.update_project_settings request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 3281

def update_project_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_project_settings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.project_settings&.name
    header_params["project_settings.name"] = request.project_settings.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_project_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_project_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :update_project_settings, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_repository(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository #update_repository(repository: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

Updates a repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest.new

# Call the update_repository method.
result = client.update_repository request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 1434

def update_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_repository..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.repository&.name
    header_params["repository.name"] = request.repository.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :update_repository, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag #update_tag(tag: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

Updates a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest.new

# Call the update_tag method.
result = client.update_tag request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 2747

def update_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_tag..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.tag&.name
    header_params["tag.name"] = request.tag.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :update_tag, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_vpcsc_config(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig #update_vpcsc_config(vpcsc_config: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

Updates the VPCSC Config for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateVPCSCConfigRequest.new

# Call the update_vpcsc_config method.
result = client.update_vpcsc_config request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::VPCSCConfig.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb', line 3453

def update_vpcsc_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateVPCSCConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_vpcsc_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.vpcsc_config&.name
    header_params["vpcsc_config.name"] = request.vpcsc_config.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_vpcsc_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_vpcsc_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.call_rpc :update_vpcsc_config, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end