Class ArtifactRegistryClient (1.2.7)

public class ArtifactRegistryClient implements BackgroundResource

Service Description: 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.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DockerImageName name =
       DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]");
   DockerImage response = artifactRegistryClient.getDockerImage(name);
 }
 

Note: close() needs to be called on the ArtifactRegistryClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of ArtifactRegistrySettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ArtifactRegistrySettings artifactRegistrySettings =
     ArtifactRegistrySettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ArtifactRegistryClient artifactRegistryClient =
     ArtifactRegistryClient.create(artifactRegistrySettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ArtifactRegistrySettings artifactRegistrySettings =
     ArtifactRegistrySettings.newBuilder().setEndpoint(myEndpoint).build();
 ArtifactRegistryClient artifactRegistryClient =
     ArtifactRegistryClient.create(artifactRegistrySettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ArtifactRegistrySettings artifactRegistrySettings =
     ArtifactRegistrySettings.newBuilder()
         .setTransportChannelProvider(
             ArtifactRegistrySettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 ArtifactRegistryClient artifactRegistryClient =
     ArtifactRegistryClient.create(artifactRegistrySettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ArtifactRegistryClient

Implements

BackgroundResource

Static Methods

create()

public static final ArtifactRegistryClient create()

Constructs an instance of ArtifactRegistryClient with default settings.

Returns
TypeDescription
ArtifactRegistryClient
Exceptions
TypeDescription
IOException

create(ArtifactRegistrySettings settings)

public static final ArtifactRegistryClient create(ArtifactRegistrySettings settings)

Constructs an instance of ArtifactRegistryClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsArtifactRegistrySettings
Returns
TypeDescription
ArtifactRegistryClient
Exceptions
TypeDescription
IOException

create(ArtifactRegistryStub stub)

public static final ArtifactRegistryClient create(ArtifactRegistryStub stub)

Constructs an instance of ArtifactRegistryClient, using the given stub for making calls. This is for advanced usage - prefer using create(ArtifactRegistrySettings).

Parameter
NameDescription
stubArtifactRegistryStub
Returns
TypeDescription
ArtifactRegistryClient

Constructors

ArtifactRegistryClient(ArtifactRegistrySettings settings)

protected ArtifactRegistryClient(ArtifactRegistrySettings settings)

Constructs an instance of ArtifactRegistryClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsArtifactRegistrySettings

ArtifactRegistryClient(ArtifactRegistryStub stub)

protected ArtifactRegistryClient(ArtifactRegistryStub stub)
Parameter
NameDescription
stubArtifactRegistryStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createRepositoryAsync(CreateRepositoryRequest request)

public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(CreateRepositoryRequest request)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   CreateRepositoryRequest request =
       CreateRepositoryRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setRepositoryId("repositoryId2113747461")
           .setRepository(Repository.newBuilder().build())
           .build();
   Repository response = artifactRegistryClient.createRepositoryAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateRepositoryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Repository,OperationMetadata>

createRepositoryAsync(LocationName parent, Repository repository, String repositoryId)

public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(LocationName parent, Repository repository, String repositoryId)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Repository repository = Repository.newBuilder().build();
   String repositoryId = "repositoryId2113747461";
   Repository response =
       artifactRegistryClient.createRepositoryAsync(parent, repository, repositoryId).get();
 }
 
Parameters
NameDescription
parentLocationName

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

repositoryRepository

The repository to be created.

repositoryIdString

The repository id to use for this repository.

Returns
TypeDescription
OperationFuture<Repository,OperationMetadata>

createRepositoryAsync(String parent, Repository repository, String repositoryId)

public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(String parent, Repository repository, String repositoryId)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Repository repository = Repository.newBuilder().build();
   String repositoryId = "repositoryId2113747461";
   Repository response =
       artifactRegistryClient.createRepositoryAsync(parent, repository, repositoryId).get();
 }
 
Parameters
NameDescription
parentString

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

repositoryRepository

The repository to be created.

repositoryIdString

The repository id to use for this repository.

Returns
TypeDescription
OperationFuture<Repository,OperationMetadata>

createRepositoryCallable()

public final UnaryCallable<CreateRepositoryRequest,Operation> createRepositoryCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   CreateRepositoryRequest request =
       CreateRepositoryRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setRepositoryId("repositoryId2113747461")
           .setRepository(Repository.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       artifactRegistryClient.createRepositoryCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateRepositoryRequest,Operation>

createRepositoryOperationCallable()

public final OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata> createRepositoryOperationCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   CreateRepositoryRequest request =
       CreateRepositoryRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setRepositoryId("repositoryId2113747461")
           .setRepository(Repository.newBuilder().build())
           .build();
   OperationFuture<Repository, OperationMetadata> future =
       artifactRegistryClient.createRepositoryOperationCallable().futureCall(request);
   // Do something.
   Repository response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata>

createTag(CreateTagRequest request)

public final Tag createTag(CreateTagRequest request)

Creates a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   CreateTagRequest request =
       CreateTagRequest.newBuilder()
           .setParent("parent-995424086")
           .setTagId("tagId110119509")
           .setTag(Tag.newBuilder().build())
           .build();
   Tag response = artifactRegistryClient.createTag(request);
 }
 
Parameter
NameDescription
requestCreateTagRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Tag

createTag(String parent, Tag tag, String tagId)

public final Tag createTag(String parent, Tag tag, String tagId)

Creates a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = "parent-995424086";
   Tag tag = Tag.newBuilder().build();
   String tagId = "tagId110119509";
   Tag response = artifactRegistryClient.createTag(parent, tag, tagId);
 }
 
Parameters
NameDescription
parentString

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

tagTag

The tag to be created.

tagIdString

The tag id to use for this repository.

Returns
TypeDescription
Tag

createTagCallable()

public final UnaryCallable<CreateTagRequest,Tag> createTagCallable()

Creates a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   CreateTagRequest request =
       CreateTagRequest.newBuilder()
           .setParent("parent-995424086")
           .setTagId("tagId110119509")
           .setTag(Tag.newBuilder().build())
           .build();
   ApiFuture<Tag> future = artifactRegistryClient.createTagCallable().futureCall(request);
   // Do something.
   Tag response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateTagRequest,Tag>

deletePackageAsync(DeletePackageRequest request)

public final OperationFuture<Empty,OperationMetadata> deletePackageAsync(DeletePackageRequest request)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeletePackageRequest request =
       DeletePackageRequest.newBuilder().setName("name3373707").build();
   artifactRegistryClient.deletePackageAsync(request).get();
 }
 
