Class: Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/artifact_registry/v1beta2/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

#location_path, #project_settings_path, #repository_path, #tag_path

Constructor Details

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

Create a new ArtifactRegistry client object.

Examples:


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

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

Yields:

  • (config)

    Configure the ArtifactRegistry client.

Yield Parameters:



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
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
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 222

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/v1beta2/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.nil? ||
                           (@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
    config.universe_domain = @config.universe_domain
  end

  @artifact_registry_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @artifact_registry_stub.endpoint
    config.universe_domain = @artifact_registry_stub.universe_domain
  end
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)


288
289
290
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 288

def location_client
  @location_client
end

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

Get the associated client for long-running operations.



281
282
283
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 281

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::V1beta2::ArtifactRegistry::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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
172
173
174
175
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 75

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "ArtifactRegistry", "V1beta2"]
    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.rpcs.list_repositories.timeout = 30.0
    default_config.rpcs.list_repositories.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_repository.timeout = 30.0
    default_config.rpcs.get_repository.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_repository.timeout = 30.0

    default_config.rpcs.update_repository.timeout = 30.0

    default_config.rpcs.delete_repository.timeout = 30.0
    default_config.rpcs.delete_repository.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_packages.timeout = 30.0
    default_config.rpcs.list_packages.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_package.timeout = 30.0
    default_config.rpcs.get_package.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_package.timeout = 30.0
    default_config.rpcs.delete_package.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_versions.timeout = 30.0
    default_config.rpcs.list_versions.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_version.timeout = 30.0
    default_config.rpcs.get_version.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_version.timeout = 30.0
    default_config.rpcs.delete_version.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_files.timeout = 30.0
    default_config.rpcs.list_files.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_file.timeout = 30.0
    default_config.rpcs.get_file.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_tags.timeout = 30.0
    default_config.rpcs.list_tags.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_tag.timeout = 30.0
    default_config.rpcs.get_tag.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_tag.timeout = 30.0

    default_config.rpcs.update_tag.timeout = 30.0

    default_config.rpcs.delete_tag.timeout = 30.0
    default_config.rpcs.delete_tag.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_iam_policy.timeout = 30.0
    default_config.rpcs.get_iam_policy.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.test_iam_permissions.timeout = 30.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#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:



192
193
194
195
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 192

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/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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)

      The repository id to use for this repository.

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

      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.



727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 727

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::Tag #create_tag(parent: nil, tag_id: nil, tag: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Tag

Creates a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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::V1beta2::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.



1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1952

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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)

      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.



1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1190

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 913

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 2128

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1475

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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_file(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::File #get_file(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::File

Gets a file.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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)

      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.



1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1671

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1beta2::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.



2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 2316

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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Package #get_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Package

Gets a package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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)

      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.



1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1096

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::ProjectSettings #get_project_settings(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings

Retrieves the Settings for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



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
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 2494

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::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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_repository(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Repository #get_repository(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Repository

Gets a repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 629

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::Tag #get_tag(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Tag

Gets a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1862

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::Version #get_version(name: nil, view: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Version

Gets a version

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Version.
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.



1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1378

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

#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/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 348

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::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 447

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::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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_files(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::File> #list_files(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::File>

Lists files.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::File.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::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)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1584

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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_packages(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Package> #list_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Package>

Lists packages.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::Package.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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)

      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 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.



1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1009

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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_repositories(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Repository> #list_repositories(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Repository>

Lists repositories.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::Repository.
  p item
end

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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.



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 542

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::Tag> #list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Tag>

Lists tags.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::Tag.
  p item
end

Overloads:

  • #list_tags(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Tag>

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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 resource whose tags will be listed.

    • 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.



1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1775

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::Version> #list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Version>

Lists versions.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::Version.
  p item
end

Overloads:

  • #list_versions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1beta2::Version>

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

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1beta2::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::V1beta2::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::V1beta2::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.



1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 1289

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1beta2::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.



2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 2226

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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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/v1beta2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1beta2::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.



2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 2408

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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

#universe_domainString

The effective universe domain

Returns:

  • (String)


202
203
204
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 202

def universe_domain
  @artifact_registry_stub.universe_domain
end

#update_project_settings(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings #update_project_settings(project_settings: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings

Updates the Settings for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::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.



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
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 2582

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::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::Repository #update_repository(repository: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Repository

Updates a repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::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.



818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 818

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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::V1beta2::Tag #update_tag(tag: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1beta2::Tag

Updates a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1beta2"

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

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

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

# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::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.



2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
# File 'lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb', line 2042

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1beta2::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, x-goog-user-project and x-goog-api-version 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::V1beta2::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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