Class ArtifactRegistryClient
- java.lang.Object
-
- com.google.devtools.artifactregistry.v1beta2.ArtifactRegistryClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@BetaApi @Generated("by gapic-generator-java") public class ArtifactRegistryClient extends Object implements com.google.api.gax.core.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()) { RepositoryName name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]"); Repository response = artifactRegistryClient.getRepository(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:
- 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.
- 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.
- 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.newHttpJsonBuilder().build(); ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create(artifactRegistrySettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
ArtifactRegistryClient(ArtifactRegistrySettings settings)
Constructs an instance of ArtifactRegistryClient, using the given settings.protected
ArtifactRegistryClient(ArtifactRegistryStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static ArtifactRegistryClient
create()
Constructs an instance of ArtifactRegistryClient with default settings.static ArtifactRegistryClient
create(ArtifactRegistrySettings settings)
Constructs an instance of ArtifactRegistryClient, using the given settings.static ArtifactRegistryClient
create(ArtifactRegistryStub stub)
Constructs an instance of ArtifactRegistryClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata>
createRepositoryAsync(CreateRepositoryRequest request)
Creates a repository.com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata>
createRepositoryAsync(LocationName parent, Repository repository, String repositoryId)
Creates a repository.com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata>
createRepositoryAsync(String parent, Repository repository, String repositoryId)
Creates a repository.com.google.api.gax.rpc.UnaryCallable<CreateRepositoryRequest,com.google.longrunning.Operation>
createRepositoryCallable()
Creates a repository.com.google.api.gax.rpc.OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata>
createRepositoryOperationCallable()
Creates a repository.Tag
createTag(CreateTagRequest request)
Creates a tag.Tag
createTag(String parent, Tag tag, String tagId)
Creates a tag.com.google.api.gax.rpc.UnaryCallable<CreateTagRequest,Tag>
createTagCallable()
Creates a tag.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deletePackageAsync(DeletePackageRequest request)
Deletes a package and all of its versions and tags.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deletePackageAsync(String name)
Deletes a package and all of its versions and tags.com.google.api.gax.rpc.UnaryCallable<DeletePackageRequest,com.google.longrunning.Operation>
deletePackageCallable()
Deletes a package and all of its versions and tags.com.google.api.gax.rpc.OperationCallable<DeletePackageRequest,com.google.protobuf.Empty,OperationMetadata>
deletePackageOperationCallable()
Deletes a package and all of its versions and tags.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteRepositoryAsync(DeleteRepositoryRequest request)
Deletes a repository and all of its contents.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteRepositoryAsync(RepositoryName name)
Deletes a repository and all of its contents.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteRepositoryAsync(String name)
Deletes a repository and all of its contents.com.google.api.gax.rpc.UnaryCallable<DeleteRepositoryRequest,com.google.longrunning.Operation>
deleteRepositoryCallable()
Deletes a repository and all of its contents.com.google.api.gax.rpc.OperationCallable<DeleteRepositoryRequest,com.google.protobuf.Empty,OperationMetadata>
deleteRepositoryOperationCallable()
Deletes a repository and all of its contents.void
deleteTag(DeleteTagRequest request)
Deletes a tag.void
deleteTag(String name)
Deletes a tag.com.google.api.gax.rpc.UnaryCallable<DeleteTagRequest,com.google.protobuf.Empty>
deleteTagCallable()
Deletes a tag.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteVersionAsync(DeleteVersionRequest request)
Deletes a version and all of its content.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteVersionAsync(String name)
Deletes a version and all of its content.com.google.api.gax.rpc.UnaryCallable<DeleteVersionRequest,com.google.longrunning.Operation>
deleteVersionCallable()
Deletes a version and all of its content.com.google.api.gax.rpc.OperationCallable<DeleteVersionRequest,com.google.protobuf.Empty,OperationMetadata>
deleteVersionOperationCallable()
Deletes a version and all of its content.File
getFile(GetFileRequest request)
Gets a file.File
getFile(String name)
Gets a file.com.google.api.gax.rpc.UnaryCallable<GetFileRequest,File>
getFileCallable()
Gets a file.com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.com.google.iam.v1.Policy
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the IAM policy for a given resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>
getIamPolicyCallable()
Gets the IAM policy for a given resource.com.google.cloud.location.Location
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>
getLocationCallable()
Gets information about a location.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.Package
getPackage(GetPackageRequest request)
Gets a package.Package
getPackage(String name)
Gets a package.com.google.api.gax.rpc.UnaryCallable<GetPackageRequest,Package>
getPackageCallable()
Gets a package.ProjectSettings
getProjectSettings(GetProjectSettingsRequest request)
Retrieves the Settings for the Project.ProjectSettings
getProjectSettings(ProjectSettingsName name)
Retrieves the Settings for the Project.ProjectSettings
getProjectSettings(String name)
Retrieves the Settings for the Project.com.google.api.gax.rpc.UnaryCallable<GetProjectSettingsRequest,ProjectSettings>
getProjectSettingsCallable()
Retrieves the Settings for the Project.Repository
getRepository(GetRepositoryRequest request)
Gets a repository.Repository
getRepository(RepositoryName name)
Gets a repository.Repository
getRepository(String name)
Gets a repository.com.google.api.gax.rpc.UnaryCallable<GetRepositoryRequest,Repository>
getRepositoryCallable()
Gets a repository.ArtifactRegistrySettings
getSettings()
ArtifactRegistryStub
getStub()
Tag
getTag(GetTagRequest request)
Gets a tag.Tag
getTag(String name)
Gets a tag.com.google.api.gax.rpc.UnaryCallable<GetTagRequest,Tag>
getTagCallable()
Gets a tag.Version
getVersion(GetVersionRequest request)
Gets a versionVersion
getVersion(String name)
Gets a versioncom.google.api.gax.rpc.UnaryCallable<GetVersionRequest,Version>
getVersionCallable()
Gets a versioncom.google.api.gax.longrunning.OperationFuture<ImportAptArtifactsResponse,ImportAptArtifactsMetadata>
importAptArtifactsAsync(ImportAptArtifactsRequest request)
Imports Apt artifacts.com.google.api.gax.rpc.UnaryCallable<ImportAptArtifactsRequest,com.google.longrunning.Operation>
importAptArtifactsCallable()
Imports Apt artifacts.com.google.api.gax.rpc.OperationCallable<ImportAptArtifactsRequest,ImportAptArtifactsResponse,ImportAptArtifactsMetadata>
importAptArtifactsOperationCallable()
Imports Apt artifacts.com.google.api.gax.longrunning.OperationFuture<ImportYumArtifactsResponse,ImportYumArtifactsMetadata>
importYumArtifactsAsync(ImportYumArtifactsRequest request)
Imports Yum (RPM) artifacts.com.google.api.gax.rpc.UnaryCallable<ImportYumArtifactsRequest,com.google.longrunning.Operation>
importYumArtifactsCallable()
Imports Yum (RPM) artifacts.com.google.api.gax.rpc.OperationCallable<ImportYumArtifactsRequest,ImportYumArtifactsResponse,ImportYumArtifactsMetadata>
importYumArtifactsOperationCallable()
Imports Yum (RPM) artifacts.boolean
isShutdown()
boolean
isTerminated()
ArtifactRegistryClient.ListFilesPagedResponse
listFiles(ListFilesRequest request)
Lists files.ArtifactRegistryClient.ListFilesPagedResponse
listFiles(String parent)
Lists files.com.google.api.gax.rpc.UnaryCallable<ListFilesRequest,ListFilesResponse>
listFilesCallable()
Lists files.com.google.api.gax.rpc.UnaryCallable<ListFilesRequest,ArtifactRegistryClient.ListFilesPagedResponse>
listFilesPagedCallable()
Lists files.ArtifactRegistryClient.ListLocationsPagedResponse
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>
listLocationsCallable()
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,ArtifactRegistryClient.ListLocationsPagedResponse>
listLocationsPagedCallable()
Lists information about the supported locations for this service.ArtifactRegistryClient.ListPackagesPagedResponse
listPackages(ListPackagesRequest request)
Lists packages.ArtifactRegistryClient.ListPackagesPagedResponse
listPackages(String parent)
Lists packages.com.google.api.gax.rpc.UnaryCallable<ListPackagesRequest,ListPackagesResponse>
listPackagesCallable()
Lists packages.com.google.api.gax.rpc.UnaryCallable<ListPackagesRequest,ArtifactRegistryClient.ListPackagesPagedResponse>
listPackagesPagedCallable()
Lists packages.ArtifactRegistryClient.ListRepositoriesPagedResponse
listRepositories(ListRepositoriesRequest request)
Lists repositories.ArtifactRegistryClient.ListRepositoriesPagedResponse
listRepositories(LocationName parent)
Lists repositories.ArtifactRegistryClient.ListRepositoriesPagedResponse
listRepositories(String parent)
Lists repositories.com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse>
listRepositoriesCallable()
Lists repositories.com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,ArtifactRegistryClient.ListRepositoriesPagedResponse>
listRepositoriesPagedCallable()
Lists repositories.ArtifactRegistryClient.ListTagsPagedResponse
listTags(ListTagsRequest request)
Lists tags.ArtifactRegistryClient.ListTagsPagedResponse
listTags(String parent)
Lists tags.com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,ListTagsResponse>
listTagsCallable()
Lists tags.com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,ArtifactRegistryClient.ListTagsPagedResponse>
listTagsPagedCallable()
Lists tags.ArtifactRegistryClient.ListVersionsPagedResponse
listVersions(ListVersionsRequest request)
Lists versions.ArtifactRegistryClient.ListVersionsPagedResponse
listVersions(String parent)
Lists versions.com.google.api.gax.rpc.UnaryCallable<ListVersionsRequest,ListVersionsResponse>
listVersionsCallable()
Lists versions.com.google.api.gax.rpc.UnaryCallable<ListVersionsRequest,ArtifactRegistryClient.ListVersionsPagedResponse>
listVersionsPagedCallable()
Lists versions.com.google.iam.v1.Policy
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Updates the IAM policy for a given resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>
setIamPolicyCallable()
Updates the IAM policy for a given resource.void
shutdown()
void
shutdownNow()
com.google.iam.v1.TestIamPermissionsResponse
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Tests if the caller has a list of permissions on a resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>
testIamPermissionsCallable()
Tests if the caller has a list of permissions on a resource.ProjectSettings
updateProjectSettings(ProjectSettings projectSettings, com.google.protobuf.FieldMask updateMask)
Updates the Settings for the Project.ProjectSettings
updateProjectSettings(UpdateProjectSettingsRequest request)
Updates the Settings for the Project.com.google.api.gax.rpc.UnaryCallable<UpdateProjectSettingsRequest,ProjectSettings>
updateProjectSettingsCallable()
Updates the Settings for the Project.Repository
updateRepository(Repository repository, com.google.protobuf.FieldMask updateMask)
Updates a repository.Repository
updateRepository(UpdateRepositoryRequest request)
Updates a repository.com.google.api.gax.rpc.UnaryCallable<UpdateRepositoryRequest,Repository>
updateRepositoryCallable()
Updates a repository.Tag
updateTag(Tag tag, com.google.protobuf.FieldMask updateMask)
Updates a tag.Tag
updateTag(UpdateTagRequest request)
Updates a tag.com.google.api.gax.rpc.UnaryCallable<UpdateTagRequest,Tag>
updateTagCallable()
Updates a tag.
-
-
-
Constructor Detail
-
ArtifactRegistryClient
protected ArtifactRegistryClient(ArtifactRegistrySettings settings) throws IOException
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.- Throws:
IOException
-
ArtifactRegistryClient
protected ArtifactRegistryClient(ArtifactRegistryStub stub)
-
-
Method Detail
-
create
public static final ArtifactRegistryClient create() throws IOException
Constructs an instance of ArtifactRegistryClient with default settings.- Throws:
IOException
-
create
public static final ArtifactRegistryClient create(ArtifactRegistrySettings settings) throws IOException
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.- Throws:
IOException
-
create
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).
-
getSettings
public final ArtifactRegistrySettings getSettings()
-
getStub
public ArtifactRegistryStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
importAptArtifactsAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
importAptArtifactsOperationCallable
public final com.google.api.gax.rpc.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(); }
-
importAptArtifactsCallable
public final com.google.api.gax.rpc.UnaryCallable<ImportAptArtifactsRequest,com.google.longrunning.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(); }
-
importYumArtifactsAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
importYumArtifactsOperationCallable
public final com.google.api.gax.rpc.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(); }
-
importYumArtifactsCallable
public final com.google.api.gax.rpc.UnaryCallable<ImportYumArtifactsRequest,com.google.longrunning.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(); }
-
listRepositories
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); } }
- Parameters:
parent
- Required. The name of the parent resource whose repositories will be listed.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listRepositories
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); } }
- Parameters:
parent
- Required. The name of the parent resource whose repositories will be listed.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listRepositories
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listRepositoriesPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listRepositoriesCallable
public final com.google.api.gax.rpc.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; } } }
-
getRepository
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); }
- Parameters:
name
- Required. The name of the repository to retrieve.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getRepository
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); }
- Parameters:
name
- Required. The name of the repository to retrieve.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getRepository
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getRepositoryCallable
public final com.google.api.gax.rpc.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(); }
-
createRepositoryAsync
public final com.google.api.gax.longrunning.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:
parent
- Required. The name of the parent resource where the repository will be created.repository
- The repository to be created.repositoryId
- The repository id to use for this repository.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createRepositoryAsync
public final com.google.api.gax.longrunning.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:
parent
- Required. The name of the parent resource where the repository will be created.repository
- The repository to be created.repositoryId
- The repository id to use for this repository.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createRepositoryAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createRepositoryOperationCallable
public final com.google.api.gax.rpc.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(); }
-
createRepositoryCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateRepositoryRequest,com.google.longrunning.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(); }
-
updateRepository
public final Repository updateRepository(Repository repository, com.google.protobuf.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:
repository
- The repository that replaces the resource on the server.updateMask
- The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateRepository
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateRepositoryCallable
public final com.google.api.gax.rpc.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(); }
-
deleteRepositoryAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.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(); }
- Parameters:
name
- Required. The name of the repository to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteRepositoryAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.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(); }
- Parameters:
name
- Required. The name of the repository to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteRepositoryAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteRepositoryOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteRepositoryRequest,com.google.protobuf.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(); }
-
deleteRepositoryCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteRepositoryRequest,com.google.longrunning.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(); }
-
listPackages
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); } }
- Parameters:
parent
- The name of the parent resource whose packages will be listed.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPackages
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPackagesPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listPackagesCallable
public final com.google.api.gax.rpc.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; } } }
-
getPackage
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); }
- Parameters:
name
- The name of the package to retrieve.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPackage
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPackageCallable
public final com.google.api.gax.rpc.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(); }
-
deletePackageAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.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(); }
- Parameters:
name
- The name of the package to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePackageAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePackageOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeletePackageRequest,com.google.protobuf.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(); }
-
deletePackageCallable
public final com.google.api.gax.rpc.UnaryCallable<DeletePackageRequest,com.google.longrunning.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(); }
-
listVersions
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); } }
- Parameters:
parent
- The name of the parent resource whose versions will be listed.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVersions
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVersionsPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listVersionsCallable
public final com.google.api.gax.rpc.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; } } }
-
getVersion
public final Version getVersion(String name)
Gets a versionSample 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); }
- Parameters:
name
- The name of the version to retrieve.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVersion
public final Version getVersion(GetVersionRequest request)
Gets a versionSample 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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVersionCallable
public final com.google.api.gax.rpc.UnaryCallable<GetVersionRequest,Version> getVersionCallable()
Gets a versionSample 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(); }
-
deleteVersionAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.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(); }
- Parameters:
name
- The name of the version to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteVersionAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteVersionOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteVersionRequest,com.google.protobuf.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(); }
-
deleteVersionCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteVersionRequest,com.google.longrunning.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(); }
-
listFiles
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); } }
- Parameters:
parent
- The name of the repository whose files will be listed. For example: "projects/p1/locations/us-central1/repositories/repo1- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listFiles
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") .build(); for (File element : artifactRegistryClient.listFiles(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listFilesPagedCallable
public final com.google.api.gax.rpc.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") .build(); ApiFuture<File> future = artifactRegistryClient.listFilesPagedCallable().futureCall(request); // Do something. for (File element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listFilesCallable
public final com.google.api.gax.rpc.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") .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; } } }
-
getFile
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); }
- Parameters:
name
- The name of the file to retrieve.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getFile
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getFileCallable
public final com.google.api.gax.rpc.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(); }
-
listTags
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); } }
- Parameters:
parent
- The name of the parent resource whose tags will be listed.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTags
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTagsPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listTagsCallable
public final com.google.api.gax.rpc.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; } } }
-
getTag
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); }
- Parameters:
name
- The name of the tag to retrieve.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTag
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTagCallable
public final com.google.api.gax.rpc.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(); }
-
createTag
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:
parent
- The name of the parent resource where the tag will be created.tag
- The tag to be created.tagId
- The tag id to use for this repository.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createTag
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createTagCallable
public final com.google.api.gax.rpc.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(); }
-
updateTag
public final Tag updateTag(Tag tag, com.google.protobuf.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:
tag
- The tag that replaces the resource on the server.updateMask
- The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateTag
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateTagCallable
public final com.google.api.gax.rpc.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(); }
-
deleteTag
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); }
- Parameters:
name
- The name of the tag to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteTag
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteTagCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteTagRequest,com.google.protobuf.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(); }
-
setIamPolicy
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.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(); }
-
getIamPolicy
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.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(); }
-
testIamPermissions
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
testIamPermissionsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.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(); }
-
getProjectSettings
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); }
- Parameters:
name
- Required. The name of the projectSettings resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getProjectSettings
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); }
- Parameters:
name
- Required. The name of the projectSettings resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getProjectSettings
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getProjectSettingsCallable
public final com.google.api.gax.rpc.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(); }
-
updateProjectSettings
public final ProjectSettings updateProjectSettings(ProjectSettings projectSettings, com.google.protobuf.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:
projectSettings
- The project settings.updateMask
- Field mask to support partial updates.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateProjectSettings
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateProjectSettingsCallable
public final com.google.api.gax.rpc.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(); }
-
listLocations
public final ArtifactRegistryClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : artifactRegistryClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,ArtifactRegistryClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = artifactRegistryClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = artifactRegistryClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.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()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = artifactRegistryClient.getLocation(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Gets information about a location.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()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = artifactRegistryClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-