Parameter
NameDescription
requestDeletePackageRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deletePackageAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deletePackageAsync(String name)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = "name3373707";
   artifactRegistryClient.deletePackageAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The name of the package to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deletePackageCallable()

public final UnaryCallable<DeletePackageRequest,Operation> deletePackageCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeletePackageRequest request =
       DeletePackageRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Operation> future =
       artifactRegistryClient.deletePackageCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeletePackageRequest,Operation>

deletePackageOperationCallable()

public final OperationCallable<DeletePackageRequest,Empty,OperationMetadata> deletePackageOperationCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeletePackageRequest request =
       DeletePackageRequest.newBuilder().setName("name3373707").build();
   OperationFuture<Empty, OperationMetadata> future =
       artifactRegistryClient.deletePackageOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeletePackageRequest,Empty,OperationMetadata>

deleteRepositoryAsync(DeleteRepositoryRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(DeleteRepositoryRequest request)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteRepositoryRequest request =
       DeleteRepositoryRequest.newBuilder()
           .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .build();
   artifactRegistryClient.deleteRepositoryAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteRepositoryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteRepositoryAsync(RepositoryName name)

public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(RepositoryName name)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   RepositoryName name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
   artifactRegistryClient.deleteRepositoryAsync(name).get();
 }
 
Parameter
NameDescription
nameRepositoryName

Required. The name of the repository to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteRepositoryAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(String name)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
   artifactRegistryClient.deleteRepositoryAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The name of the repository to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteRepositoryCallable()

public final UnaryCallable<DeleteRepositoryRequest,Operation> deleteRepositoryCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteRepositoryRequest request =
       DeleteRepositoryRequest.newBuilder()
           .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .build();
   ApiFuture<Operation> future =
       artifactRegistryClient.deleteRepositoryCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteRepositoryRequest,Operation>

deleteRepositoryOperationCallable()

public final OperationCallable<DeleteRepositoryRequest,Empty,OperationMetadata> deleteRepositoryOperationCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteRepositoryRequest request =
       DeleteRepositoryRequest.newBuilder()
           .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       artifactRegistryClient.deleteRepositoryOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteRepositoryRequest,Empty,OperationMetadata>

deleteTag(DeleteTagRequest request)

public final void deleteTag(DeleteTagRequest request)

Deletes a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteTagRequest request = DeleteTagRequest.newBuilder().setName("name3373707").build();
   artifactRegistryClient.deleteTag(request);
 }
 
Parameter
NameDescription
requestDeleteTagRequest

The request object containing all of the parameters for the API call.

