@Generated(value="by gapic-generator-java") public class ArtifactRegistryClient extends Object implements com.google.api.gax.core.BackgroundResource
Artifact Registry is an artifact management system for storing artifacts from different package management systems.
The resources managed by this API are:
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DockerImageName name =
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]");
DockerImage response = artifactRegistryClient.getDockerImage(name);
}
Note: close() needs to be called on the ArtifactRegistryClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
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.
| Modifier | Constructor and Description |
|---|---|
protected |
ArtifactRegistryClient(ArtifactRegistrySettings settings)
Constructs an instance of ArtifactRegistryClient, using the given settings.
|
protected |
ArtifactRegistryClient(ArtifactRegistryStub stub) |
| Modifier and Type | Method and 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(PackageName name)
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.
|
DockerImage |
getDockerImage(DockerImageName name)
Gets a docker image.
|
DockerImage |
getDockerImage(GetDockerImageRequest request)
Gets a docker image.
|
DockerImage |
getDockerImage(String name)
Gets a docker image.
|
com.google.api.gax.rpc.UnaryCallable<GetDockerImageRequest,DockerImage> |
getDockerImageCallable()
Gets a docker image.
|
File |
getFile(FileName name)
Gets a file.
|
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.
|
MavenArtifact |
getMavenArtifact(GetMavenArtifactRequest request)
Gets a maven artifact.
|
MavenArtifact |
getMavenArtifact(MavenArtifactName name)
Gets a maven artifact.
|
MavenArtifact |
getMavenArtifact(String name)
Gets a maven artifact.
|
com.google.api.gax.rpc.UnaryCallable<GetMavenArtifactRequest,MavenArtifact> |
getMavenArtifactCallable()
Gets a maven artifact.
|
NpmPackage |
getNpmPackage(GetNpmPackageRequest request)
Gets a npm package.
|
NpmPackage |
getNpmPackage(NpmPackageName name)
Gets a npm package.
|
NpmPackage |
getNpmPackage(String name)
Gets a npm package.
|
com.google.api.gax.rpc.UnaryCallable<GetNpmPackageRequest,NpmPackage> |
getNpmPackageCallable()
Gets a npm package.
|
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(PackageName name)
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.
|
PythonPackage |
getPythonPackage(GetPythonPackageRequest request)
Gets a python package.
|
PythonPackage |
getPythonPackage(PythonPackageName name)
Gets a python package.
|
PythonPackage |
getPythonPackage(String name)
Gets a python package.
|
com.google.api.gax.rpc.UnaryCallable<GetPythonPackageRequest,PythonPackage> |
getPythonPackageCallable()
Gets a python package.
|
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 version
|
Version |
getVersion(String name)
Gets a version
|
com.google.api.gax.rpc.UnaryCallable<GetVersionRequest,Version> |
getVersionCallable()
Gets a version
|
VPCSCConfig |
getVPCSCConfig(GetVPCSCConfigRequest request)
Retrieves the VPCSC Config for the Project.
|
VPCSCConfig |
getVPCSCConfig(String name)
Retrieves the VPCSC Config for the Project.
|
VPCSCConfig |
getVPCSCConfig(VpcscConfigName name)
Retrieves the VPCSC Config for the Project.
|
com.google.api.gax.rpc.UnaryCallable<GetVPCSCConfigRequest,VPCSCConfig> |
getVPCSCConfigCallable()
Retrieves the VPCSC Config for the Project.
|
com.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.ListDockerImagesPagedResponse |
listDockerImages(ListDockerImagesRequest request)
Lists docker images.
|
ArtifactRegistryClient.ListDockerImagesPagedResponse |
listDockerImages(String parent)
Lists docker images.
|
com.google.api.gax.rpc.UnaryCallable<ListDockerImagesRequest,ListDockerImagesResponse> |
listDockerImagesCallable()
Lists docker images.
|
com.google.api.gax.rpc.UnaryCallable<ListDockerImagesRequest,ArtifactRegistryClient.ListDockerImagesPagedResponse> |
listDockerImagesPagedCallable()
Lists docker images.
|
ArtifactRegistryClient.ListFilesPagedResponse |
listFiles(ListFilesRequest request)
Lists files.
|
ArtifactRegistryClient.ListFilesPagedResponse |
listFiles(RepositoryName parent)
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.ListMavenArtifactsPagedResponse |
listMavenArtifacts(ListMavenArtifactsRequest request)
Lists maven artifacts.
|
ArtifactRegistryClient.ListMavenArtifactsPagedResponse |
listMavenArtifacts(RepositoryName parent)
Lists maven artifacts.
|
ArtifactRegistryClient.ListMavenArtifactsPagedResponse |
listMavenArtifacts(String parent)
Lists maven artifacts.
|
com.google.api.gax.rpc.UnaryCallable<ListMavenArtifactsRequest,ListMavenArtifactsResponse> |
listMavenArtifactsCallable()
Lists maven artifacts.
|
com.google.api.gax.rpc.UnaryCallable<ListMavenArtifactsRequest,ArtifactRegistryClient.ListMavenArtifactsPagedResponse> |
listMavenArtifactsPagedCallable()
Lists maven artifacts.
|
ArtifactRegistryClient.ListNpmPackagesPagedResponse |
listNpmPackages(ListNpmPackagesRequest request)
Lists npm packages.
|
ArtifactRegistryClient.ListNpmPackagesPagedResponse |
listNpmPackages(RepositoryName parent)
Lists npm packages.
|
ArtifactRegistryClient.ListNpmPackagesPagedResponse |
listNpmPackages(String parent)
Lists npm packages.
|
com.google.api.gax.rpc.UnaryCallable<ListNpmPackagesRequest,ListNpmPackagesResponse> |
listNpmPackagesCallable()
Lists npm packages.
|
com.google.api.gax.rpc.UnaryCallable<ListNpmPackagesRequest,ArtifactRegistryClient.ListNpmPackagesPagedResponse> |
listNpmPackagesPagedCallable()
Lists npm packages.
|
ArtifactRegistryClient.ListPackagesPagedResponse |
listPackages(ListPackagesRequest request)
Lists packages.
|
ArtifactRegistryClient.ListPackagesPagedResponse |
listPackages(RepositoryName parent)
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.ListPythonPackagesPagedResponse |
listPythonPackages(ListPythonPackagesRequest request)
Lists python packages.
|
ArtifactRegistryClient.ListPythonPackagesPagedResponse |
listPythonPackages(RepositoryName parent)
Lists python packages.
|
ArtifactRegistryClient.ListPythonPackagesPagedResponse |
listPythonPackages(String parent)
Lists python packages.
|
com.google.api.gax.rpc.UnaryCallable<ListPythonPackagesRequest,ListPythonPackagesResponse> |
listPythonPackagesCallable()
Lists python packages.
|
com.google.api.gax.rpc.UnaryCallable<ListPythonPackagesRequest,ArtifactRegistryClient.ListPythonPackagesPagedResponse> |
listPythonPackagesPagedCallable()
Lists python 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.
|
VPCSCConfig |
updateVPCSCConfig(UpdateVPCSCConfigRequest request)
Updates the VPCSC Config for the Project.
|
VPCSCConfig |
updateVPCSCConfig(VPCSCConfig vpcscConfig,
com.google.protobuf.FieldMask updateMask)
Updates the VPCSC Config for the Project.
|
com.google.api.gax.rpc.UnaryCallable<UpdateVPCSCConfigRequest,VPCSCConfig> |
updateVPCSCConfigCallable()
Updates the VPCSC Config for the Project.
|
protected ArtifactRegistryClient(ArtifactRegistrySettings settings) throws IOException
IOExceptionprotected ArtifactRegistryClient(ArtifactRegistryStub stub)
public static final ArtifactRegistryClient create() throws IOException
IOExceptionpublic static final ArtifactRegistryClient create(ArtifactRegistrySettings settings) throws IOException
IOExceptionpublic static final ArtifactRegistryClient create(ArtifactRegistryStub stub)
public final ArtifactRegistrySettings getSettings()
public ArtifactRegistryStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final ArtifactRegistryClient.ListDockerImagesPagedResponse listDockerImages(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String parent = "parent-995424086";
for (DockerImage element : artifactRegistryClient.listDockerImages(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose docker images will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListDockerImagesPagedResponse listDockerImages(ListDockerImagesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
ListDockerImagesRequest request =
ListDockerImagesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
for (DockerImage element : artifactRegistryClient.listDockerImages(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDockerImagesRequest,ArtifactRegistryClient.ListDockerImagesPagedResponse> listDockerImagesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
ListDockerImagesRequest request =
ListDockerImagesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<DockerImage> future =
artifactRegistryClient.listDockerImagesPagedCallable().futureCall(request);
// Do something.
for (DockerImage element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDockerImagesRequest,ListDockerImagesResponse> listDockerImagesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
ListDockerImagesRequest request =
ListDockerImagesRequest.newBuilder()
.setParent("parent-995424086")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListDockerImagesResponse response =
artifactRegistryClient.listDockerImagesCallable().call(request);
for (DockerImage element : response.getDockerImagesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final DockerImage getDockerImage(DockerImageName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
DockerImageName name =
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]");
DockerImage response = artifactRegistryClient.getDockerImage(name);
}
name - Required. The name of the docker images.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DockerImage getDockerImage(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name =
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
.toString();
DockerImage response = artifactRegistryClient.getDockerImage(name);
}
name - Required. The name of the docker images.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DockerImage getDockerImage(GetDockerImageRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetDockerImageRequest request =
GetDockerImageRequest.newBuilder()
.setName(
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
.toString())
.build();
DockerImage response = artifactRegistryClient.getDockerImage(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDockerImageRequest,DockerImage> getDockerImageCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetDockerImageRequest request =
GetDockerImageRequest.newBuilder()
.setName(
DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
.toString())
.build();
ApiFuture<DockerImage> future =
artifactRegistryClient.getDockerImageCallable().futureCall(request);
// Do something.
DockerImage response = future.get();
}
public final ArtifactRegistryClient.ListMavenArtifactsPagedResponse listMavenArtifacts(RepositoryName parent)
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 parent = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
for (MavenArtifact element : artifactRegistryClient.listMavenArtifacts(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose maven artifacts will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListMavenArtifactsPagedResponse listMavenArtifacts(String parent)
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 = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
for (MavenArtifact element : artifactRegistryClient.listMavenArtifacts(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose maven artifacts will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListMavenArtifactsPagedResponse listMavenArtifacts(ListMavenArtifactsRequest request)
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()) {
ListMavenArtifactsRequest request =
ListMavenArtifactsRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (MavenArtifact element :
artifactRegistryClient.listMavenArtifacts(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListMavenArtifactsRequest,ArtifactRegistryClient.ListMavenArtifactsPagedResponse> listMavenArtifactsPagedCallable()
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()) {
ListMavenArtifactsRequest request =
ListMavenArtifactsRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<MavenArtifact> future =
artifactRegistryClient.listMavenArtifactsPagedCallable().futureCall(request);
// Do something.
for (MavenArtifact element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListMavenArtifactsRequest,ListMavenArtifactsResponse> listMavenArtifactsCallable()
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()) {
ListMavenArtifactsRequest request =
ListMavenArtifactsRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListMavenArtifactsResponse response =
artifactRegistryClient.listMavenArtifactsCallable().call(request);
for (MavenArtifact element : response.getMavenArtifactsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final MavenArtifact getMavenArtifact(MavenArtifactName name)
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()) {
MavenArtifactName name =
MavenArtifactName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]");
MavenArtifact response = artifactRegistryClient.getMavenArtifact(name);
}
name - Required. The name of the maven artifact.com.google.api.gax.rpc.ApiException - if the remote call failspublic final MavenArtifact getMavenArtifact(String name)
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 =
MavenArtifactName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]")
.toString();
MavenArtifact response = artifactRegistryClient.getMavenArtifact(name);
}
name - Required. The name of the maven artifact.com.google.api.gax.rpc.ApiException - if the remote call failspublic final MavenArtifact getMavenArtifact(GetMavenArtifactRequest request)
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()) {
GetMavenArtifactRequest request =
GetMavenArtifactRequest.newBuilder()
.setName(
MavenArtifactName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]")
.toString())
.build();
MavenArtifact response = artifactRegistryClient.getMavenArtifact(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetMavenArtifactRequest,MavenArtifact> getMavenArtifactCallable()
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()) {
GetMavenArtifactRequest request =
GetMavenArtifactRequest.newBuilder()
.setName(
MavenArtifactName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[MAVEN_ARTIFACT]")
.toString())
.build();
ApiFuture<MavenArtifact> future =
artifactRegistryClient.getMavenArtifactCallable().futureCall(request);
// Do something.
MavenArtifact response = future.get();
}
public final ArtifactRegistryClient.ListNpmPackagesPagedResponse listNpmPackages(RepositoryName parent)
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 parent = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
for (NpmPackage element : artifactRegistryClient.listNpmPackages(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose npm packages will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListNpmPackagesPagedResponse listNpmPackages(String parent)
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 = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
for (NpmPackage element : artifactRegistryClient.listNpmPackages(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose npm packages will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListNpmPackagesPagedResponse listNpmPackages(ListNpmPackagesRequest request)
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()) {
ListNpmPackagesRequest request =
ListNpmPackagesRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (NpmPackage element : artifactRegistryClient.listNpmPackages(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListNpmPackagesRequest,ArtifactRegistryClient.ListNpmPackagesPagedResponse> listNpmPackagesPagedCallable()
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()) {
ListNpmPackagesRequest request =
ListNpmPackagesRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<NpmPackage> future =
artifactRegistryClient.listNpmPackagesPagedCallable().futureCall(request);
// Do something.
for (NpmPackage element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNpmPackagesRequest,ListNpmPackagesResponse> listNpmPackagesCallable()
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()) {
ListNpmPackagesRequest request =
ListNpmPackagesRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListNpmPackagesResponse response =
artifactRegistryClient.listNpmPackagesCallable().call(request);
for (NpmPackage element : response.getNpmPackagesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final NpmPackage getNpmPackage(NpmPackageName name)
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()) {
NpmPackageName name =
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]");
NpmPackage response = artifactRegistryClient.getNpmPackage(name);
}
name - Required. The name of the npm package.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NpmPackage getNpmPackage(String name)
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 =
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]").toString();
NpmPackage response = artifactRegistryClient.getNpmPackage(name);
}
name - Required. The name of the npm package.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NpmPackage getNpmPackage(GetNpmPackageRequest request)
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()) {
GetNpmPackageRequest request =
GetNpmPackageRequest.newBuilder()
.setName(
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]")
.toString())
.build();
NpmPackage response = artifactRegistryClient.getNpmPackage(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetNpmPackageRequest,NpmPackage> getNpmPackageCallable()
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()) {
GetNpmPackageRequest request =
GetNpmPackageRequest.newBuilder()
.setName(
NpmPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[NPM_PACKAGE]")
.toString())
.build();
ApiFuture<NpmPackage> future =
artifactRegistryClient.getNpmPackageCallable().futureCall(request);
// Do something.
NpmPackage response = future.get();
}
public final ArtifactRegistryClient.ListPythonPackagesPagedResponse listPythonPackages(RepositoryName parent)
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 parent = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
for (PythonPackage element : artifactRegistryClient.listPythonPackages(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose python packages will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListPythonPackagesPagedResponse listPythonPackages(String parent)
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 = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
for (PythonPackage element : artifactRegistryClient.listPythonPackages(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose python packages will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListPythonPackagesPagedResponse listPythonPackages(ListPythonPackagesRequest request)
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()) {
ListPythonPackagesRequest request =
ListPythonPackagesRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (PythonPackage element :
artifactRegistryClient.listPythonPackages(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListPythonPackagesRequest,ArtifactRegistryClient.ListPythonPackagesPagedResponse> listPythonPackagesPagedCallable()
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()) {
ListPythonPackagesRequest request =
ListPythonPackagesRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<PythonPackage> future =
artifactRegistryClient.listPythonPackagesPagedCallable().futureCall(request);
// Do something.
for (PythonPackage element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListPythonPackagesRequest,ListPythonPackagesResponse> listPythonPackagesCallable()
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()) {
ListPythonPackagesRequest request =
ListPythonPackagesRequest.newBuilder()
.setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListPythonPackagesResponse response =
artifactRegistryClient.listPythonPackagesCallable().call(request);
for (PythonPackage element : response.getPythonPackagesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final PythonPackage getPythonPackage(PythonPackageName name)
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()) {
PythonPackageName name =
PythonPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]");
PythonPackage response = artifactRegistryClient.getPythonPackage(name);
}
name - Required. The name of the python package.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PythonPackage getPythonPackage(String name)
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 =
PythonPackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]")
.toString();
PythonPackage response = artifactRegistryClient.getPythonPackage(name);
}
name - Required. The name of the python package.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PythonPackage getPythonPackage(GetPythonPackageRequest request)
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()) {
GetPythonPackageRequest request =
GetPythonPackageRequest.newBuilder()
.setName(
PythonPackageName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]")
.toString())
.build();
PythonPackage response = artifactRegistryClient.getPythonPackage(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetPythonPackageRequest,PythonPackage> getPythonPackageCallable()
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()) {
GetPythonPackageRequest request =
GetPythonPackageRequest.newBuilder()
.setName(
PythonPackageName.of(
"[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PYTHON_PACKAGE]")
.toString())
.build();
ApiFuture<PythonPackage> future =
artifactRegistryClient.getPythonPackageCallable().futureCall(request);
// Do something.
PythonPackage response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ImportAptArtifactsResponse,ImportAptArtifactsMetadata> importAptArtifactsAsync(ImportAptArtifactsRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportAptArtifactsRequest,ImportAptArtifactsResponse,ImportAptArtifactsMetadata> importAptArtifactsOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportAptArtifactsRequest,com.google.longrunning.Operation> importAptArtifactsCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<ImportYumArtifactsResponse,ImportYumArtifactsMetadata> importYumArtifactsAsync(ImportYumArtifactsRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportYumArtifactsRequest,ImportYumArtifactsResponse,ImportYumArtifactsMetadata> importYumArtifactsOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportYumArtifactsRequest,com.google.longrunning.Operation> importYumArtifactsCallable()
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();
}
public final ArtifactRegistryClient.ListRepositoriesPagedResponse listRepositories(LocationName parent)
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);
}
}
parent - Required. The name of the parent resource whose repositories will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListRepositoriesPagedResponse listRepositories(String parent)
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);
}
}
parent - Required. The name of the parent resource whose repositories will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,ArtifactRegistryClient.ListRepositoriesPagedResponse> listRepositoriesPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse> listRepositoriesCallable()
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;
}
}
}
public final Repository getRepository(RepositoryName name)
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);
}
name - Required. The name of the repository to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Repository getRepository(String name)
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);
}
name - Required. The name of the repository to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Repository getRepository(GetRepositoryRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRepositoryRequest,Repository> getRepositoryCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> createRepositoryAsync(LocationName parent, Repository repository, String repositoryId)
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();
}
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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> createRepositoryAsync(String parent, Repository repository, String repositoryId)
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();
}
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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> createRepositoryAsync(CreateRepositoryRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata> createRepositoryOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateRepositoryRequest,com.google.longrunning.Operation> createRepositoryCallable()
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();
}
public final Repository updateRepository(Repository repository, com.google.protobuf.FieldMask updateMask)
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);
}
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#fieldmaskcom.google.api.gax.rpc.ApiException - if the remote call failspublic final Repository updateRepository(UpdateRepositoryRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateRepositoryRequest,Repository> updateRepositoryCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRepositoryAsync(RepositoryName name)
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();
}
name - Required. The name of the repository to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRepositoryAsync(String name)
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();
}
name - Required. The name of the repository to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRepositoryAsync(DeleteRepositoryRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteRepositoryRequest,com.google.protobuf.Empty,OperationMetadata> deleteRepositoryOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteRepositoryRequest,com.google.longrunning.Operation> deleteRepositoryCallable()
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();
}
public final ArtifactRegistryClient.ListPackagesPagedResponse listPackages(RepositoryName parent)
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 parent = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
for (Package element : artifactRegistryClient.listPackages(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose packages will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListPackagesPagedResponse listPackages(String parent)
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 = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
for (Package element : artifactRegistryClient.listPackages(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the parent resource whose packages will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListPackagesPagedResponse listPackages(ListPackagesRequest request)
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(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Package element : artifactRegistryClient.listPackages(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListPackagesRequest,ArtifactRegistryClient.ListPackagesPagedResponse> listPackagesPagedCallable()
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(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Package> future =
artifactRegistryClient.listPackagesPagedCallable().futureCall(request);
// Do something.
for (Package element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListPackagesRequest,ListPackagesResponse> listPackagesCallable()
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(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.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;
}
}
}
public final Package getPackage(PackageName name)
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()) {
PackageName name = PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]");
Package response = artifactRegistryClient.getPackage(name);
}
name - Required. The name of the package to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Package getPackage(String name)
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 =
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString();
Package response = artifactRegistryClient.getPackage(name);
}
name - Required. The name of the package to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Package getPackage(GetPackageRequest request)
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(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
Package response = artifactRegistryClient.getPackage(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetPackageRequest,Package> getPackageCallable()
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(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
ApiFuture<Package> future = artifactRegistryClient.getPackageCallable().futureCall(request);
// Do something.
Package response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePackageAsync(PackageName name)
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()) {
PackageName name = PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]");
artifactRegistryClient.deletePackageAsync(name).get();
}
name - Required. The name of the package to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePackageAsync(String name)
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 =
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString();
artifactRegistryClient.deletePackageAsync(name).get();
}
name - Required. The name of the package to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePackageAsync(DeletePackageRequest request)
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(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
artifactRegistryClient.deletePackageAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeletePackageRequest,com.google.protobuf.Empty,OperationMetadata> deletePackageOperationCallable()
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(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
artifactRegistryClient.deletePackageOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeletePackageRequest,com.google.longrunning.Operation> deletePackageCallable()
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(
PackageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[PACKAGE]").toString())
.build();
ApiFuture<Operation> future =
artifactRegistryClient.deletePackageCallable().futureCall(request);
// Do something.
future.get();
}
public final ArtifactRegistryClient.ListVersionsPagedResponse listVersions(String parent)
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);
}
}
parent - The name of the parent resource whose versions will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListVersionsPagedResponse listVersions(ListVersionsRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListVersionsRequest,ArtifactRegistryClient.ListVersionsPagedResponse> listVersionsPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListVersionsRequest,ListVersionsResponse> listVersionsCallable()
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;
}
}
}
public final Version getVersion(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
String name = "name3373707";
Version response = artifactRegistryClient.getVersion(name);
}
name - The name of the version to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Version getVersion(GetVersionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetVersionRequest request =
GetVersionRequest.newBuilder()
.setName("name3373707")
.setView(VersionView.forNumber(0))
.build();
Version response = artifactRegistryClient.getVersion(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetVersionRequest,Version> getVersionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
GetVersionRequest request =
GetVersionRequest.newBuilder()
.setName("name3373707")
.setView(VersionView.forNumber(0))
.build();
ApiFuture<Version> future = artifactRegistryClient.getVersionCallable().futureCall(request);
// Do something.
Version response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVersionAsync(String name)
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();
}
name - The name of the version to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVersionAsync(DeleteVersionRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteVersionRequest,com.google.protobuf.Empty,OperationMetadata> deleteVersionOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteVersionRequest,com.google.longrunning.Operation> deleteVersionCallable()
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();
}
public final ArtifactRegistryClient.ListFilesPagedResponse listFiles(RepositoryName parent)
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 parent = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
for (File element : artifactRegistryClient.listFiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the repository whose files will be listed. For example:
"projects/p1/locations/us-central1/repositories/repo1com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListFilesPagedResponse listFiles(String parent)
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 = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
for (File element : artifactRegistryClient.listFiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the repository whose files will be listed. For example:
"projects/p1/locations/us-central1/repositories/repo1com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListFilesPagedResponse listFiles(ListFilesRequest request)
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(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
for (File element : artifactRegistryClient.listFiles(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListFilesRequest,ArtifactRegistryClient.ListFilesPagedResponse> listFilesPagedCallable()
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(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<File> future = artifactRegistryClient.listFilesPagedCallable().futureCall(request);
// Do something.
for (File element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListFilesRequest,ListFilesResponse> listFilesCallable()
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(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListFilesResponse response = artifactRegistryClient.listFilesCallable().call(request);
for (File element : response.getFilesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final File getFile(FileName name)
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()) {
FileName name = FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]");
File response = artifactRegistryClient.getFile(name);
}
name - Required. The name of the file to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final File getFile(String name)
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 = FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]").toString();
File response = artifactRegistryClient.getFile(name);
}
name - Required. The name of the file to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final File getFile(GetFileRequest request)
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(FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]").toString())
.build();
File response = artifactRegistryClient.getFile(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetFileRequest,File> getFileCallable()
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(FileName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[FILE]").toString())
.build();
ApiFuture<File> future = artifactRegistryClient.getFileCallable().futureCall(request);
// Do something.
File response = future.get();
}
public final ArtifactRegistryClient.ListTagsPagedResponse listTags(String parent)
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);
}
}
parent - The name of the parent resource whose tags will be listed.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ArtifactRegistryClient.ListTagsPagedResponse listTags(ListTagsRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,ArtifactRegistryClient.ListTagsPagedResponse> listTagsPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTagsRequest,ListTagsResponse> listTagsCallable()
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;
}
}
}
public final Tag getTag(String name)
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);
}
name - The name of the tag to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Tag getTag(GetTagRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTagRequest,Tag> getTagCallable()
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();
}
public final Tag createTag(String parent, Tag tag, String tagId)
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);
}
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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Tag createTag(CreateTagRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateTagRequest,Tag> createTagCallable()
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();
}
public final Tag updateTag(Tag tag, com.google.protobuf.FieldMask updateMask)
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);
}
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#fieldmaskcom.google.api.gax.rpc.ApiException - if the remote call failspublic final Tag updateTag(UpdateTagRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateTagRequest,Tag> updateTagCallable()
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();
}
public final void deleteTag(String name)
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);
}
name - The name of the tag to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteTag(DeleteTagRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteTagRequest,com.google.protobuf.Empty> deleteTagCallable()
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();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
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();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
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();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
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();
}
public final ProjectSettings getProjectSettings(ProjectSettingsName name)
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);
}
name - Required. The name of the projectSettings resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProjectSettings getProjectSettings(String name)
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);
}
name - Required. The name of the projectSettings resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProjectSettings getProjectSettings(GetProjectSettingsRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetProjectSettingsRequest,ProjectSettings> getProjectSettingsCallable()
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();
}
public final ProjectSettings updateProjectSettings(ProjectSettings projectSettings, com.google.protobuf.FieldMask updateMask)
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);
}
projectSettings - The project settings.updateMask - Field mask to support partial updates.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProjectSettings updateProjectSettings(UpdateProjectSettingsRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateProjectSettingsRequest,ProjectSettings> updateProjectSettingsCallable()
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();
}
public final VPCSCConfig getVPCSCConfig(VpcscConfigName name)
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()) {
VpcscConfigName name = VpcscConfigName.of("[PROJECT]", "[LOCATION]");
VPCSCConfig response = artifactRegistryClient.getVPCSCConfig(name);
}
name - Required. The name of the VPCSCConfig resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VPCSCConfig getVPCSCConfig(String name)
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 = VpcscConfigName.of("[PROJECT]", "[LOCATION]").toString();
VPCSCConfig response = artifactRegistryClient.getVPCSCConfig(name);
}
name - Required. The name of the VPCSCConfig resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VPCSCConfig getVPCSCConfig(GetVPCSCConfigRequest request)
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()) {
GetVPCSCConfigRequest request =
GetVPCSCConfigRequest.newBuilder()
.setName(VpcscConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
VPCSCConfig response = artifactRegistryClient.getVPCSCConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetVPCSCConfigRequest,VPCSCConfig> getVPCSCConfigCallable()
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()) {
GetVPCSCConfigRequest request =
GetVPCSCConfigRequest.newBuilder()
.setName(VpcscConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<VPCSCConfig> future =
artifactRegistryClient.getVPCSCConfigCallable().futureCall(request);
// Do something.
VPCSCConfig response = future.get();
}
public final VPCSCConfig updateVPCSCConfig(VPCSCConfig vpcscConfig, com.google.protobuf.FieldMask updateMask)
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()) {
VPCSCConfig vpcscConfig = VPCSCConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
VPCSCConfig response = artifactRegistryClient.updateVPCSCConfig(vpcscConfig, updateMask);
}
vpcscConfig - The project config.updateMask - Field mask to support partial updates.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VPCSCConfig updateVPCSCConfig(UpdateVPCSCConfigRequest request)
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()) {
UpdateVPCSCConfigRequest request =
UpdateVPCSCConfigRequest.newBuilder()
.setVpcscConfig(VPCSCConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
VPCSCConfig response = artifactRegistryClient.updateVPCSCConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateVPCSCConfigRequest,VPCSCConfig> updateVPCSCConfigCallable()
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()) {
UpdateVPCSCConfigRequest request =
UpdateVPCSCConfigRequest.newBuilder()
.setVpcscConfig(VPCSCConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<VPCSCConfig> future =
artifactRegistryClient.updateVPCSCConfigCallable().futureCall(request);
// Do something.
VPCSCConfig response = future.get();
}
public final ArtifactRegistryClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,ArtifactRegistryClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.