Class RegistryClient
- java.lang.Object
-
- com.google.cloud.apigeeregistry.v1.RegistryClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource,AutoCloseable
@Generated("by gapic-generator-java") public class RegistryClient extends Object implements com.google.api.gax.core.BackgroundResource
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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
-
-
Nested Class Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedRegistryClient(RegistrySettings settings)Constructs an instance of RegistryClient, using the given settings.protectedRegistryClient(RegistryStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long duration, TimeUnit unit)voidclose()static RegistryClientcreate()Constructs an instance of RegistryClient with default settings.static RegistryClientcreate(RegistrySettings settings)Constructs an instance of RegistryClient, using the given settings.static RegistryClientcreate(RegistryStub stub)Constructs an instance of RegistryClient, using the given stub for making calls.ApicreateApi(CreateApiRequest request)Creates a specified API.ApicreateApi(LocationName parent, Api api, String apiId)Creates a specified API.ApicreateApi(String parent, Api api, String apiId)Creates a specified API.com.google.api.gax.rpc.UnaryCallable<CreateApiRequest,Api>createApiCallable()Creates a specified API.ApiDeploymentcreateApiDeployment(ApiName parent, ApiDeployment apiDeployment, String apiDeploymentId)Creates a specified deployment.ApiDeploymentcreateApiDeployment(CreateApiDeploymentRequest request)Creates a specified deployment.ApiDeploymentcreateApiDeployment(String parent, ApiDeployment apiDeployment, String apiDeploymentId)Creates a specified deployment.com.google.api.gax.rpc.UnaryCallable<CreateApiDeploymentRequest,ApiDeployment>createApiDeploymentCallable()Creates a specified deployment.ApiSpeccreateApiSpec(ApiVersionName parent, ApiSpec apiSpec, String apiSpecId)Creates a specified spec.ApiSpeccreateApiSpec(CreateApiSpecRequest request)Creates a specified spec.ApiSpeccreateApiSpec(String parent, ApiSpec apiSpec, String apiSpecId)Creates a specified spec.com.google.api.gax.rpc.UnaryCallable<CreateApiSpecRequest,ApiSpec>createApiSpecCallable()Creates a specified spec.ApiVersioncreateApiVersion(ApiName parent, ApiVersion apiVersion, String apiVersionId)Creates a specified version.ApiVersioncreateApiVersion(CreateApiVersionRequest request)Creates a specified version.ApiVersioncreateApiVersion(String parent, ApiVersion apiVersion, String apiVersionId)Creates a specified version.com.google.api.gax.rpc.UnaryCallable<CreateApiVersionRequest,ApiVersion>createApiVersionCallable()Creates a specified version.ArtifactcreateArtifact(ApiDeploymentName parent, Artifact artifact, String artifactId)Creates a specified artifact.ArtifactcreateArtifact(ApiName parent, Artifact artifact, String artifactId)Creates a specified artifact.ArtifactcreateArtifact(ApiSpecName parent, Artifact artifact, String artifactId)Creates a specified artifact.ArtifactcreateArtifact(ApiVersionName parent, Artifact artifact, String artifactId)Creates a specified artifact.ArtifactcreateArtifact(CreateArtifactRequest request)Creates a specified artifact.ArtifactcreateArtifact(LocationName parent, Artifact artifact, String artifactId)Creates a specified artifact.ArtifactcreateArtifact(String parent, Artifact artifact, String artifactId)Creates a specified artifact.com.google.api.gax.rpc.UnaryCallable<CreateArtifactRequest,Artifact>createArtifactCallable()Creates a specified artifact.voiddeleteApi(ApiName name)Removes a specified API and all of the resources that it owns.voiddeleteApi(DeleteApiRequest request)Removes a specified API and all of the resources that it owns.voiddeleteApi(String name)Removes a specified API and all of the resources that it owns.com.google.api.gax.rpc.UnaryCallable<DeleteApiRequest,com.google.protobuf.Empty>deleteApiCallable()Removes a specified API and all of the resources that it owns.voiddeleteApiDeployment(ApiDeploymentName name)Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).voiddeleteApiDeployment(DeleteApiDeploymentRequest request)Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).voiddeleteApiDeployment(String name)Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).com.google.api.gax.rpc.UnaryCallable<DeleteApiDeploymentRequest,com.google.protobuf.Empty>deleteApiDeploymentCallable()Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).ApiDeploymentdeleteApiDeploymentRevision(ApiDeploymentName name)Deletes a revision of a deployment.ApiDeploymentdeleteApiDeploymentRevision(DeleteApiDeploymentRevisionRequest request)Deletes a revision of a deployment.ApiDeploymentdeleteApiDeploymentRevision(String name)Deletes a revision of a deployment.com.google.api.gax.rpc.UnaryCallable<DeleteApiDeploymentRevisionRequest,ApiDeployment>deleteApiDeploymentRevisionCallable()Deletes a revision of a deployment.voiddeleteApiSpec(ApiSpecName name)Removes a specified spec, all revisions, and all child resources (e.g., artifacts).voiddeleteApiSpec(DeleteApiSpecRequest request)Removes a specified spec, all revisions, and all child resources (e.g., artifacts).voiddeleteApiSpec(String name)Removes a specified spec, all revisions, and all child resources (e.g., artifacts).com.google.api.gax.rpc.UnaryCallable<DeleteApiSpecRequest,com.google.protobuf.Empty>deleteApiSpecCallable()Removes a specified spec, all revisions, and all child resources (e.g., artifacts).ApiSpecdeleteApiSpecRevision(ApiSpecName name)Deletes a revision of a spec.ApiSpecdeleteApiSpecRevision(DeleteApiSpecRevisionRequest request)Deletes a revision of a spec.ApiSpecdeleteApiSpecRevision(String name)Deletes a revision of a spec.com.google.api.gax.rpc.UnaryCallable<DeleteApiSpecRevisionRequest,ApiSpec>deleteApiSpecRevisionCallable()Deletes a revision of a spec.voiddeleteApiVersion(ApiVersionName name)Removes a specified version and all of the resources that it owns.voiddeleteApiVersion(DeleteApiVersionRequest request)Removes a specified version and all of the resources that it owns.voiddeleteApiVersion(String name)Removes a specified version and all of the resources that it owns.com.google.api.gax.rpc.UnaryCallable<DeleteApiVersionRequest,com.google.protobuf.Empty>deleteApiVersionCallable()Removes a specified version and all of the resources that it owns.voiddeleteArtifact(ArtifactName name)Removes a specified artifact.voiddeleteArtifact(DeleteArtifactRequest request)Removes a specified artifact.voiddeleteArtifact(String name)Removes a specified artifact.com.google.api.gax.rpc.UnaryCallable<DeleteArtifactRequest,com.google.protobuf.Empty>deleteArtifactCallable()Removes a specified artifact.ApigetApi(ApiName name)Returns a specified API.ApigetApi(GetApiRequest request)Returns a specified API.ApigetApi(String name)Returns a specified API.com.google.api.gax.rpc.UnaryCallable<GetApiRequest,Api>getApiCallable()Returns a specified API.ApiDeploymentgetApiDeployment(ApiDeploymentName name)Returns a specified deployment.ApiDeploymentgetApiDeployment(GetApiDeploymentRequest request)Returns a specified deployment.ApiDeploymentgetApiDeployment(String name)Returns a specified deployment.com.google.api.gax.rpc.UnaryCallable<GetApiDeploymentRequest,ApiDeployment>getApiDeploymentCallable()Returns a specified deployment.ApiSpecgetApiSpec(ApiSpecName name)Returns a specified spec.ApiSpecgetApiSpec(GetApiSpecRequest request)Returns a specified spec.ApiSpecgetApiSpec(String name)Returns a specified spec.com.google.api.gax.rpc.UnaryCallable<GetApiSpecRequest,ApiSpec>getApiSpecCallable()Returns a specified spec.com.google.api.HttpBodygetApiSpecContents(ApiSpecName name)Returns the contents of a specified spec.com.google.api.HttpBodygetApiSpecContents(GetApiSpecContentsRequest request)Returns the contents of a specified spec.com.google.api.HttpBodygetApiSpecContents(String name)Returns the contents of a specified spec.com.google.api.gax.rpc.UnaryCallable<GetApiSpecContentsRequest,com.google.api.HttpBody>getApiSpecContentsCallable()Returns the contents of a specified spec.ApiVersiongetApiVersion(ApiVersionName name)Returns a specified version.ApiVersiongetApiVersion(GetApiVersionRequest request)Returns a specified version.ApiVersiongetApiVersion(String name)Returns a specified version.com.google.api.gax.rpc.UnaryCallable<GetApiVersionRequest,ApiVersion>getApiVersionCallable()Returns a specified version.ArtifactgetArtifact(ArtifactName name)Returns a specified artifact.ArtifactgetArtifact(GetArtifactRequest request)Returns a specified artifact.ArtifactgetArtifact(String name)Returns a specified artifact.com.google.api.gax.rpc.UnaryCallable<GetArtifactRequest,Artifact>getArtifactCallable()Returns a specified artifact.com.google.api.HttpBodygetArtifactContents(ArtifactName name)Returns the contents of a specified artifact.com.google.api.HttpBodygetArtifactContents(GetArtifactContentsRequest request)Returns the contents of a specified artifact.com.google.api.HttpBodygetArtifactContents(String name)Returns the contents of a specified artifact.com.google.api.gax.rpc.UnaryCallable<GetArtifactContentsRequest,com.google.api.HttpBody>getArtifactContentsCallable()Returns the contents of a specified artifact.com.google.iam.v1.PolicygetIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)Gets the access control policy for a resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>getIamPolicyCallable()Gets the access control policy for a resource.com.google.cloud.location.LocationgetLocation(com.google.cloud.location.GetLocationRequest request)Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>getLocationCallable()Gets information about a location.RegistrySettingsgetSettings()RegistryStubgetStub()booleanisShutdown()booleanisTerminated()RegistryClient.ListApiDeploymentRevisionsPagedResponselistApiDeploymentRevisions(ListApiDeploymentRevisionsRequest request)Lists all revisions of a deployment.com.google.api.gax.rpc.UnaryCallable<ListApiDeploymentRevisionsRequest,ListApiDeploymentRevisionsResponse>listApiDeploymentRevisionsCallable()Lists all revisions of a deployment.com.google.api.gax.rpc.UnaryCallable<ListApiDeploymentRevisionsRequest,RegistryClient.ListApiDeploymentRevisionsPagedResponse>listApiDeploymentRevisionsPagedCallable()Lists all revisions of a deployment.RegistryClient.ListApiDeploymentsPagedResponselistApiDeployments(ApiName parent)Returns matching deployments.RegistryClient.ListApiDeploymentsPagedResponselistApiDeployments(ListApiDeploymentsRequest request)Returns matching deployments.RegistryClient.ListApiDeploymentsPagedResponselistApiDeployments(String parent)Returns matching deployments.com.google.api.gax.rpc.UnaryCallable<ListApiDeploymentsRequest,ListApiDeploymentsResponse>listApiDeploymentsCallable()Returns matching deployments.com.google.api.gax.rpc.UnaryCallable<ListApiDeploymentsRequest,RegistryClient.ListApiDeploymentsPagedResponse>listApiDeploymentsPagedCallable()Returns matching deployments.RegistryClient.ListApisPagedResponselistApis(ListApisRequest request)Returns matching APIs.RegistryClient.ListApisPagedResponselistApis(LocationName parent)Returns matching APIs.RegistryClient.ListApisPagedResponselistApis(String parent)Returns matching APIs.com.google.api.gax.rpc.UnaryCallable<ListApisRequest,ListApisResponse>listApisCallable()Returns matching APIs.com.google.api.gax.rpc.UnaryCallable<ListApisRequest,RegistryClient.ListApisPagedResponse>listApisPagedCallable()Returns matching APIs.RegistryClient.ListApiSpecRevisionsPagedResponselistApiSpecRevisions(ListApiSpecRevisionsRequest request)Lists all revisions of a spec.com.google.api.gax.rpc.UnaryCallable<ListApiSpecRevisionsRequest,ListApiSpecRevisionsResponse>listApiSpecRevisionsCallable()Lists all revisions of a spec.com.google.api.gax.rpc.UnaryCallable<ListApiSpecRevisionsRequest,RegistryClient.ListApiSpecRevisionsPagedResponse>listApiSpecRevisionsPagedCallable()Lists all revisions of a spec.RegistryClient.ListApiSpecsPagedResponselistApiSpecs(ApiVersionName parent)Returns matching specs.RegistryClient.ListApiSpecsPagedResponselistApiSpecs(ListApiSpecsRequest request)Returns matching specs.RegistryClient.ListApiSpecsPagedResponselistApiSpecs(String parent)Returns matching specs.com.google.api.gax.rpc.UnaryCallable<ListApiSpecsRequest,ListApiSpecsResponse>listApiSpecsCallable()Returns matching specs.com.google.api.gax.rpc.UnaryCallable<ListApiSpecsRequest,RegistryClient.ListApiSpecsPagedResponse>listApiSpecsPagedCallable()Returns matching specs.RegistryClient.ListApiVersionsPagedResponselistApiVersions(ApiName parent)Returns matching versions.RegistryClient.ListApiVersionsPagedResponselistApiVersions(ListApiVersionsRequest request)Returns matching versions.RegistryClient.ListApiVersionsPagedResponselistApiVersions(String parent)Returns matching versions.com.google.api.gax.rpc.UnaryCallable<ListApiVersionsRequest,ListApiVersionsResponse>listApiVersionsCallable()Returns matching versions.com.google.api.gax.rpc.UnaryCallable<ListApiVersionsRequest,RegistryClient.ListApiVersionsPagedResponse>listApiVersionsPagedCallable()Returns matching versions.RegistryClient.ListArtifactsPagedResponselistArtifacts(ApiDeploymentName parent)Returns matching artifacts.RegistryClient.ListArtifactsPagedResponselistArtifacts(ApiName parent)Returns matching artifacts.RegistryClient.ListArtifactsPagedResponselistArtifacts(ApiSpecName parent)Returns matching artifacts.RegistryClient.ListArtifactsPagedResponselistArtifacts(ApiVersionName parent)Returns matching artifacts.RegistryClient.ListArtifactsPagedResponselistArtifacts(ListArtifactsRequest request)Returns matching artifacts.RegistryClient.ListArtifactsPagedResponselistArtifacts(LocationName parent)Returns matching artifacts.RegistryClient.ListArtifactsPagedResponselistArtifacts(String parent)Returns matching artifacts.com.google.api.gax.rpc.UnaryCallable<ListArtifactsRequest,ListArtifactsResponse>listArtifactsCallable()Returns matching artifacts.com.google.api.gax.rpc.UnaryCallable<ListArtifactsRequest,RegistryClient.ListArtifactsPagedResponse>listArtifactsPagedCallable()Returns matching artifacts.RegistryClient.ListLocationsPagedResponselistLocations(com.google.cloud.location.ListLocationsRequest request)Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>listLocationsCallable()Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,RegistryClient.ListLocationsPagedResponse>listLocationsPagedCallable()Lists information about the supported locations for this service.ArtifactreplaceArtifact(Artifact artifact)Used to replace a specified artifact.ArtifactreplaceArtifact(ReplaceArtifactRequest request)Used to replace a specified artifact.com.google.api.gax.rpc.UnaryCallable<ReplaceArtifactRequest,Artifact>replaceArtifactCallable()Used to replace a specified artifact.ApiDeploymentrollbackApiDeployment(RollbackApiDeploymentRequest request)Sets the current revision to a specified prior revision.com.google.api.gax.rpc.UnaryCallable<RollbackApiDeploymentRequest,ApiDeployment>rollbackApiDeploymentCallable()Sets the current revision to a specified prior revision.ApiSpecrollbackApiSpec(RollbackApiSpecRequest request)Sets the current revision to a specified prior revision.com.google.api.gax.rpc.UnaryCallable<RollbackApiSpecRequest,ApiSpec>rollbackApiSpecCallable()Sets the current revision to a specified prior revision.com.google.iam.v1.PolicysetIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)Sets the access control policy on the specified resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>setIamPolicyCallable()Sets the access control policy on the specified resource.voidshutdown()voidshutdownNow()ApiDeploymenttagApiDeploymentRevision(TagApiDeploymentRevisionRequest request)Adds a tag to a specified revision of a deployment.com.google.api.gax.rpc.UnaryCallable<TagApiDeploymentRevisionRequest,ApiDeployment>tagApiDeploymentRevisionCallable()Adds a tag to a specified revision of a deployment.ApiSpectagApiSpecRevision(TagApiSpecRevisionRequest request)Adds a tag to a specified revision of a spec.com.google.api.gax.rpc.UnaryCallable<TagApiSpecRevisionRequest,ApiSpec>tagApiSpecRevisionCallable()Adds a tag to a specified revision of a spec.com.google.iam.v1.TestIamPermissionsResponsetestIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)Returns permissions that a caller has on the specified resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>testIamPermissionsCallable()Returns permissions that a caller has on the specified resource.ApiupdateApi(Api api, com.google.protobuf.FieldMask updateMask)Used to modify a specified API.ApiupdateApi(UpdateApiRequest request)Used to modify a specified API.com.google.api.gax.rpc.UnaryCallable<UpdateApiRequest,Api>updateApiCallable()Used to modify a specified API.ApiDeploymentupdateApiDeployment(ApiDeployment apiDeployment, com.google.protobuf.FieldMask updateMask)Used to modify a specified deployment.ApiDeploymentupdateApiDeployment(UpdateApiDeploymentRequest request)Used to modify a specified deployment.com.google.api.gax.rpc.UnaryCallable<UpdateApiDeploymentRequest,ApiDeployment>updateApiDeploymentCallable()Used to modify a specified deployment.ApiSpecupdateApiSpec(ApiSpec apiSpec, com.google.protobuf.FieldMask updateMask)Used to modify a specified spec.ApiSpecupdateApiSpec(UpdateApiSpecRequest request)Used to modify a specified spec.com.google.api.gax.rpc.UnaryCallable<UpdateApiSpecRequest,ApiSpec>updateApiSpecCallable()Used to modify a specified spec.ApiVersionupdateApiVersion(ApiVersion apiVersion, com.google.protobuf.FieldMask updateMask)Used to modify a specified version.ApiVersionupdateApiVersion(UpdateApiVersionRequest request)Used to modify a specified version.com.google.api.gax.rpc.UnaryCallable<UpdateApiVersionRequest,ApiVersion>updateApiVersionCallable()Used to modify a specified version.
-
-
-
Constructor Detail
-
RegistryClient
protected RegistryClient(RegistrySettings settings) throws IOException
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.- Throws:
IOException
-
RegistryClient
protected RegistryClient(RegistryStub stub)
-
-
Method Detail
-
create
public static final RegistryClient create() throws IOException
Constructs an instance of RegistryClient with default settings.- Throws:
IOException
-
create
public static final RegistryClient create(RegistrySettings settings) throws IOException
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.- Throws:
IOException
-
create
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).
-
getSettings
public final RegistrySettings getSettings()
-
getStub
public RegistryStub getStub()
-
listApis
public final RegistryClient.ListApisPagedResponse listApis(LocationName parent)
Returns matching APIs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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]"); for (Api element : registryClient.listApis(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of APIs. Format: `projects/*/locations/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApis
public final RegistryClient.ListApisPagedResponse listApis(String parent)
Returns matching APIs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); for (Api element : registryClient.listApis(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of APIs. Format: `projects/*/locations/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApis
public final RegistryClient.ListApisPagedResponse listApis(ListApisRequest request)
Returns matching APIs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApisRequest request = ListApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (Api element : registryClient.listApis(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApisPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApisRequest,RegistryClient.ListApisPagedResponse> listApisPagedCallable()
Returns matching APIs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApisRequest request = ListApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<Api> future = registryClient.listApisPagedCallable().futureCall(request); // Do something. for (Api element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApisCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApisRequest,ListApisResponse> listApisCallable()
Returns matching APIs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApisRequest request = ListApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListApisResponse response = registryClient.listApisCallable().call(request); for (Api element : response.getApisList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getApi
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); }- Parameters:
name- Required. The name of the API to retrieve. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApi
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); }- Parameters:
name- Required. The name of the API to retrieve. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApi
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiCallable
public final com.google.api.gax.rpc.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(); }
-
createApi
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:
parent- Required. The parent, which owns this collection of APIs. Format: `projects/*/locations/*`api- Required. The API to create.apiId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApi
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:
parent- Required. The parent, which owns this collection of APIs. Format: `projects/*/locations/*`api- Required. The API to create.apiId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApi
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiCallable
public final com.google.api.gax.rpc.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(); }
-
updateApi
public final Api updateApi(Api api, com.google.protobuf.FieldMask updateMask)
Used to modify 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()) { Api api = Api.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Api response = registryClient.updateApi(api, updateMask); }- Parameters:
api- Required. The API to update.The `name` field is used to identify the API to update. Format: `projects/*/locations/*/apis/*`
updateMask- The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApi
public final Api updateApi(UpdateApiRequest request)
Used to modify 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()) { UpdateApiRequest request = UpdateApiRequest.newBuilder() .setApi(Api.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); Api response = registryClient.updateApi(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApiCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateApiRequest,Api> updateApiCallable()
Used to modify 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()) { UpdateApiRequest request = UpdateApiRequest.newBuilder() .setApi(Api.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Api> future = registryClient.updateApiCallable().futureCall(request); // Do something. Api response = future.get(); }
-
deleteApi
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); }- Parameters:
name- Required. The name of the API to delete. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApi
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); }- Parameters:
name- Required. The name of the API to delete. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApi
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteApiRequest,com.google.protobuf.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(); }
-
listApiVersions
public final RegistryClient.ListApiVersionsPagedResponse listApiVersions(ApiName parent)
Returns matching versions.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); for (ApiVersion element : registryClient.listApiVersions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of versions. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiVersions
public final RegistryClient.ListApiVersionsPagedResponse listApiVersions(String parent)
Returns matching versions.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { String parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString(); for (ApiVersion element : registryClient.listApiVersions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of versions. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiVersions
public final RegistryClient.ListApiVersionsPagedResponse listApiVersions(ListApiVersionsRequest request)
Returns matching versions.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { ListApiVersionsRequest request = ListApiVersionsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (ApiVersion element : registryClient.listApiVersions(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiVersionsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiVersionsRequest,RegistryClient.ListApiVersionsPagedResponse> listApiVersionsPagedCallable()
Returns matching versions.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { ListApiVersionsRequest request = ListApiVersionsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<ApiVersion> future = registryClient.listApiVersionsPagedCallable().futureCall(request); // Do something. for (ApiVersion element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApiVersionsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiVersionsRequest,ListApiVersionsResponse> listApiVersionsCallable()
Returns matching versions.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { ListApiVersionsRequest request = ListApiVersionsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListApiVersionsResponse response = registryClient.listApiVersionsCallable().call(request); for (ApiVersion element : response.getApiVersionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getApiVersion
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); }- Parameters:
name- Required. The name of the version to retrieve. Format: `projects/*/locations/*/apis/*/versions/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiVersion
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); }- Parameters:
name- Required. The name of the version to retrieve. Format: `projects/*/locations/*/apis/*/versions/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiVersion
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiVersionCallable
public final com.google.api.gax.rpc.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(); }
-
createApiVersion
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:
parent- Required. The parent, which owns this collection of versions. Format: `projects/*/locations/*/apis/*`apiVersion- Required. The version to create.apiVersionId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiVersion
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:
parent- Required. The parent, which owns this collection of versions. Format: `projects/*/locations/*/apis/*`apiVersion- Required. The version to create.apiVersionId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiVersion
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiVersionCallable
public final com.google.api.gax.rpc.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(); }
-
updateApiVersion
public final ApiVersion updateApiVersion(ApiVersion apiVersion, com.google.protobuf.FieldMask updateMask)
Used to modify 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()) { ApiVersion apiVersion = ApiVersion.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ApiVersion response = registryClient.updateApiVersion(apiVersion, updateMask); }- Parameters:
apiVersion- Required. The version to update.The `name` field is used to identify the version to update. Format: `projects/*/locations/*/apis/*/versions/*`
updateMask- The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApiVersion
public final ApiVersion updateApiVersion(UpdateApiVersionRequest request)
Used to modify 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()) { UpdateApiVersionRequest request = UpdateApiVersionRequest.newBuilder() .setApiVersion(ApiVersion.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiVersion response = registryClient.updateApiVersion(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApiVersionCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateApiVersionRequest,ApiVersion> updateApiVersionCallable()
Used to modify 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()) { UpdateApiVersionRequest request = UpdateApiVersionRequest.newBuilder() .setApiVersion(ApiVersion.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<ApiVersion> future = registryClient.updateApiVersionCallable().futureCall(request); // Do something. ApiVersion response = future.get(); }
-
deleteApiVersion
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); }- Parameters:
name- Required. The name of the version to delete. Format: `projects/*/locations/*/apis/*/versions/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiVersion
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); }- Parameters:
name- Required. The name of the version to delete. Format: `projects/*/locations/*/apis/*/versions/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiVersion
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiVersionCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteApiVersionRequest,com.google.protobuf.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(); }
-
listApiSpecs
public final RegistryClient.ListApiSpecsPagedResponse listApiSpecs(ApiVersionName parent)
Returns matching specs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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]"); for (ApiSpec element : registryClient.listApiSpecs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of specs. Format: `projects/*/locations/*/apis/*/versions/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiSpecs
public final RegistryClient.ListApiSpecsPagedResponse listApiSpecs(String parent)
Returns matching specs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); for (ApiSpec element : registryClient.listApiSpecs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of specs. Format: `projects/*/locations/*/apis/*/versions/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiSpecs
public final RegistryClient.ListApiSpecsPagedResponse listApiSpecs(ListApiSpecsRequest request)
Returns matching specs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApiSpecsRequest request = ListApiSpecsRequest.newBuilder() .setParent( ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (ApiSpec element : registryClient.listApiSpecs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiSpecsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiSpecsRequest,RegistryClient.ListApiSpecsPagedResponse> listApiSpecsPagedCallable()
Returns matching specs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApiSpecsRequest request = ListApiSpecsRequest.newBuilder() .setParent( ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<ApiSpec> future = registryClient.listApiSpecsPagedCallable().futureCall(request); // Do something. for (ApiSpec element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApiSpecsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiSpecsRequest,ListApiSpecsResponse> listApiSpecsCallable()
Returns matching specs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApiSpecsRequest request = ListApiSpecsRequest.newBuilder() .setParent( ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListApiSpecsResponse response = registryClient.listApiSpecsCallable().call(request); for (ApiSpec element : response.getApiSpecsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getApiSpec
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); }- Parameters:
name- Required. The name of the spec to retrieve. Format: `projects/*/locations/*/apis/*/versions/*/specs/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiSpec
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); }- Parameters:
name- Required. The name of the spec to retrieve. Format: `projects/*/locations/*/apis/*/versions/*/specs/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiSpec
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiSpecCallable
public final com.google.api.gax.rpc.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(); }
-
getApiSpecContents
public final com.google.api.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); }- Parameters:
name- Required. The name of the spec whose contents should be retrieved. Format: `projects/*/locations/*/apis/*/versions/*/specs/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiSpecContents
public final com.google.api.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); }- Parameters:
name- Required. The name of the spec whose contents should be retrieved. Format: `projects/*/locations/*/apis/*/versions/*/specs/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiSpecContents
public final com.google.api.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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiSpecContentsCallable
public final com.google.api.gax.rpc.UnaryCallable<GetApiSpecContentsRequest,com.google.api.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(); }
-
createApiSpec
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:
parent- Required. The parent, which owns this collection of specs. Format: `projects/*/locations/*/apis/*/versions/*`apiSpec- Required. The spec to create.apiSpecId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiSpec
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:
parent- Required. The parent, which owns this collection of specs. Format: `projects/*/locations/*/apis/*/versions/*`apiSpec- Required. The spec to create.apiSpecId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiSpec
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiSpecCallable
public final com.google.api.gax.rpc.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(); }
-
updateApiSpec
public final ApiSpec updateApiSpec(ApiSpec apiSpec, com.google.protobuf.FieldMask updateMask)
Used to modify 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()) { ApiSpec apiSpec = ApiSpec.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ApiSpec response = registryClient.updateApiSpec(apiSpec, updateMask); }- Parameters:
apiSpec- Required. The spec to update.The `name` field is used to identify the spec to update. Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
updateMask- The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApiSpec
public final ApiSpec updateApiSpec(UpdateApiSpecRequest request)
Used to modify 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()) { UpdateApiSpecRequest request = UpdateApiSpecRequest.newBuilder() .setApiSpec(ApiSpec.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiSpec response = registryClient.updateApiSpec(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApiSpecCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateApiSpecRequest,ApiSpec> updateApiSpecCallable()
Used to modify 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()) { UpdateApiSpecRequest request = UpdateApiSpecRequest.newBuilder() .setApiSpec(ApiSpec.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<ApiSpec> future = registryClient.updateApiSpecCallable().futureCall(request); // Do something. ApiSpec response = future.get(); }
-
deleteApiSpec
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); }- Parameters:
name- Required. The name of the spec to delete. Format: `projects/*/locations/*/apis/*/versions/*/specs/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiSpec
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); }- Parameters:
name- Required. The name of the spec to delete. Format: `projects/*/locations/*/apis/*/versions/*/specs/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiSpec
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiSpecCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteApiSpecRequest,com.google.protobuf.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(); }
-
tagApiSpecRevision
public final ApiSpec tagApiSpecRevision(TagApiSpecRevisionRequest request)
Adds a tag to a specified 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()) { TagApiSpecRevisionRequest request = TagApiSpecRevisionRequest.newBuilder() .setName( ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]") .toString()) .setTag("tag114586") .build(); ApiSpec response = registryClient.tagApiSpecRevision(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
tagApiSpecRevisionCallable
public final com.google.api.gax.rpc.UnaryCallable<TagApiSpecRevisionRequest,ApiSpec> tagApiSpecRevisionCallable()
Adds a tag to a specified 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()) { TagApiSpecRevisionRequest request = TagApiSpecRevisionRequest.newBuilder() .setName( ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]") .toString()) .setTag("tag114586") .build(); ApiFuture<ApiSpec> future = registryClient.tagApiSpecRevisionCallable().futureCall(request); // Do something. ApiSpec response = future.get(); }
-
listApiSpecRevisions
public final RegistryClient.ListApiSpecRevisionsPagedResponse listApiSpecRevisions(ListApiSpecRevisionsRequest request)
Lists all revisions of a spec. 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()) { ListApiSpecRevisionsRequest request = ListApiSpecRevisionsRequest.newBuilder() .setName( ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (ApiSpec element : registryClient.listApiSpecRevisions(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiSpecRevisionsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiSpecRevisionsRequest,RegistryClient.ListApiSpecRevisionsPagedResponse> listApiSpecRevisionsPagedCallable()
Lists all revisions of a spec. 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()) { ListApiSpecRevisionsRequest request = ListApiSpecRevisionsRequest.newBuilder() .setName( ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<ApiSpec> future = registryClient.listApiSpecRevisionsPagedCallable().futureCall(request); // Do something. for (ApiSpec element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApiSpecRevisionsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiSpecRevisionsRequest,ListApiSpecRevisionsResponse> listApiSpecRevisionsCallable()
Lists all revisions of a spec. 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()) { ListApiSpecRevisionsRequest request = ListApiSpecRevisionsRequest.newBuilder() .setName( ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListApiSpecRevisionsResponse response = registryClient.listApiSpecRevisionsCallable().call(request); for (ApiSpec element : response.getApiSpecsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
rollbackApiSpec
public final ApiSpec rollbackApiSpec(RollbackApiSpecRequest request)
Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { RollbackApiSpecRequest request = RollbackApiSpecRequest.newBuilder() .setName( ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]") .toString()) .setRevisionId("revisionId-1507445162") .build(); ApiSpec response = registryClient.rollbackApiSpec(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
rollbackApiSpecCallable
public final com.google.api.gax.rpc.UnaryCallable<RollbackApiSpecRequest,ApiSpec> rollbackApiSpecCallable()
Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { RollbackApiSpecRequest request = RollbackApiSpecRequest.newBuilder() .setName( ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]") .toString()) .setRevisionId("revisionId-1507445162") .build(); ApiFuture<ApiSpec> future = registryClient.rollbackApiSpecCallable().futureCall(request); // Do something. ApiSpec response = future.get(); }
-
deleteApiSpecRevision
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); }- Parameters:
name- 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`
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiSpecRevision
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); }- Parameters:
name- 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`
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiSpecRevision
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiSpecRevisionCallable
public final com.google.api.gax.rpc.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(); }
-
listApiDeployments
public final RegistryClient.ListApiDeploymentsPagedResponse listApiDeployments(ApiName parent)
Returns matching deployments.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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]"); for (ApiDeployment element : registryClient.listApiDeployments(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of deployments. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiDeployments
public final RegistryClient.ListApiDeploymentsPagedResponse listApiDeployments(String parent)
Returns matching deployments.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); for (ApiDeployment element : registryClient.listApiDeployments(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of deployments. Format: `projects/*/locations/*/apis/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiDeployments
public final RegistryClient.ListApiDeploymentsPagedResponse listApiDeployments(ListApiDeploymentsRequest request)
Returns matching deployments.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApiDeploymentsRequest request = ListApiDeploymentsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (ApiDeployment element : registryClient.listApiDeployments(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiDeploymentsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiDeploymentsRequest,RegistryClient.ListApiDeploymentsPagedResponse> listApiDeploymentsPagedCallable()
Returns matching deployments.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApiDeploymentsRequest request = ListApiDeploymentsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<ApiDeployment> future = registryClient.listApiDeploymentsPagedCallable().futureCall(request); // Do something. for (ApiDeployment element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApiDeploymentsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiDeploymentsRequest,ListApiDeploymentsResponse> listApiDeploymentsCallable()
Returns matching deployments.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListApiDeploymentsRequest request = ListApiDeploymentsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListApiDeploymentsResponse response = registryClient.listApiDeploymentsCallable().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; } } }
-
getApiDeployment
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); }- Parameters:
name- Required. The name of the deployment to retrieve. Format: `projects/*/locations/*/apis/*/deployments/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiDeployment
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); }- Parameters:
name- Required. The name of the deployment to retrieve. Format: `projects/*/locations/*/apis/*/deployments/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiDeployment
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getApiDeploymentCallable
public final com.google.api.gax.rpc.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(); }
-
createApiDeployment
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:
parent- Required. The parent, which owns this collection of deployments. Format: `projects/*/locations/*/apis/*`apiDeployment- Required. The deployment to create.apiDeploymentId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiDeployment
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:
parent- Required. The parent, which owns this collection of deployments. Format: `projects/*/locations/*/apis/*`apiDeployment- Required. The deployment to create.apiDeploymentId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiDeployment
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createApiDeploymentCallable
public final com.google.api.gax.rpc.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(); }
-
updateApiDeployment
public final ApiDeployment updateApiDeployment(ApiDeployment apiDeployment, com.google.protobuf.FieldMask updateMask)
Used to modify 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()) { ApiDeployment apiDeployment = ApiDeployment.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ApiDeployment response = registryClient.updateApiDeployment(apiDeployment, updateMask); }- Parameters:
apiDeployment- Required. The deployment to update.The `name` field is used to identify the deployment to update. Format: `projects/*/locations/*/apis/*/deployments/*`
updateMask- The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApiDeployment
public final ApiDeployment updateApiDeployment(UpdateApiDeploymentRequest request)
Used to modify 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()) { UpdateApiDeploymentRequest request = UpdateApiDeploymentRequest.newBuilder() .setApiDeployment(ApiDeployment.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiDeployment response = registryClient.updateApiDeployment(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
updateApiDeploymentCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateApiDeploymentRequest,ApiDeployment> updateApiDeploymentCallable()
Used to modify 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()) { UpdateApiDeploymentRequest request = UpdateApiDeploymentRequest.newBuilder() .setApiDeployment(ApiDeployment.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<ApiDeployment> future = registryClient.updateApiDeploymentCallable().futureCall(request); // Do something. ApiDeployment response = future.get(); }
-
deleteApiDeployment
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); }- Parameters:
name- Required. The name of the deployment to delete. Format: `projects/*/locations/*/apis/*/deployments/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiDeployment
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); }- Parameters:
name- Required. The name of the deployment to delete. Format: `projects/*/locations/*/apis/*/deployments/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiDeployment
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiDeploymentCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteApiDeploymentRequest,com.google.protobuf.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(); }
-
tagApiDeploymentRevision
public final ApiDeployment tagApiDeploymentRevision(TagApiDeploymentRevisionRequest request)
Adds a tag to a specified 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()) { TagApiDeploymentRevisionRequest request = TagApiDeploymentRevisionRequest.newBuilder() .setName( ApiDeploymentName.of("[PROJECT]", "[LOCATION]", "[API]", "[DEPLOYMENT]") .toString()) .setTag("tag114586") .build(); ApiDeployment response = registryClient.tagApiDeploymentRevision(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
tagApiDeploymentRevisionCallable
public final com.google.api.gax.rpc.UnaryCallable<TagApiDeploymentRevisionRequest,ApiDeployment> tagApiDeploymentRevisionCallable()
Adds a tag to a specified 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()) { TagApiDeploymentRevisionRequest request = TagApiDeploymentRevisionRequest.newBuilder() .setName( ApiDeploymentName.of("[PROJECT]", "[LOCATION]", "[API]", "[DEPLOYMENT]") .toString()) .setTag("tag114586") .build(); ApiFuture<ApiDeployment> future = registryClient.tagApiDeploymentRevisionCallable().futureCall(request); // Do something. ApiDeployment response = future.get(); }
-
listApiDeploymentRevisions
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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listApiDeploymentRevisionsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListApiDeploymentRevisionsRequest,RegistryClient.ListApiDeploymentRevisionsPagedResponse> listApiDeploymentRevisionsPagedCallable()
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(); ApiFuture<ApiDeployment> future = registryClient.listApiDeploymentRevisionsPagedCallable().futureCall(request); // Do something. for (ApiDeployment element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listApiDeploymentRevisionsCallable
public final com.google.api.gax.rpc.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; } } }
-
rollbackApiDeployment
public final ApiDeployment rollbackApiDeployment(RollbackApiDeploymentRequest request)
Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { RollbackApiDeploymentRequest request = RollbackApiDeploymentRequest.newBuilder() .setName( ApiDeploymentName.of("[PROJECT]", "[LOCATION]", "[API]", "[DEPLOYMENT]") .toString()) .setRevisionId("revisionId-1507445162") .build(); ApiDeployment response = registryClient.rollbackApiDeployment(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
rollbackApiDeploymentCallable
public final com.google.api.gax.rpc.UnaryCallable<RollbackApiDeploymentRequest,ApiDeployment> rollbackApiDeploymentCallable()
Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { RollbackApiDeploymentRequest request = RollbackApiDeploymentRequest.newBuilder() .setName( ApiDeploymentName.of("[PROJECT]", "[LOCATION]", "[API]", "[DEPLOYMENT]") .toString()) .setRevisionId("revisionId-1507445162") .build(); ApiFuture<ApiDeployment> future = registryClient.rollbackApiDeploymentCallable().futureCall(request); // Do something. ApiDeployment response = future.get(); }
-
deleteApiDeploymentRevision
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); }- Parameters:
name- 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`
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiDeploymentRevision
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); }- Parameters:
name- 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`
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiDeploymentRevision
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteApiDeploymentRevisionCallable
public final com.google.api.gax.rpc.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(); }
-
listArtifacts
public final RegistryClient.ListArtifactsPagedResponse listArtifacts(ApiDeploymentName parent)
Returns matching 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 parent = ApiDeploymentName.of("[PROJECT]", "[LOCATION]", "[API]", "[DEPLOYMENT]"); for (Artifact element : registryClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listArtifacts
public final RegistryClient.ListArtifactsPagedResponse listArtifacts(ApiName parent)
Returns matching 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()) { ApiName parent = ApiName.of("[PROJECT]", "[LOCATION]", "[API]"); for (Artifact element : registryClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listArtifacts
public final RegistryClient.ListArtifactsPagedResponse listArtifacts(ApiSpecName parent)
Returns matching 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 parent = ApiSpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]"); for (Artifact element : registryClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listArtifacts
public final RegistryClient.ListArtifactsPagedResponse listArtifacts(ApiVersionName parent)
Returns matching 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()) { ApiVersionName parent = ApiVersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]"); for (Artifact element : registryClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listArtifacts
public final RegistryClient.ListArtifactsPagedResponse listArtifacts(LocationName parent)
Returns matching 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()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Artifact element : registryClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listArtifacts
public final RegistryClient.ListArtifactsPagedResponse listArtifacts(String parent)
Returns matching 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 parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Artifact element : registryClient.listArtifacts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listArtifacts
public final RegistryClient.ListArtifactsPagedResponse listArtifacts(ListArtifactsRequest request)
Returns matching 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()) { ListArtifactsRequest request = ListArtifactsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (Artifact element : registryClient.listArtifacts(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listArtifactsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListArtifactsRequest,RegistryClient.ListArtifactsPagedResponse> listArtifactsPagedCallable()
Returns matching 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()) { ListArtifactsRequest request = ListArtifactsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<Artifact> future = registryClient.listArtifactsPagedCallable().futureCall(request); // Do something. for (Artifact element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listArtifactsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListArtifactsRequest,ListArtifactsResponse> listArtifactsCallable()
Returns matching 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()) { ListArtifactsRequest request = ListArtifactsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListArtifactsResponse response = registryClient.listArtifactsCallable().call(request); for (Artifact element : response.getArtifactsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getArtifact
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); }- Parameters:
name- Required. The name of the artifact to retrieve. Format: `{parent}/artifacts/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getArtifact
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); }- Parameters:
name- Required. The name of the artifact to retrieve. Format: `{parent}/artifacts/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getArtifact
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getArtifactCallable
public final com.google.api.gax.rpc.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(); }
-
getArtifactContents
public final com.google.api.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); }- Parameters:
name- Required. The name of the artifact whose contents should be retrieved. Format: `{parent}/artifacts/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getArtifactContents
public final com.google.api.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); }- Parameters:
name- Required. The name of the artifact whose contents should be retrieved. Format: `{parent}/artifacts/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getArtifactContents
public final com.google.api.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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getArtifactContentsCallable
public final com.google.api.gax.rpc.UnaryCallable<GetArtifactContentsRequest,com.google.api.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(); }
-
createArtifact
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:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`artifact- Required. The artifact to create.artifactId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createArtifact
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:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`artifact- Required. The artifact to create.artifactId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createArtifact
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:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`artifact- Required. The artifact to create.artifactId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createArtifact
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:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`artifact- Required. The artifact to create.artifactId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createArtifact
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:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`artifact- Required. The artifact to create.artifactId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createArtifact
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:
parent- Required. The parent, which owns this collection of artifacts. Format: `{parent}`artifact- Required. The artifact to create.artifactId- 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][0-9]-/.
Following AIP-162, IDs must not have the form of a UUID.
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createArtifact
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createArtifactCallable
public final com.google.api.gax.rpc.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(); }
-
replaceArtifact
public final Artifact replaceArtifact(Artifact artifact)
Used to replace 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()) { Artifact artifact = Artifact.newBuilder().build(); Artifact response = registryClient.replaceArtifact(artifact); }- Parameters:
artifact- Required. The artifact to replace.The `name` field is used to identify the artifact to replace. Format: `{parent}/artifacts/*`
- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
replaceArtifact
public final Artifact replaceArtifact(ReplaceArtifactRequest request)
Used to replace 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()) { ReplaceArtifactRequest request = ReplaceArtifactRequest.newBuilder().setArtifact(Artifact.newBuilder().build()).build(); Artifact response = registryClient.replaceArtifact(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
replaceArtifactCallable
public final com.google.api.gax.rpc.UnaryCallable<ReplaceArtifactRequest,Artifact> replaceArtifactCallable()
Used to replace 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()) { ReplaceArtifactRequest request = ReplaceArtifactRequest.newBuilder().setArtifact(Artifact.newBuilder().build()).build(); ApiFuture<Artifact> future = registryClient.replaceArtifactCallable().futureCall(request); // Do something. Artifact response = future.get(); }
-
deleteArtifact
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); }- Parameters:
name- Required. The name of the artifact to delete. Format: `{parent}/artifacts/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteArtifact
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); }- Parameters:
name- Required. The name of the artifact to delete. Format: `{parent}/artifacts/*`- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteArtifact
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
deleteArtifactCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteArtifactRequest,com.google.protobuf.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(); }
-
listLocations
public final RegistryClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : registryClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,RegistryClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = registryClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = registryClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = registryClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RegistryClient registryClient = RegistryClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = registryClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); }
-
setIamPolicy
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = registryClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
setIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = registryClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); }
-
getIamPolicy
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
getIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Gets the 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(); }
-
testIamPermissions
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
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.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = registryClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
testIamPermissionsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
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.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = registryClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); }
-
close
public final void close()
- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNowin interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException- Specified by:
awaitTerminationin interfacecom.google.api.gax.core.BackgroundResource- Throws:
InterruptedException
-
-