deleteTag(String name)

public final void deleteTag(String name)

Deletes a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = "name3373707";
   artifactRegistryClient.deleteTag(name);
 }
 
Parameter
NameDescription
nameString

The name of the tag to delete.

deleteTagCallable()

public final UnaryCallable<DeleteTagRequest,Empty> deleteTagCallable()

Deletes a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteTagRequest request = DeleteTagRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Empty> future = artifactRegistryClient.deleteTagCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteTagRequest,Empty>

deleteVersionAsync(DeleteVersionRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteVersionAsync(DeleteVersionRequest request)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteVersionRequest request =
       DeleteVersionRequest.newBuilder().setName("name3373707").setForce(true).build();
   artifactRegistryClient.deleteVersionAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteVersionRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteVersionAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteVersionAsync(String name)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = "name3373707";
   artifactRegistryClient.deleteVersionAsync(name).get();
 }
 
Parameter
NameDescription
nameString

The name of the version to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteVersionCallable()

public final UnaryCallable<DeleteVersionRequest,Operation> deleteVersionCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteVersionRequest request =
       DeleteVersionRequest.newBuilder().setName("name3373707").setForce(true).build();
   ApiFuture<Operation> future =
       artifactRegistryClient.deleteVersionCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteVersionRequest,Operation>

deleteVersionOperationCallable()

public final OperationCallable<DeleteVersionRequest,Empty,OperationMetadata> deleteVersionOperationCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DeleteVersionRequest request =
       DeleteVersionRequest.newBuilder().setName("name3373707").setForce(true).build();
   OperationFuture<Empty, OperationMetadata> future =
       artifactRegistryClient.deleteVersionOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteVersionRequest,Empty,OperationMetadata>

getDockerImage(DockerImageName name)

public final DockerImage getDockerImage(DockerImageName name)

Gets a docker image.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   DockerImageName name =
       DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]");
   DockerImage response = artifactRegistryClient.getDockerImage(name);
 }
 
Parameter
NameDescription
nameDockerImageName

Required. The name of the docker images.

Returns
TypeDescription
DockerImage

getDockerImage(GetDockerImageRequest request)

public final DockerImage getDockerImage(GetDockerImageRequest request)

Gets a docker image.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetDockerImageRequest request =
       GetDockerImageRequest.newBuilder()
           .setName(
               DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
                   .toString())
           .build();
   DockerImage response = artifactRegistryClient.getDockerImage(request);
 }
 
Parameter
NameDescription
requestGetDockerImageRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DockerImage

getDockerImage(String name)

public final DockerImage getDockerImage(String name)

Gets a docker image.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name =
       DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
           .toString();
   DockerImage response = artifactRegistryClient.getDockerImage(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the docker images.

Returns
TypeDescription
DockerImage

getDockerImageCallable()

public final UnaryCallable<GetDockerImageRequest,DockerImage> getDockerImageCallable()

Gets a docker image.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetDockerImageRequest request =
       GetDockerImageRequest.newBuilder()
           .setName(
               DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
                   .toString())
           .build();
   ApiFuture<DockerImage> future =
       artifactRegistryClient.getDockerImageCallable().futureCall(request);
   // Do something.
   DockerImage response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetDockerImageRequest,DockerImage>

getFile(GetFileRequest request)

public final File getFile(GetFileRequest request)

Gets a file.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetFileRequest request = GetFileRequest.newBuilder().setName("name3373707").build();
   File response = artifactRegistryClient.getFile(request);
 }
 
Parameter
NameDescription
requestGetFileRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
File

getFile(String name)

public final File getFile(String name)

Gets a file.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = "name3373707";
   File response = artifactRegistryClient.getFile(name);
 }
 
Parameter
NameDescription
nameString

The name of the file to retrieve.

Returns
TypeDescription
File

getFileCallable()

public final UnaryCallable<GetFileRequest,File> getFileCallable()

Gets a file.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetFileRequest request = GetFileRequest.newBuilder().setName("name3373707").build();
   ApiFuture<File> future = artifactRegistryClient.getFileCallable().futureCall(request);
   // Do something.
   File response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetFileRequest,File>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the IAM policy for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = artifactRegistryClient.getIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the IAM policy for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future = artifactRegistryClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getPackage(GetPackageRequest request)

public final Package getPackage(GetPackageRequest request)

Gets a package.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetPackageRequest request = GetPackageRequest.newBuilder().setName("name3373707").build();
   Package response = artifactRegistryClient.getPackage(request);
 }
 
Parameter
NameDescription
requestGetPackageRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Package

getPackage(String name)

