Class RegistryClient (0.37.0)

GitHub RepositoryProduct Reference

Service Description: The Registry service allows teams to manage descriptions of APIs.

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 (RegistryClient registryClient = RegistryClient.create()) {
   ApiName name = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
   Api response = registryClient.getApi(name);
 }
 

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

Methods
MethodDescriptionMethod Variants

ListApis

Returns matching APIs.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listApis(ListApisRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listApis(LocationName parent)

  • listApis(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listApisPagedCallable()

  • listApisCallable()

GetApi

Returns a specified API.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getApi(GetApiRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getApi(ApiName name)

  • getApi(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getApiCallable()

CreateApi

Creates a specified API.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createApi(CreateApiRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createApi(LocationName parent, Api api, String apiId)

  • createApi(String parent, Api api, String apiId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createApiCallable()

UpdateApi

Used to modify a specified API.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateApi(UpdateApiRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateApi(Api api, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateApiCallable()

DeleteApi

Removes a specified API and all of the resources that it owns.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteApi(DeleteApiRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteApi(ApiName name)

  • deleteApi(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteApiCallable()

ListApiVersions

Returns matching versions.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listApiVersions(ListApiVersionsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listApiVersions(ApiName parent)

  • listApiVersions(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listApiVersionsPagedCallable()

  • listApiVersionsCallable()

GetApiVersion

Returns a specified version.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getApiVersion(GetApiVersionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getApiVersion(ApiVersionName name)

  • getApiVersion(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getApiVersionCallable()

CreateApiVersion

Creates a specified version.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createApiVersion(CreateApiVersionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createApiVersion(ApiName parent, ApiVersion apiVersion, String apiVersionId)

  • createApiVersion(String parent, ApiVersion apiVersion, String apiVersionId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createApiVersionCallable()

UpdateApiVersion

Used to modify a specified version.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateApiVersion(UpdateApiVersionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateApiVersion(ApiVersion apiVersion, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateApiVersionCallable()

DeleteApiVersion

Removes a specified version and all of the resources that it owns.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteApiVersion(DeleteApiVersionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteApiVersion(ApiVersionName name)

  • deleteApiVersion(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteApiVersionCallable()

ListApiSpecs

Returns matching specs.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listApiSpecs(ListApiSpecsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listApiSpecs(ApiVersionName parent)

  • listApiSpecs(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listApiSpecsPagedCallable()

  • listApiSpecsCallable()

GetApiSpec

Returns a specified spec.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getApiSpec(GetApiSpecRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getApiSpec(ApiSpecName name)

  • getApiSpec(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getApiSpecCallable()

GetApiSpecContents

Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getApiSpecContents(GetApiSpecContentsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getApiSpecContents(ApiSpecName name)

  • getApiSpecContents(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getApiSpecContentsCallable()

CreateApiSpec

Creates a specified spec.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createApiSpec(CreateApiSpecRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createApiSpec(ApiVersionName parent, ApiSpec apiSpec, String apiSpecId)

  • createApiSpec(String parent, ApiSpec apiSpec, String apiSpecId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createApiSpecCallable()

UpdateApiSpec

Used to modify a specified spec.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateApiSpec(UpdateApiSpecRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateApiSpec(ApiSpec apiSpec, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateApiSpecCallable()

DeleteApiSpec

Removes a specified spec, all revisions, and all child resources (e.g., artifacts).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteApiSpec(DeleteApiSpecRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteApiSpec(ApiSpecName name)

  • deleteApiSpec(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteApiSpecCallable()

TagApiSpecRevision

Adds a tag to a specified revision of a spec.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • tagApiSpecRevision(TagApiSpecRevisionRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • tagApiSpecRevisionCallable()

ListApiSpecRevisions

Lists all revisions of a spec. Revisions are returned in descending order of revision creation time.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listApiSpecRevisions(ListApiSpecRevisionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listApiSpecRevisionsPagedCallable()

  • listApiSpecRevisionsCallable()

RollbackApiSpec

Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • rollbackApiSpec(RollbackApiSpecRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • rollbackApiSpecCallable()

DeleteApiSpecRevision

Deletes a revision of a spec.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteApiSpecRevision(DeleteApiSpecRevisionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteApiSpecRevision(ApiSpecName name)

  • deleteApiSpecRevision(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteApiSpecRevisionCallable()

ListApiDeployments

Returns matching deployments.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listApiDeployments(ListApiDeploymentsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listApiDeployments(ApiName parent)

  • listApiDeployments(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listApiDeploymentsPagedCallable()

  • listApiDeploymentsCallable()

GetApiDeployment

Returns a specified deployment.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getApiDeployment(GetApiDeploymentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getApiDeployment(ApiDeploymentName name)

  • getApiDeployment(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getApiDeploymentCallable()

CreateApiDeployment

Creates a specified deployment.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createApiDeployment(CreateApiDeploymentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createApiDeployment(ApiName parent, ApiDeployment apiDeployment, String apiDeploymentId)

  • createApiDeployment(String parent, ApiDeployment apiDeployment, String apiDeploymentId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createApiDeploymentCallable()

UpdateApiDeployment

Used to modify a specified deployment.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateApiDeployment(UpdateApiDeploymentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateApiDeployment(ApiDeployment apiDeployment, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateApiDeploymentCallable()

DeleteApiDeployment

Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteApiDeployment(DeleteApiDeploymentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteApiDeployment(ApiDeploymentName name)

  • deleteApiDeployment(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteApiDeploymentCallable()

TagApiDeploymentRevision

Adds a tag to a specified revision of a deployment.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • tagApiDeploymentRevision(TagApiDeploymentRevisionRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • tagApiDeploymentRevisionCallable()

ListApiDeploymentRevisions

Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listApiDeploymentRevisions(ListApiDeploymentRevisionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listApiDeploymentRevisionsPagedCallable()

  • listApiDeploymentRevisionsCallable()

RollbackApiDeployment

Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • rollbackApiDeployment(RollbackApiDeploymentRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • rollbackApiDeploymentCallable()

DeleteApiDeploymentRevision

Deletes a revision of a deployment.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteApiDeploymentRevision(DeleteApiDeploymentRevisionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteApiDeploymentRevision(ApiDeploymentName name)

  • deleteApiDeploymentRevision(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteApiDeploymentRevisionCallable()

ListArtifacts

Returns matching artifacts.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listArtifacts(ListArtifactsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listArtifacts(ApiDeploymentName parent)

  • listArtifacts(ApiName parent)

  • listArtifacts(ApiSpecName parent)

  • listArtifacts(ApiVersionName parent)

  • listArtifacts(LocationName parent)

  • listArtifacts(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listArtifactsPagedCallable()

  • listArtifactsCallable()

GetArtifact

Returns a specified artifact.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getArtifact(GetArtifactRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getArtifact(ArtifactName name)

  • getArtifact(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getArtifactCallable()

GetArtifactContents

Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getArtifactContents(GetArtifactContentsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getArtifactContents(ArtifactName name)

  • getArtifactContents(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getArtifactContentsCallable()

CreateArtifact

Creates a specified artifact.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createArtifact(CreateArtifactRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createArtifact(ApiDeploymentName parent, Artifact artifact, String artifactId)

  • createArtifact(ApiName parent, Artifact artifact, String artifactId)

  • createArtifact(ApiSpecName parent, Artifact artifact, String artifactId)

  • createArtifact(ApiVersionName parent, Artifact artifact, String artifactId)

  • createArtifact(LocationName parent, Artifact artifact, String artifactId)

  • createArtifact(String parent, Artifact artifact, String artifactId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createArtifactCallable()

ReplaceArtifact

Used to replace a specified artifact.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • replaceArtifact(ReplaceArtifactRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • replaceArtifact(Artifact artifact)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • replaceArtifactCallable()

DeleteArtifact

Removes a specified artifact.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteArtifact(DeleteArtifactRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteArtifact(ArtifactName name)

  • deleteArtifact(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteArtifactCallable()

ListLocations

Lists information about the supported locations for this service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

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 RegistrySettings 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
 RegistrySettings registrySettings =
     RegistrySettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 RegistryClient registryClient = RegistryClient.create(registrySettings);
 

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
 RegistrySettings registrySettings =
     RegistrySettings.newBuilder().setEndpoint(myEndpoint).build();
 RegistryClient registryClient = RegistryClient.create(registrySettings);
 

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
 RegistrySettings registrySettings = RegistrySettings.newHttpJsonBuilder().build();
 RegistryClient registryClient = RegistryClient.create(registrySettings);
 

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

Inheritance

java.lang.Object > RegistryClient

Static Methods

create()

public static final RegistryClient create()

Constructs an instance of RegistryClient with default settings.

Returns
TypeDescription
RegistryClient
Exceptions
TypeDescription
IOException

create(RegistrySettings settings)

public static final RegistryClient create(RegistrySettings settings)

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

Parameter
NameDescription
settingsRegistrySettings
Returns
TypeDescription
RegistryClient
Exceptions
TypeDescription
IOException

create(RegistryStub stub)

public static final RegistryClient create(RegistryStub stub)

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

Parameter
NameDescription
stubRegistryStub
Returns
TypeDescription
RegistryClient

Constructors

RegistryClient(RegistrySettings settings)

protected RegistryClient(RegistrySettings settings)

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

Parameter
NameDescription
settingsRegistrySettings

RegistryClient(RegistryStub stub)

protected RegistryClient(RegistryStub stub)
Parameter
NameDescription
stubRegistryStub

Methods

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()

createApi(CreateApiRequest request)

public final Api createApi(CreateApiRequest request)

Creates a specified API.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   CreateApiRequest request =
       CreateApiRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setApi(Api.newBuilder().build())
           .setApiId("apiId93021397")
           .build();
   Api response = registryClient.createApi(request);
 }
 
Parameter
NameDescription
requestCreateApiRequest

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

Returns
TypeDescription
Api

createApi(LocationName parent, Api api, String apiId)

public final Api createApi(LocationName parent, Api api, String apiId)

Creates a specified API.

Sample code:


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

Required. The parent, which owns this collection of APIs. Format: projects/*/locations/*

apiApi

Required. The API to create.

apiIdString

Required. The ID to use for the API, which will become the final component of the API's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Api

createApi(String parent, Api api, String apiId)

public final Api createApi(String parent, Api api, String apiId)

Creates a specified API.

Sample code:


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

Required. The parent, which owns this collection of APIs. Format: projects/*/locations/*

apiApi

Required. The API to create.

apiIdString

Required. The ID to use for the API, which will become the final component of the API's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Api

createApiCallable()

public final UnaryCallable<CreateApiRequest,Api> createApiCallable()

Creates a specified API.

Sample code:


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

createApiDeployment(ApiName parent, ApiDeployment apiDeployment, String apiDeploymentId)

public final ApiDeployment createApiDeployment(ApiName parent, ApiDeployment apiDeployment, String apiDeploymentId)

Creates a specified deployment.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
   ApiDeployment apiDeployment = ApiDeployment.newBuilder().build();
   String apiDeploymentId = "apiDeploymentId-1299472902";
   ApiDeployment response =
       registryClient.createApiDeployment(parent, apiDeployment, apiDeploymentId);
 }
 
Parameters
NameDescription
parentApiName

Required. The parent, which owns this collection of deployments. Format: projects/*/locations/*/apis/*

apiDeploymentApiDeployment

Required. The deployment to create.

apiDeploymentIdString

Required. The ID to use for the deployment, which will become the final component of the deployment's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
ApiDeployment

createApiDeployment(CreateApiDeploymentRequest request)

public final ApiDeployment createApiDeployment(CreateApiDeploymentRequest request)

Creates a specified deployment.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   CreateApiDeploymentRequest request =
       CreateApiDeploymentRequest.newBuilder()
           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
           .setApiDeployment(ApiDeployment.newBuilder().build())
           .setApiDeploymentId("apiDeploymentId-1299472902")
           .build();
   ApiDeployment response = registryClient.createApiDeployment(request);
 }
 
Parameter
NameDescription
requestCreateApiDeploymentRequest

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

Returns
TypeDescription
ApiDeployment

createApiDeployment(String parent, ApiDeployment apiDeployment, String apiDeploymentId)

public final ApiDeployment createApiDeployment(String parent, ApiDeployment apiDeployment, String apiDeploymentId)

Creates a specified deployment.

Sample code:


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

Required. The parent, which owns this collection of deployments. Format: projects/*/locations/*/apis/*

apiDeploymentApiDeployment

Required. The deployment to create.

apiDeploymentIdString

Required. The ID to use for the deployment, which will become the final component of the deployment's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
ApiDeployment

createApiDeploymentCallable()

public final UnaryCallable<CreateApiDeploymentRequest,ApiDeployment> createApiDeploymentCallable()

Creates a specified deployment.

Sample code:


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

createApiSpec(ApiVersionName parent, ApiSpec apiSpec, String apiSpecId)

public final ApiSpec createApiSpec(ApiVersionName parent, ApiSpec apiSpec, String apiSpecId)

Creates a specified spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   ApiVersionName parent = ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
   ApiSpec apiSpec = ApiSpec.newBuilder().build();
   String apiSpecId = "apiSpecId-421795600";
   ApiSpec response = registryClient.createApiSpec(parent, apiSpec, apiSpecId);
 }
 
Parameters
NameDescription
parentApiVersionName

Required. The parent, which owns this collection of specs. Format: projects/*/locations/*/apis/*/versions/*

apiSpecApiSpec

Required. The spec to create.

apiSpecIdString

Required. The ID to use for the spec, which will become the final component of the spec's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
ApiSpec

createApiSpec(CreateApiSpecRequest request)

public final ApiSpec createApiSpec(CreateApiSpecRequest request)

Creates a specified spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   CreateApiSpecRequest request =
       CreateApiSpecRequest.newBuilder()
           .setParent(
               ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setApiSpec(ApiSpec.newBuilder().build())
           .setApiSpecId("apiSpecId-421795600")
           .build();
   ApiSpec response = registryClient.createApiSpec(request);
 }
 
Parameter
NameDescription
requestCreateApiSpecRequest

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

Returns
TypeDescription
ApiSpec

createApiSpec(String parent, ApiSpec apiSpec, String apiSpecId)

public final ApiSpec createApiSpec(String parent, ApiSpec apiSpec, String apiSpecId)

Creates a specified spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   String parent = ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
   ApiSpec apiSpec = ApiSpec.newBuilder().build();
   String apiSpecId = "apiSpecId-421795600";
   ApiSpec response = registryClient.createApiSpec(parent, apiSpec, apiSpecId);
 }
 
Parameters
NameDescription
parentString

Required. The parent, which owns this collection of specs. Format: projects/*/locations/*/apis/*/versions/*

apiSpecApiSpec

Required. The spec to create.

apiSpecIdString

Required. The ID to use for the spec, which will become the final component of the spec's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
ApiSpec

createApiSpecCallable()

public final UnaryCallable<CreateApiSpecRequest,ApiSpec> createApiSpecCallable()

Creates a specified spec.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   CreateApiSpecRequest request =
       CreateApiSpecRequest.newBuilder()
           .setParent(
               ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setApiSpec(ApiSpec.newBuilder().build())
           .setApiSpecId("apiSpecId-421795600")
           .build();
   ApiFuture<ApiSpec> future = registryClient.createApiSpecCallable().futureCall(request);
   // Do something.
   ApiSpec response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateApiSpecRequest,ApiSpec>

createApiVersion(ApiName parent, ApiVersion apiVersion, String apiVersionId)

public final ApiVersion createApiVersion(ApiName parent, ApiVersion apiVersion, String apiVersionId)

Creates a specified version.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
   ApiVersion apiVersion = ApiVersion.newBuilder().build();
   String apiVersionId = "apiVersionId1678816025";
   ApiVersion response = registryClient.createApiVersion(parent, apiVersion, apiVersionId);
 }
 
Parameters
NameDescription
parentApiName

Required. The parent, which owns this collection of versions. Format: projects/*/locations/*/apis/*

apiVersionApiVersion

Required. The version to create.

apiVersionIdString

Required. The ID to use for the version, which will become the final component of the version's resource name.

This value should be 1-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
ApiVersion

createApiVersion(CreateApiVersionRequest request)

public final ApiVersion createApiVersion(CreateApiVersionRequest request)

Creates a specified version.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   CreateApiVersionRequest request =
       CreateApiVersionRequest.newBuilder()
           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
           .setApiVersion(ApiVersion.newBuilder().build())
           .setApiVersionId("apiVersionId1678816025")
           .build();
   ApiVersion response = registryClient.createApiVersion(request);
 }
 
Parameter
NameDescription
requestCreateApiVersionRequest

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

Returns
TypeDescription
ApiVersion

createApiVersion(String parent, ApiVersion apiVersion, String apiVersionId)

public final ApiVersion createApiVersion(String parent, ApiVersion apiVersion, String apiVersionId)

Creates a specified version.

Sample code:


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

Required. The parent, which owns this collection of versions. Format: projects/*/locations/*/apis/*

apiVersionApiVersion

Required. The version to create.

apiVersionIdString

Required. The ID to use for the version, which will become the final component of the version's resource name.

This value should be 1-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
ApiVersion

createApiVersionCallable()

public final UnaryCallable<CreateApiVersionRequest,ApiVersion> createApiVersionCallable()

Creates a specified version.

Sample code:


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

createArtifact(ApiDeploymentName parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(ApiDeploymentName parent, Artifact artifact, String artifactId)

Creates a specified artifact.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   ApiDeploymentName parent =
       ApiDeploymentName.of("[PROJECT]", "[LOCATION]", "[API]", "[DEPLOYMENT]");
   Artifact artifact = Artifact.newBuilder().build();
   String artifactId = "artifactId240640653";
   Artifact response = registryClient.createArtifact(parent, artifact, artifactId);
 }
 
Parameters
NameDescription
parentApiDeploymentName

Required. The parent, which owns this collection of artifacts. Format: {parent}

artifactArtifact

Required. The artifact to create.

artifactIdString

Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Artifact

createArtifact(ApiName parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(ApiName parent, Artifact artifact, String artifactId)

Creates a specified artifact.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]");
   Artifact artifact = Artifact.newBuilder().build();
   String artifactId = "artifactId240640653";
   Artifact response = registryClient.createArtifact(parent, artifact, artifactId);
 }
 
Parameters
NameDescription
parentApiName

Required. The parent, which owns this collection of artifacts. Format: {parent}

artifactArtifact

Required. The artifact to create.

artifactIdString

Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Artifact

createArtifact(ApiSpecName parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(ApiSpecName parent, Artifact artifact, String artifactId)

Creates a specified artifact.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   ApiSpecName parent =
       ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]");
   Artifact artifact = Artifact.newBuilder().build();
   String artifactId = "artifactId240640653";
   Artifact response = registryClient.createArtifact(parent, artifact, artifactId);
 }
 
Parameters
NameDescription
parentApiSpecName

Required. The parent, which owns this collection of artifacts. Format: {parent}

artifactArtifact

Required. The artifact to create.

artifactIdString

Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Artifact

createArtifact(ApiVersionName parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(ApiVersionName parent, Artifact artifact, String artifactId)

Creates a specified artifact.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   ApiVersionName parent = ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
   Artifact artifact = Artifact.newBuilder().build();
   String artifactId = "artifactId240640653";
   Artifact response = registryClient.createArtifact(parent, artifact, artifactId);
 }
 
Parameters
NameDescription
parentApiVersionName

Required. The parent, which owns this collection of artifacts. Format: {parent}

artifactArtifact

Required. The artifact to create.

artifactIdString

Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Artifact

createArtifact(CreateArtifactRequest request)

public final Artifact createArtifact(CreateArtifactRequest request)

Creates a specified artifact.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   CreateArtifactRequest request =
       CreateArtifactRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setArtifact(Artifact.newBuilder().build())
           .setArtifactId("artifactId240640653")
           .build();
   Artifact response = registryClient.createArtifact(request);
 }
 
Parameter
NameDescription
requestCreateArtifactRequest

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

Returns
TypeDescription
Artifact

createArtifact(LocationName parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(LocationName parent, Artifact artifact, String artifactId)

Creates a specified artifact.

Sample code:


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

Required. The parent, which owns this collection of artifacts. Format: {parent}

artifactArtifact

Required. The artifact to create.

artifactIdString

Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Artifact

createArtifact(String parent, Artifact artifact, String artifactId)

public final Artifact createArtifact(String parent, Artifact artifact, String artifactId)

Creates a specified artifact.

Sample code:


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

Required. The parent, which owns this collection of artifacts. Format: {parent}

artifactArtifact

Required. The artifact to create.

artifactIdString

Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Following AIP-162, IDs must not have the form of a UUID.

Returns
TypeDescription
Artifact

createArtifactCallable()

public final UnaryCallable<CreateArtifactRequest,Artifact> createArtifactCallable()

Creates a specified artifact.

Sample code:


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

deleteApi(ApiName name)

public final void deleteApi(ApiName name)

Removes a specified API and all of the resources that it owns.

Sample code:


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

Required. The name of the API to delete. Format: projects/*/locations/*/apis/*

deleteApi(DeleteApiRequest request)

public final void deleteApi(DeleteApiRequest request)

Removes a specified API and all of the resources that it owns.

Sample code:


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

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

deleteApi(String name)

public final void deleteApi(String name)

Removes a specified API and all of the resources that it owns.

Sample code:


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

Required. The name of the API to delete. Format: projects/*/locations/*/apis/*

deleteApiCallable()

public final UnaryCallable<DeleteApiRequest,Empty> deleteApiCallable()

Removes a specified API and all of the resources that it owns.

Sample code:


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

deleteApiDeployment(ApiDeploymentName name)

public final void deleteApiDeployment(ApiDeploymentName name)

Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).

Sample code:


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

Required. The name of the deployment to delete. Format: projects/*/locations/*/apis/*/deployments/*

deleteApiDeployment(DeleteApiDeploymentRequest request)

public final void deleteApiDeployment(DeleteApiDeploymentRequest request)

Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).

Sample code:


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

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

deleteApiDeployment(String name)

public final void deleteApiDeployment(String name)

Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).

Sample code:


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

Required. The name of the deployment to delete. Format: projects/*/locations/*/apis/*/deployments/*

deleteApiDeploymentCallable()

public final UnaryCallable<DeleteApiDeploymentRequest,Empty> deleteApiDeploymentCallable()

Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).

Sample code:


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

deleteApiDeploymentRevision(ApiDeploymentName name)

public final ApiDeployment deleteApiDeploymentRevision(ApiDeploymentName name)

Deletes a revision of a deployment.

Sample code:


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

Required. The name of the deployment revision to be deleted, with a revision ID explicitly included.

Example: projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8

Returns
TypeDescription
ApiDeployment

deleteApiDeploymentRevision(DeleteApiDeploymentRevisionRequest request)

public final ApiDeployment deleteApiDeploymentRevision(DeleteApiDeploymentRevisionRequest request)

Deletes a revision of a deployment.

Sample code:


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

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

Returns
TypeDescription
ApiDeployment

deleteApiDeploymentRevision(String name)

public final ApiDeployment deleteApiDeploymentRevision(String name)

Deletes a revision of a deployment.

Sample code:


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

Required. The name of the deployment revision to be deleted, with a revision ID explicitly included.

Example: projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8

Returns
TypeDescription
ApiDeployment

deleteApiDeploymentRevisionCallable()

public final UnaryCallable<DeleteApiDeploymentRevisionRequest,ApiDeployment> deleteApiDeploymentRevisionCallable()

Deletes a revision of a deployment.

Sample code:


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

deleteApiSpec(ApiSpecName name)

public final void deleteApiSpec(ApiSpecName name)

Removes a specified spec, all revisions, and all child resources (e.g., artifacts).

Sample code:


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

Required. The name of the spec to delete. Format: projects/*/locations/*/apis/*/versions/*/specs/*

deleteApiSpec(DeleteApiSpecRequest request)

public final void deleteApiSpec(DeleteApiSpecRequest request)

Removes a specified spec, all revisions, and all child resources (e.g., artifacts).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegistryClient registryClient = RegistryClient.create()) {
   DeleteApiSpecRequest request =
       DeleteApiSpecRequest.newBuilder()
           .setName(
               ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]")
                   .toString())
           .setForce(true)
           .build();
   registryClient.deleteApiSpec(request);
 }
 
Parameter
NameDescription
requestDeleteApiSpecRequest

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

deleteApiSpec(String name)

public final void deleteApiSpec(String name)

Removes a specified spec, all revisions, and all child resources (e.g., artifacts).

Sample code:


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

Required. The name of the spec to delete. Format: projects/*/locations/*/apis/*/versions/*/specs/*

deleteApiSpecCallable()

public final UnaryCallable<DeleteApiSpecRequest,Empty> deleteApiSpecCallable()

Removes a specified spec, all revisions, and all child resources (e.g., artifacts).

Sample code:


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

deleteApiSpecRevision(ApiSpecName name)

public final ApiSpec deleteApiSpecRevision(ApiSpecName name)

Deletes a revision of a spec.

Sample code:


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

Required. The name of the spec revision to be deleted, with a revision ID explicitly included.

Example: projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8

Returns
TypeDescription
ApiSpec

deleteApiSpecRevision(DeleteApiSpecRevisionRequest request)

public final ApiSpec deleteApiSpecRevision(DeleteApiSpecRevisionRequest request)

Deletes a revision of a spec.

Sample code:


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

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

Returns
TypeDescription
ApiSpec

deleteApiSpecRevision(String name)

public final ApiSpec deleteApiSpecRevision(String name)

Deletes a revision of a spec.

Sample code:


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

Required. The name of the spec revision to be deleted, with a revision ID explicitly included.

Example: projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8

Returns
TypeDescription
ApiSpec

deleteApiSpecRevisionCallable()

public final UnaryCallable<DeleteApiSpecRevisionRequest,ApiSpec> deleteApiSpecRevisionCallable()

Deletes a revision of a spec.

Sample code:


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

deleteApiVersion(ApiVersionName name)

public final void deleteApiVersion(ApiVersionName name)

Removes a specified version and all of the resources that it owns.

Sample code:


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

Required. The name of the version to delete. Format: projects/*/locations/*/apis/*/versions/*

deleteApiVersion(DeleteApiVersionRequest request)

public final void deleteApiVersion(DeleteApiVersionRequest request)

Removes a specified version and all of the resources that it owns.

Sample code:


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

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

deleteApiVersion(String name)

public final void deleteApiVersion(String name)

Removes a specified version and all of the resources that it owns.

Sample code:


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

Required. The name of the version to delete. Format: projects/*/locations/*/apis/*/versions/*

deleteApiVersionCallable()

public final UnaryCallable<DeleteApiVersionRequest,Empty> deleteApiVersionCallable()

Removes a specified version and all of the resources that it owns.

Sample code:


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

deleteArtifact(ArtifactName name)

public final void deleteArtifact(ArtifactName name)

Removes a specified artifact.

Sample code:


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

Required. The name of the artifact to delete. Format: {parent}/artifacts/*

deleteArtifact(DeleteArtifactRequest request)

public final void deleteArtifact(DeleteArtifactRequest request)

Removes a specified artifact.

Sample code:


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

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

deleteArtifact(String name)

public final void deleteArtifact(String name)

Removes a specified artifact.

Sample code:


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

Required. The name of the artifact to delete. Format: {parent}/artifacts/*

deleteArtifactCallable()

public final UnaryCallable<DeleteArtifactRequest,Empty> deleteArtifactCallable()

Removes a specified artifact.

Sample code:


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

getApi(ApiName name)

public final Api getApi(ApiName name)

Returns a specified API.

Sample code:


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

Required. The name of the API to retrieve. Format: projects/*/locations/*/apis/*

Returns
TypeDescription
Api

getApi(GetApiRequest request)

public final Api getApi(GetApiRequest request)

Returns a specified API.

Sample code:


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

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

Returns
TypeDescription
Api

getApi(String name)

public final Api getApi(String name)

Returns a specified API.

Sample code:


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

Required. The name of the API to retrieve. Format: projects/*/locations/*/apis/*

Returns
TypeDescription
Api

getApiCallable()

public final UnaryCallable<GetApiRequest,Api> getApiCallable()

Returns a specified API.

Sample code:


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

getApiDeployment(ApiDeploymentName name)

public final ApiDeployment getApiDeployment(ApiDeploymentName name)

Returns a specified deployment.

Sample code:


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

Required. The name of the deployment to retrieve. Format: projects/*/locations/*/apis/*/deployments/*

Returns
TypeDescription
ApiDeployment

getApiDeployment(GetApiDeploymentRequest request)

public final ApiDeployment getApiDeployment(GetApiDeploymentRequest request)

Returns a specified deployment.

Sample code:


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

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

Returns
TypeDescription
ApiDeployment

getApiDeployment(String name)

public final ApiDeployment getApiDeployment(String name)

Returns a specified deployment.

Sample code:


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

Required. The name of the deployment to retrieve. Format: projects/*/locations/*/apis/*/deployments/*

Returns
TypeDescription
ApiDeployment

getApiDeploymentCallable()

public final UnaryCallable<GetApiDeploymentRequest,ApiDeployment> getApiDeploymentCallable()

Returns a specified deployment.

Sample code:


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

getApiSpec(ApiSpecName name)

public final ApiSpec getApiSpec(ApiSpecName name)

Returns a specified spec.

Sample code:


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

Required. The name of the spec to retrieve. Format: projects/*/locations/*/apis/*/versions/*/specs/*

Returns
TypeDescription
ApiSpec

getApiSpec(GetApiSpecRequest request)

public final ApiSpec getApiSpec(GetApiSpecRequest request)

Returns a specified spec.

Sample code:


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

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

Returns
TypeDescription
ApiSpec

getApiSpec(String name)

public final ApiSpec getApiSpec(String name)

Returns a specified spec.

Sample code:


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

Required. The name of the spec to retrieve. Format: projects/*/locations/*/apis/*/versions/*/specs/*

Returns
TypeDescription
ApiSpec

getApiSpecCallable()

public final UnaryCallable<GetApiSpecRequest,ApiSpec> getApiSpecCallable()

Returns a specified spec.

Sample code:


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

getApiSpecContents(ApiSpecName name)

public final HttpBody getApiSpecContents(ApiSpecName name)

Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

Required. The name of the spec whose contents should be retrieved. Format: projects/*/locations/*/apis/*/versions/*/specs/*

Returns
TypeDescription
com.google.api.HttpBody

getApiSpecContents(GetApiSpecContentsRequest request)

public final HttpBody getApiSpecContents(GetApiSpecContentsRequest request)

Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

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

Returns
TypeDescription
com.google.api.HttpBody

getApiSpecContents(String name)

public final HttpBody getApiSpecContents(String name)

Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

Required. The name of the spec whose contents should be retrieved. Format: projects/*/locations/*/apis/*/versions/*/specs/*

Returns
TypeDescription
com.google.api.HttpBody

getApiSpecContentsCallable()

public final UnaryCallable<GetApiSpecContentsRequest,HttpBody> getApiSpecContentsCallable()

Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

getApiVersion(ApiVersionName name)

public final ApiVersion getApiVersion(ApiVersionName name)

Returns a specified version.

Sample code:


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

Required. The name of the version to retrieve. Format: projects/*/locations/*/apis/*/versions/*

Returns
TypeDescription
ApiVersion

getApiVersion(GetApiVersionRequest request)

public final ApiVersion getApiVersion(GetApiVersionRequest request)

Returns a specified version.

Sample code:


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

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

Returns
TypeDescription
ApiVersion

getApiVersion(String name)

public final ApiVersion getApiVersion(String name)

Returns a specified version.

Sample code:


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

Required. The name of the version to retrieve. Format: projects/*/locations/*/apis/*/versions/*

Returns
TypeDescription
ApiVersion

getApiVersionCallable()

public final UnaryCallable<GetApiVersionRequest,ApiVersion> getApiVersionCallable()

Returns a specified version.

Sample code:


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

getArtifact(ArtifactName name)

public final Artifact getArtifact(ArtifactName name)

Returns a specified artifact.

Sample code:


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

Required. The name of the artifact to retrieve. Format: {parent}/artifacts/*

Returns
TypeDescription
Artifact

getArtifact(GetArtifactRequest request)

public final Artifact getArtifact(GetArtifactRequest request)

Returns a specified artifact.

Sample code:


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

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

Returns
TypeDescription
Artifact

getArtifact(String name)

public final Artifact getArtifact(String name)

Returns a specified artifact.

Sample code:


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

Required. The name of the artifact to retrieve. Format: {parent}/artifacts/*

Returns
TypeDescription
Artifact

getArtifactCallable()

public final UnaryCallable<GetArtifactRequest,Artifact> getArtifactCallable()

Returns a specified artifact.

Sample code:


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

getArtifactContents(ArtifactName name)

public final HttpBody getArtifactContents(ArtifactName name)

Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

Required. The name of the artifact whose contents should be retrieved. Format: {parent}/artifacts/*

Returns
TypeDescription
com.google.api.HttpBody

getArtifactContents(GetArtifactContentsRequest request)

public final HttpBody getArtifactContents(GetArtifactContentsRequest request)

Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

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

Returns
TypeDescription
com.google.api.HttpBody

getArtifactContents(String name)

public final HttpBody getArtifactContents(String name)

Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

Required. The name of the artifact whose contents should be retrieved. Format: {parent}/artifacts/*

Returns
TypeDescription
com.google.api.HttpBody

getArtifactContentsCallable()

public final UnaryCallable<GetArtifactContentsRequest,HttpBody> getArtifactContentsCallable()

Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).

Sample code:


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

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


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

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

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Sample code:


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

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


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

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

Returns
TypeDescription
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


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

getSettings()

public final RegistrySettings getSettings()
Returns
TypeDescription
RegistrySettings

getStub()

public RegistryStub getStub()
Returns
TypeDescription
RegistryStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listApiDeploymentRevisions(ListApiDeploymentRevisionsRequest request)

public final RegistryClient.ListApiDeploymentRevisionsPagedResponse listApiDeploymentRevisions(ListApiDeploymentRevisionsRequest request)

Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.

Sample code:


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

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

Returns
TypeDescription
RegistryClient.ListApiDeploymentRevisionsPagedResponse

listApiDeploymentRevisionsCallable()

public final UnaryCallable<ListApiDeploymentRevisionsRequest,ListApiDeploymentRevisionsResponse> listApiDeploymentRevisionsCallable()

Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.

Sample code:


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

listApiDeploymentRevisionsPagedCallable()