public final Package getPackage(String name)

Gets a package.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = "name3373707";
   Package response = artifactRegistryClient.getPackage(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the package to retrieve.

Returns
TypeDescription
Package

getPackageCallable()

public final UnaryCallable<GetPackageRequest,Package> getPackageCallable()

Gets a package.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetPackageRequest request = GetPackageRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Package> future = artifactRegistryClient.getPackageCallable().futureCall(request);
   // Do something.
   Package response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetPackageRequest,Package>

getProjectSettings(GetProjectSettingsRequest request)

public final ProjectSettings getProjectSettings(GetProjectSettingsRequest request)

Retrieves the Settings for the Project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetProjectSettingsRequest request =
       GetProjectSettingsRequest.newBuilder()
           .setName(ProjectSettingsName.of("[PROJECT]").toString())
           .build();
   ProjectSettings response = artifactRegistryClient.getProjectSettings(request);
 }
 
Parameter
NameDescription
requestGetProjectSettingsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ProjectSettings

getProjectSettings(ProjectSettingsName name)

public final ProjectSettings getProjectSettings(ProjectSettingsName name)

Retrieves the Settings for the Project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ProjectSettingsName name = ProjectSettingsName.of("[PROJECT]");
   ProjectSettings response = artifactRegistryClient.getProjectSettings(name);
 }
 
Parameter
NameDescription
nameProjectSettingsName

Required. The name of the projectSettings resource.

Returns
TypeDescription
ProjectSettings

getProjectSettings(String name)

public final ProjectSettings getProjectSettings(String name)

Retrieves the Settings for the Project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = ProjectSettingsName.of("[PROJECT]").toString();
   ProjectSettings response = artifactRegistryClient.getProjectSettings(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the projectSettings resource.

Returns
TypeDescription
ProjectSettings

getProjectSettingsCallable()

public final UnaryCallable<GetProjectSettingsRequest,ProjectSettings> getProjectSettingsCallable()

Retrieves the Settings for the Project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetProjectSettingsRequest request =
       GetProjectSettingsRequest.newBuilder()
           .setName(ProjectSettingsName.of("[PROJECT]").toString())
           .build();
   ApiFuture<ProjectSettings> future =
       artifactRegistryClient.getProjectSettingsCallable().futureCall(request);
   // Do something.
   ProjectSettings response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetProjectSettingsRequest,ProjectSettings>

getRepository(GetRepositoryRequest request)

public final Repository getRepository(GetRepositoryRequest request)

Gets a repository.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetRepositoryRequest request =
       GetRepositoryRequest.newBuilder()
           .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .build();
   Repository response = artifactRegistryClient.getRepository(request);
 }
 
Parameter
NameDescription
requestGetRepositoryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Repository

getRepository(RepositoryName name)

public final Repository getRepository(RepositoryName name)

Gets a repository.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   RepositoryName name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
   Repository response = artifactRegistryClient.getRepository(name);
 }
 
Parameter
NameDescription
nameRepositoryName

Required. The name of the repository to retrieve.

Returns
TypeDescription
Repository

getRepository(String name)

public final Repository getRepository(String name)

Gets a repository.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
   Repository response = artifactRegistryClient.getRepository(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the repository to retrieve.

Returns
TypeDescription
Repository

getRepositoryCallable()

public final UnaryCallable<GetRepositoryRequest,Repository> getRepositoryCallable()

Gets a repository.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetRepositoryRequest request =
       GetRepositoryRequest.newBuilder()
           .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .build();
   ApiFuture<Repository> future =
       artifactRegistryClient.getRepositoryCallable().futureCall(request);
   // Do something.
   Repository response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetRepositoryRequest,Repository>

getSettings()

public final ArtifactRegistrySettings getSettings()
Returns
TypeDescription
ArtifactRegistrySettings

getStub()

public ArtifactRegistryStub getStub()
Returns
TypeDescription
ArtifactRegistryStub

getTag(GetTagRequest request)

public final Tag getTag(GetTagRequest request)

Gets a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetTagRequest request = GetTagRequest.newBuilder().setName("name3373707").build();
   Tag response = artifactRegistryClient.getTag(request);
 }
 
Parameter
NameDescription
requestGetTagRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Tag

getTag(String name)

public final Tag getTag(String name)

Gets a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = "name3373707";
   Tag response = artifactRegistryClient.getTag(name);
 }
 
Parameter
NameDescription
nameString

The name of the tag to retrieve.

Returns
TypeDescription
Tag

getTagCallable()

public final UnaryCallable<GetTagRequest,Tag> getTagCallable()

Gets a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetTagRequest request = GetTagRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Tag> future = artifactRegistryClient.getTagCallable().futureCall(request);
   // Do something.
   Tag response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetTagRequest,Tag>

getVersion(GetVersionRequest request)

public final Version getVersion(GetVersionRequest request)

Gets a version

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetVersionRequest request =
       GetVersionRequest.newBuilder()
           .setName("name3373707")
           .setView(VersionView.forNumber(0))
           .build();
   Version response = artifactRegistryClient.getVersion(request);
 }
 
Parameter
NameDescription
requestGetVersionRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Version

getVersion(String name)

public final Version getVersion(String name)

Gets a version

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String name = "name3373707";
   Version response = artifactRegistryClient.getVersion(name);
 }
 
Parameter
NameDescription
nameString

The name of the version to retrieve.

Returns
TypeDescription
Version

getVersionCallable()

public final UnaryCallable<GetVersionRequest,Version> getVersionCallable()

Gets a version

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   GetVersionRequest request =
       GetVersionRequest.newBuilder()
           .setName("name3373707")
           .setView(VersionView.forNumber(0))
           .build();
   ApiFuture<Version> future = artifactRegistryClient.getVersionCallable().futureCall(request);
   // Do something.
   Version response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetVersionRequest,Version>

importAptArtifactsAsync(ImportAptArtifactsRequest request)

public final OperationFuture<ImportAptArtifactsResponse,ImportAptArtifactsMetadata> importAptArtifactsAsync(ImportAptArtifactsRequest request)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ImportAptArtifactsRequest request =
       ImportAptArtifactsRequest.newBuilder().setParent("parent-995424086").build();
   ImportAptArtifactsResponse response =
       artifactRegistryClient.importAptArtifactsAsync(request).get();
 }
 
Parameter
NameDescription
requestImportAptArtifactsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<ImportAptArtifactsResponse,ImportAptArtifactsMetadata>

importAptArtifactsCallable()

public final UnaryCallable<ImportAptArtifactsRequest,Operation> importAptArtifactsCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ImportAptArtifactsRequest request =
       ImportAptArtifactsRequest.newBuilder().setParent("parent-995424086").build();
   ApiFuture<Operation> future =
       artifactRegistryClient.importAptArtifactsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ImportAptArtifactsRequest,Operation>

importAptArtifactsOperationCallable()

public final OperationCallable<ImportAptArtifactsRequest,ImportAptArtifactsResponse,ImportAptArtifactsMetadata> importAptArtifactsOperationCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ImportAptArtifactsRequest request =
       ImportAptArtifactsRequest.newBuilder().setParent("parent-995424086").build();
   OperationFuture<ImportAptArtifactsResponse, ImportAptArtifactsMetadata> future =
       artifactRegistryClient.importAptArtifactsOperationCallable().futureCall(request);
   // Do something.
   ImportAptArtifactsResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<ImportAptArtifactsRequest,ImportAptArtifactsResponse,ImportAptArtifactsMetadata>

importYumArtifactsAsync(ImportYumArtifactsRequest request)

public final OperationFuture<ImportYumArtifactsResponse,ImportYumArtifactsMetadata> importYumArtifactsAsync(ImportYumArtifactsRequest request)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ImportYumArtifactsRequest request =
       ImportYumArtifactsRequest.newBuilder().setParent("parent-995424086").build();
   ImportYumArtifactsResponse response =
       artifactRegistryClient.importYumArtifactsAsync(request).get();
 }
 
Parameter
NameDescription
requestImportYumArtifactsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<ImportYumArtifactsResponse,ImportYumArtifactsMetadata>

importYumArtifactsCallable()

public final UnaryCallable<ImportYumArtifactsRequest,Operation> importYumArtifactsCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ImportYumArtifactsRequest request =
       ImportYumArtifactsRequest.newBuilder().setParent("parent-995424086").build();
   ApiFuture<Operation> future =
       artifactRegistryClient.importYumArtifactsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ImportYumArtifactsRequest,Operation>

importYumArtifactsOperationCallable()

public final OperationCallable<ImportYumArtifactsRequest,ImportYumArtifactsResponse,ImportYumArtifactsMetadata> importYumArtifactsOperationCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ImportYumArtifactsRequest request =
       ImportYumArtifactsRequest.newBuilder().setParent("parent-995424086").build();
   OperationFuture<ImportYumArtifactsResponse, ImportYumArtifactsMetadata> future =
       artifactRegistryClient.importYumArtifactsOperationCallable().futureCall(request);
   // Do something.
   ImportYumArtifactsResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<ImportYumArtifactsRequest,ImportYumArtifactsResponse,ImportYumArtifactsMetadata>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listDockerImages(ListDockerImagesRequest request)

public final ArtifactRegistryClient.ListDockerImagesPagedResponse listDockerImages(ListDockerImagesRequest request)

Lists docker images.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListDockerImagesRequest request =
       ListDockerImagesRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (DockerImage element : artifactRegistryClient.listDockerImages(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDockerImagesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ArtifactRegistryClient.ListDockerImagesPagedResponse

listDockerImages(String parent)

public final ArtifactRegistryClient.ListDockerImagesPagedResponse listDockerImages(String parent)

Lists docker images.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = "parent-995424086";
   for (DockerImage element : artifactRegistryClient.listDockerImages(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

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

Returns
TypeDescription
ArtifactRegistryClient.ListDockerImagesPagedResponse

listDockerImagesCallable()

public final UnaryCallable<ListDockerImagesRequest,ListDockerImagesResponse> listDockerImagesCallable()

Lists docker images.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListDockerImagesRequest request =
       ListDockerImagesRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListDockerImagesResponse response =
         artifactRegistryClient.listDockerImagesCallable().call(request);
     for (DockerImage element : response.getDockerImagesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDockerImagesRequest,ListDockerImagesResponse>

listDockerImagesPagedCallable()

public final UnaryCallable<ListDockerImagesRequest,ArtifactRegistryClient.ListDockerImagesPagedResponse> listDockerImagesPagedCallable()

Lists docker images.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListDockerImagesRequest request =
       ListDockerImagesRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<DockerImage> future =
       artifactRegistryClient.listDockerImagesPagedCallable().futureCall(request);
   // Do something.
   for (DockerImage element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDockerImagesRequest,ListDockerImagesPagedResponse>

listFiles(ListFilesRequest request)

public final ArtifactRegistryClient.ListFilesPagedResponse listFiles(ListFilesRequest request)

Lists files.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListFilesRequest request =
       ListFilesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (File element : artifactRegistryClient.listFiles(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListFilesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ArtifactRegistryClient.ListFilesPagedResponse

listFiles(String parent)

public final ArtifactRegistryClient.ListFilesPagedResponse listFiles(String parent)

Lists files.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = "parent-995424086";
   for (File element : artifactRegistryClient.listFiles(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

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

Returns
TypeDescription
ArtifactRegistryClient.ListFilesPagedResponse

listFilesCallable()

public final UnaryCallable<ListFilesRequest,ListFilesResponse> listFilesCallable()

Lists files.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListFilesRequest request =
       ListFilesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListFilesResponse response = artifactRegistryClient.listFilesCallable().call(request);
     for (File element : response.getFilesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListFilesRequest,ListFilesResponse>

listFilesPagedCallable()

public final UnaryCallable<ListFilesRequest,ArtifactRegistryClient.ListFilesPagedResponse> listFilesPagedCallable()

Lists files.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListFilesRequest request =
       ListFilesRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<File> future = artifactRegistryClient.listFilesPagedCallable().futureCall(request);
   // Do something.
   for (File element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListFilesRequest,ListFilesPagedResponse>

listPackages(ListPackagesRequest request)

public final ArtifactRegistryClient.ListPackagesPagedResponse listPackages(ListPackagesRequest request)

Lists packages.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListPackagesRequest request =
       ListPackagesRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Package element : artifactRegistryClient.listPackages(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListPackagesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ArtifactRegistryClient.ListPackagesPagedResponse

listPackages(String parent)

public final ArtifactRegistryClient.ListPackagesPagedResponse listPackages(String parent)

Lists packages.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = "parent-995424086";
   for (Package element : artifactRegistryClient.listPackages(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

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

Returns
TypeDescription
ArtifactRegistryClient.ListPackagesPagedResponse

listPackagesCallable()

public final UnaryCallable<ListPackagesRequest,ListPackagesResponse> listPackagesCallable()

Lists packages.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListPackagesRequest request =
       ListPackagesRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListPackagesResponse response = artifactRegistryClient.listPackagesCallable().call(request);
     for (Package element : response.getPackagesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListPackagesRequest,ListPackagesResponse>

listPackagesPagedCallable()

public final UnaryCallable<ListPackagesRequest,ArtifactRegistryClient.ListPackagesPagedResponse> listPackagesPagedCallable()

Lists packages.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListPackagesRequest request =
       ListPackagesRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Package> future =
       artifactRegistryClient.listPackagesPagedCallable().futureCall(request);
   // Do something.
   for (Package element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListPackagesRequest,ListPackagesPagedResponse>

listRepositories(ListRepositoriesRequest request)

public final ArtifactRegistryClient.ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequest request)

Lists repositories.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListRepositoriesRequest request =
       ListRepositoriesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Repository element : artifactRegistryClient.listRepositories(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListRepositoriesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ArtifactRegistryClient.ListRepositoriesPagedResponse

listRepositories(LocationName parent)

public final ArtifactRegistryClient.ListRepositoriesPagedResponse listRepositories(LocationName parent)

Lists repositories.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Repository element : artifactRegistryClient.listRepositories(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

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

Returns
TypeDescription
ArtifactRegistryClient.ListRepositoriesPagedResponse

listRepositories(String parent)

public final ArtifactRegistryClient.ListRepositoriesPagedResponse listRepositories(String parent)

Lists repositories.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Repository element : artifactRegistryClient.listRepositories(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

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

Returns
TypeDescription
ArtifactRegistryClient.ListRepositoriesPagedResponse

listRepositoriesCallable()

public final UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse> listRepositoriesCallable()

Lists repositories.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListRepositoriesRequest request =
       ListRepositoriesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListRepositoriesResponse response =
         artifactRegistryClient.listRepositoriesCallable().call(request);
     for (Repository element : response.getRepositoriesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse>

listRepositoriesPagedCallable()

public final UnaryCallable<ListRepositoriesRequest,ArtifactRegistryClient.ListRepositoriesPagedResponse> listRepositoriesPagedCallable()

Lists repositories.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListRepositoriesRequest request =
       ListRepositoriesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Repository> future =
       artifactRegistryClient.listRepositoriesPagedCallable().futureCall(request);
   // Do something.
   for (Repository element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListRepositoriesRequest,ListRepositoriesPagedResponse>

listTags(ListTagsRequest request)

public final ArtifactRegistryClient.ListTagsPagedResponse listTags(ListTagsRequest request)

Lists tags.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListTagsRequest request =
       ListTagsRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Tag element : artifactRegistryClient.listTags(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListTagsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ArtifactRegistryClient.ListTagsPagedResponse

listTags(String parent)

public final ArtifactRegistryClient.ListTagsPagedResponse listTags(String parent)

Lists tags.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = "parent-995424086";
   for (Tag element : artifactRegistryClient.listTags(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

The name of the parent resource whose tags will be listed.

Returns
TypeDescription
ArtifactRegistryClient.ListTagsPagedResponse

listTagsCallable()

public final UnaryCallable<ListTagsRequest,ListTagsResponse> listTagsCallable()

Lists tags.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListTagsRequest request =
       ListTagsRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListTagsResponse response = artifactRegistryClient.listTagsCallable().call(request);
     for (Tag element : response.getTagsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTagsRequest,ListTagsResponse>

listTagsPagedCallable()

public final UnaryCallable<ListTagsRequest,ArtifactRegistryClient.ListTagsPagedResponse> listTagsPagedCallable()

Lists tags.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListTagsRequest request =
       ListTagsRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Tag> future = artifactRegistryClient.listTagsPagedCallable().futureCall(request);
   // Do something.
   for (Tag element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTagsRequest,ListTagsPagedResponse>

listVersions(ListVersionsRequest request)

public final ArtifactRegistryClient.ListVersionsPagedResponse listVersions(ListVersionsRequest request)

Lists versions.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListVersionsRequest request =
       ListVersionsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(VersionView.forNumber(0))
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Version element : artifactRegistryClient.listVersions(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListVersionsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ArtifactRegistryClient.ListVersionsPagedResponse

listVersions(String parent)

public final ArtifactRegistryClient.ListVersionsPagedResponse listVersions(String parent)

Lists versions.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   String parent = "parent-995424086";
   for (Version element : artifactRegistryClient.listVersions(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

The name of the parent resource whose versions will be listed.

Returns
TypeDescription
ArtifactRegistryClient.ListVersionsPagedResponse

listVersionsCallable()

public final UnaryCallable<ListVersionsRequest,ListVersionsResponse> listVersionsCallable()

Lists versions.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListVersionsRequest request =
       ListVersionsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(VersionView.forNumber(0))
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListVersionsResponse response = artifactRegistryClient.listVersionsCallable().call(request);
     for (Version element : response.getVersionsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListVersionsRequest,ListVersionsResponse>

listVersionsPagedCallable()

public final UnaryCallable<ListVersionsRequest,ArtifactRegistryClient.ListVersionsPagedResponse> listVersionsPagedCallable()

Lists versions.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ListVersionsRequest request =
       ListVersionsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(VersionView.forNumber(0))
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Version> future =
       artifactRegistryClient.listVersionsPagedCallable().futureCall(request);
   // Do something.
   for (Version element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListVersionsRequest,ListVersionsPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Updates the IAM policy for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = artifactRegistryClient.setIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Updates the IAM policy for a given resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future = artifactRegistryClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Tests if the caller has a list of permissions on a resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = artifactRegistryClient.testIamPermissions(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Tests if the caller has a list of permissions on a resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       artifactRegistryClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateProjectSettings(ProjectSettings projectSettings, FieldMask updateMask)

public final ProjectSettings updateProjectSettings(ProjectSettings projectSettings, FieldMask updateMask)

Updates the Settings for the Project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   ProjectSettings projectSettings = ProjectSettings.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   ProjectSettings response =
       artifactRegistryClient.updateProjectSettings(projectSettings, updateMask);
 }
 
Parameters
NameDescription
projectSettingsProjectSettings

The project settings.

updateMaskFieldMask

Field mask to support partial updates.

Returns
TypeDescription
ProjectSettings

updateProjectSettings(UpdateProjectSettingsRequest request)

public final ProjectSettings updateProjectSettings(UpdateProjectSettingsRequest request)

Updates the Settings for the Project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   UpdateProjectSettingsRequest request =
       UpdateProjectSettingsRequest.newBuilder()
           .setProjectSettings(ProjectSettings.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ProjectSettings response = artifactRegistryClient.updateProjectSettings(request);
 }
 
Parameter
NameDescription
requestUpdateProjectSettingsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ProjectSettings

updateProjectSettingsCallable()

public final UnaryCallable<UpdateProjectSettingsRequest,ProjectSettings> updateProjectSettingsCallable()

Updates the Settings for the Project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   UpdateProjectSettingsRequest request =
       UpdateProjectSettingsRequest.newBuilder()
           .setProjectSettings(ProjectSettings.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<ProjectSettings> future =
       artifactRegistryClient.updateProjectSettingsCallable().futureCall(request);
   // Do something.
   ProjectSettings response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateProjectSettingsRequest,ProjectSettings>

updateRepository(Repository repository, FieldMask updateMask)

public final Repository updateRepository(Repository repository, FieldMask updateMask)

Updates a repository.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   Repository repository = Repository.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Repository response = artifactRegistryClient.updateRepository(repository, updateMask);
 }
 
Parameters
NameDescription
repositoryRepository

The repository that replaces the resource on the server.

updateMaskFieldMask

The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

Returns
TypeDescription
Repository

updateRepository(UpdateRepositoryRequest request)

public final Repository updateRepository(UpdateRepositoryRequest request)

Updates a repository.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   UpdateRepositoryRequest request =
       UpdateRepositoryRequest.newBuilder()
           .setRepository(Repository.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Repository response = artifactRegistryClient.updateRepository(request);
 }
 
Parameter
NameDescription
requestUpdateRepositoryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Repository

updateRepositoryCallable()

public final UnaryCallable<UpdateRepositoryRequest,Repository> updateRepositoryCallable()

Updates a repository.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   UpdateRepositoryRequest request =
       UpdateRepositoryRequest.newBuilder()
           .setRepository(Repository.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Repository> future =
       artifactRegistryClient.updateRepositoryCallable().futureCall(request);
   // Do something.
   Repository response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateRepositoryRequest,Repository>

updateTag(Tag tag, FieldMask updateMask)

public final Tag updateTag(Tag tag, FieldMask updateMask)

Updates a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   Tag tag = Tag.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Tag response = artifactRegistryClient.updateTag(tag, updateMask);
 }
 
Parameters
NameDescription
tagTag

The tag that replaces the resource on the server.

updateMaskFieldMask

The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

Returns
TypeDescription
Tag

updateTag(UpdateTagRequest request)

public final Tag updateTag(UpdateTagRequest request)

Updates a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   UpdateTagRequest request =
       UpdateTagRequest.newBuilder()
           .setTag(Tag.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Tag response = artifactRegistryClient.updateTag(request);
 }
 
Parameter
NameDescription
requestUpdateTagRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Tag

updateTagCallable()

public final UnaryCallable<UpdateTagRequest,Tag> updateTagCallable()

Updates a tag.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
   UpdateTagRequest request =
       UpdateTagRequest.newBuilder()
           .setTag(Tag.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Tag> future = artifactRegistryClient.updateTagCallable().futureCall(request);
   // Do something.
   Tag response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateTagRequest,Tag>